repo_name
stringlengths 1
52
| repo_creator
stringclasses 6
values | programming_language
stringclasses 4
values | code
stringlengths 0
9.68M
| num_lines
int64 1
234k
|
---|---|---|---|---|
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// Insufficient permissions to make request.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Unexpected error occurred. Problem on the server.
type InternalServerException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Request references a resource that doesn't exist.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Service quotas have been exceeded.
type ServiceQuotaExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ServiceQuotaExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceQuotaExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceQuotaExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceQuotaExceededException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Exception caused by throttling.
type ThrottlingException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ThrottlingException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ThrottlingException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ThrottlingException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ThrottlingException"
}
return *e.ErrorCodeOverride
}
func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Unable to process the request because the client provided input failed to
// satisfy request constraints.
type ValidationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ValidationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ValidationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ValidationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ValidationException"
}
return *e.ErrorCodeOverride
}
func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 166 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"github.com/aws/aws-sdk-go-v2/service/tnb/document"
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// Provides error information.
type ErrorInfo struct {
// Error cause.
Cause *string
// Error details.
Details *string
noSmithyDocumentSerde
}
// Metadata for function package artifacts. Artifacts are the contents of the
// package descriptor file and the state of the package.
type FunctionArtifactMeta struct {
// Lists of function package overrides.
Overrides []ToscaOverride
noSmithyDocumentSerde
}
// The metadata of a network function instance. A network function instance is a
// function in a function package .
type GetSolFunctionInstanceMetadata struct {
// The date that the resource was created.
//
// This member is required.
CreatedAt *time.Time
// The date that the resource was last modified.
//
// This member is required.
LastModified *time.Time
noSmithyDocumentSerde
}
// Metadata related to the function package. A function package is a .zip file in
// CSAR (Cloud Service Archive) format that contains a network function (an ETSI
// standard telecommunication application) and function package descriptor that
// uses the TOSCA standard to describe how the network functions should run on your
// network.
type GetSolFunctionPackageMetadata struct {
// The date that the resource was created.
//
// This member is required.
CreatedAt *time.Time
// The date that the resource was last modified.
//
// This member is required.
LastModified *time.Time
// Metadata related to the function package descriptor of the function package.
Vnfd *FunctionArtifactMeta
noSmithyDocumentSerde
}
// Information about a network function. A network instance is a single network
// created in Amazon Web Services TNB that can be deployed and on which life-cycle
// operations (like terminate, update, and delete) can be performed.
type GetSolInstantiatedVnfInfo struct {
// State of the network function.
VnfState VnfOperationalState
noSmithyDocumentSerde
}
// The metadata of a network instance. A network instance is a single network
// created in Amazon Web Services TNB that can be deployed and on which life-cycle
// operations (like terminate, update, and delete) can be performed.
type GetSolNetworkInstanceMetadata struct {
// The date that the resource was created.
//
// This member is required.
CreatedAt *time.Time
// The date that the resource was last modified.
//
// This member is required.
LastModified *time.Time
noSmithyDocumentSerde
}
// Metadata related to a network operation occurrence. A network operation is any
// operation that is done to your network, such as network instance instantiation
// or termination.
type GetSolNetworkOperationMetadata struct {
// The date that the resource was created.
//
// This member is required.
CreatedAt *time.Time
// The date that the resource was last modified.
//
// This member is required.
LastModified *time.Time
noSmithyDocumentSerde
}
// Gets the details of a network operation. A network operation is any operation
// that is done to your network, such as network instance instantiation or
// termination.
type GetSolNetworkOperationTaskDetails struct {
// Context for the network operation task.
TaskContext map[string]string
// Task end time.
TaskEndTime *time.Time
// Task error details.
TaskErrorDetails *ErrorInfo
// Task name.
TaskName *string
// Task start time.
TaskStartTime *time.Time
// Task status.
TaskStatus TaskStatus
noSmithyDocumentSerde
}
// Metadata associated with a network package. A network package is a .zip file in
// CSAR (Cloud Service Archive) format defines the function packages you want to
// deploy and the Amazon Web Services infrastructure you want to deploy them on.
type GetSolNetworkPackageMetadata struct {
// The date that the resource was created.
//
// This member is required.
CreatedAt *time.Time
// The date that the resource was last modified.
//
// This member is required.
LastModified *time.Time
// Metadata related to the onboarded network service descriptor in the network
// package.
Nsd *NetworkArtifactMeta
noSmithyDocumentSerde
}
// Details of resource associated with a network function. A network instance is a
// single network created in Amazon Web Services TNB that can be deployed and on
// which life-cycle operations (like terminate, update, and delete) can be
// performed.
type GetSolVnfcResourceInfo struct {
// The metadata of the network function compute.
Metadata *GetSolVnfcResourceInfoMetadata
noSmithyDocumentSerde
}
// The metadata of a network function. A network instance is a single network
// created in Amazon Web Services TNB that can be deployed and on which life-cycle
// operations (like terminate, update, and delete) can be performed.
type GetSolVnfcResourceInfoMetadata struct {
// Information about the cluster.
Cluster *string
// Information about the helm chart.
HelmChart *string
// Information about the node group.
NodeGroup *string
noSmithyDocumentSerde
}
// Information about the network function. A network function instance is a
// function in a function package .
type GetSolVnfInfo struct {
// State of the network function instance.
VnfState VnfOperationalState
// Compute info used by the network function instance.
VnfcResourceInfo []GetSolVnfcResourceInfo
noSmithyDocumentSerde
}
// Lifecycle management operation details on the network instance. Lifecycle
// management operations are deploy, update, or delete operations.
type LcmOperationInfo struct {
// The identifier of the network operation.
//
// This member is required.
NsLcmOpOccId *string
noSmithyDocumentSerde
}
// Lists information about a network function instance. A network function
// instance is a function in a function package .
type ListSolFunctionInstanceInfo struct {
// Network function instance ARN.
//
// This member is required.
Arn *string
// Network function instance ID.
//
// This member is required.
Id *string
// Network function instance instantiation state.
//
// This member is required.
InstantiationState VnfInstantiationState
// Network function instance metadata.
//
// This member is required.
Metadata *ListSolFunctionInstanceMetadata
// Network instance ID.
//
// This member is required.
NsInstanceId *string
// Function package ID.
//
// This member is required.
VnfPkgId *string
// Information about a network function. A network instance is a single network
// created in Amazon Web Services TNB that can be deployed and on which life-cycle
// operations (like terminate, update, and delete) can be performed.
InstantiatedVnfInfo *GetSolInstantiatedVnfInfo
// Function package name.
VnfPkgName *string
noSmithyDocumentSerde
}
// Lists network function instance metadata. A network function instance is a
// function in a function package .
type ListSolFunctionInstanceMetadata struct {
// When the network function instance was created.
//
// This member is required.
CreatedAt *time.Time
// When the network function instance was last modified.
//
// This member is required.
LastModified *time.Time
noSmithyDocumentSerde
}
// Information about a function package. A function package is a .zip file in CSAR
// (Cloud Service Archive) format that contains a network function (an ETSI
// standard telecommunication application) and function package descriptor that
// uses the TOSCA standard to describe how the network functions should run on your
// network.
type ListSolFunctionPackageInfo struct {
// Function package ARN.
//
// This member is required.
Arn *string
// ID of the function package.
//
// This member is required.
Id *string
// Onboarding state of the function package.
//
// This member is required.
OnboardingState OnboardingState
// Operational state of the function package.
//
// This member is required.
OperationalState OperationalState
// Usage state of the function package.
//
// This member is required.
UsageState UsageState
// The metadata of the function package.
Metadata *ListSolFunctionPackageMetadata
// The product name for the network function.
VnfProductName *string
// Provider of the function package and the function package descriptor.
VnfProvider *string
// Identifies the function package and the function package descriptor.
VnfdId *string
// Identifies the version of the function package descriptor.
VnfdVersion *string
noSmithyDocumentSerde
}
// Details for the function package metadata. A function package is a .zip file in
// CSAR (Cloud Service Archive) format that contains a network function (an ETSI
// standard telecommunication application) and function package descriptor that
// uses the TOSCA standard to describe how the network functions should run on your
// network.
type ListSolFunctionPackageMetadata struct {
// The date that the resource was created.
//
// This member is required.
CreatedAt *time.Time
// The date that the resource was last modified.
//
// This member is required.
LastModified *time.Time
noSmithyDocumentSerde
}
// Info about the specific network instance. A network instance is a single
// network created in Amazon Web Services TNB that can be deployed and on which
// life-cycle operations (like terminate, update, and delete) can be performed.
type ListSolNetworkInstanceInfo struct {
// Network instance ARN.
//
// This member is required.
Arn *string
// ID of the network instance.
//
// This member is required.
Id *string
// The metadata of the network instance.
//
// This member is required.
Metadata *ListSolNetworkInstanceMetadata
// Human-readable description of the network instance.
//
// This member is required.
NsInstanceDescription *string
// Human-readable name of the network instance.
//
// This member is required.
NsInstanceName *string
// The state of the network instance.
//
// This member is required.
NsState NsState
// ID of the network service descriptor in the network package.
//
// This member is required.
NsdId *string
// ID of the network service descriptor in the network package.
//
// This member is required.
NsdInfoId *string
noSmithyDocumentSerde
}
// Metadata details for a network instance. A network instance is a single network
// created in Amazon Web Services TNB that can be deployed and on which life-cycle
// operations (like terminate, update, and delete) can be performed.
type ListSolNetworkInstanceMetadata struct {
// The date that the resource was created.
//
// This member is required.
CreatedAt *time.Time
// The date that the resource was last modified.
//
// This member is required.
LastModified *time.Time
noSmithyDocumentSerde
}
// Information parameters for a network operation.
type ListSolNetworkOperationsInfo struct {
// Network operation ARN.
//
// This member is required.
Arn *string
// ID of this network operation.
//
// This member is required.
Id *string
// Type of lifecycle management network operation.
//
// This member is required.
LcmOperationType LcmOperationType
// ID of the network instance related to this operation.
//
// This member is required.
NsInstanceId *string
// The state of the network operation.
//
// This member is required.
OperationState NsLcmOperationState
// Error related to this specific network operation.
Error *ProblemDetails
// Metadata related to this network operation.
Metadata *ListSolNetworkOperationsMetadata
noSmithyDocumentSerde
}
// Metadata related to a network operation. A network operation is any operation
// that is done to your network, such as network instance instantiation or
// termination.
type ListSolNetworkOperationsMetadata struct {
// The date that the resource was created.
//
// This member is required.
CreatedAt *time.Time
// The date that the resource was last modified.
//
// This member is required.
LastModified *time.Time
noSmithyDocumentSerde
}
// Details of a network package. A network package is a .zip file in CSAR (Cloud
// Service Archive) format defines the function packages you want to deploy and the
// Amazon Web Services infrastructure you want to deploy them on.
type ListSolNetworkPackageInfo struct {
// Network package ARN.
//
// This member is required.
Arn *string
// ID of the individual network package.
//
// This member is required.
Id *string
// The metadata of the network package.
//
// This member is required.
Metadata *ListSolNetworkPackageMetadata
// Onboarding state of the network service descriptor in the network package.
//
// This member is required.
NsdOnboardingState NsdOnboardingState
// Operational state of the network service descriptor in the network package.
//
// This member is required.
NsdOperationalState NsdOperationalState
// Usage state of the network service descriptor in the network package.
//
// This member is required.
NsdUsageState NsdUsageState
// Designer of the onboarded network service descriptor in the network package.
NsdDesigner *string
// ID of the network service descriptor on which the network package is based.
NsdId *string
// Identifies a network service descriptor in a version independent manner.
NsdInvariantId *string
// Name of the onboarded network service descriptor in the network package.
NsdName *string
// Version of the onboarded network service descriptor in the network package.
NsdVersion *string
// Identifies the function package for the function package descriptor referenced
// by the onboarded network package.
VnfPkgIds []string
noSmithyDocumentSerde
}
// Metadata related to a network package. A network package is a .zip file in CSAR
// (Cloud Service Archive) format defines the function packages you want to deploy
// and the Amazon Web Services infrastructure you want to deploy them on.
type ListSolNetworkPackageMetadata struct {
// The date that the resource was created.
//
// This member is required.
CreatedAt *time.Time
// The date that the resource was last modified.
//
// This member is required.
LastModified *time.Time
noSmithyDocumentSerde
}
// Metadata for network package artifacts. Artifacts are the contents of the
// package descriptor file and the state of the package.
type NetworkArtifactMeta struct {
// Lists network package overrides.
Overrides []ToscaOverride
noSmithyDocumentSerde
}
// Details related to problems with AWS TNB resources.
type ProblemDetails struct {
// A human-readable explanation specific to this occurrence of the problem.
//
// This member is required.
Detail *string
// A human-readable title of the problem type.
Title *string
noSmithyDocumentSerde
}
// Update metadata in a function package. A function package is a .zip file in
// CSAR (Cloud Service Archive) format that contains a network function (an ETSI
// standard telecommunication application) and function package descriptor that
// uses the TOSCA standard to describe how the network functions should run on your
// network.
type PutSolFunctionPackageContentMetadata struct {
// Metadata for function package artifacts. Artifacts are the contents of the
// package descriptor file and the state of the package.
Vnfd *FunctionArtifactMeta
noSmithyDocumentSerde
}
// Update metadata in a network package. A network package is a .zip file in CSAR
// (Cloud Service Archive) format defines the function packages you want to deploy
// and the Amazon Web Services infrastructure you want to deploy them on.
type PutSolNetworkPackageContentMetadata struct {
// Metadata for network package artifacts. Artifacts are the contents of the
// package descriptor file and the state of the package.
Nsd *NetworkArtifactMeta
noSmithyDocumentSerde
}
// Overrides of the TOSCA node.
type ToscaOverride struct {
// Default value for the override.
DefaultValue *string
// Name of the TOSCA override.
Name *string
noSmithyDocumentSerde
}
// Information parameters and/or the configurable properties for a network
// function. A network function instance is a function in a function package .
type UpdateSolNetworkModify struct {
// Provides values for the configurable properties declared in the function
// package descriptor.
//
// This member is required.
VnfConfigurableProperties document.Interface
// ID of the network function instance. A network function instance is a function
// in a function package .
//
// This member is required.
VnfInstanceId *string
noSmithyDocumentSerde
}
// Validates function package content metadata. A function package is a .zip file
// in CSAR (Cloud Service Archive) format that contains a network function (an ETSI
// standard telecommunication application) and function package descriptor that
// uses the TOSCA standard to describe how the network functions should run on your
// network.
type ValidateSolFunctionPackageContentMetadata struct {
// Metadata for function package artifacts. Artifacts are the contents of the
// package descriptor file and the state of the package.
Vnfd *FunctionArtifactMeta
noSmithyDocumentSerde
}
// Validates network package content metadata. A network package is a .zip file in
// CSAR (Cloud Service Archive) format defines the function packages you want to
// deploy and the Amazon Web Services infrastructure you want to deploy them on.
type ValidateSolNetworkPackageContentMetadata struct {
// Metadata for network package artifacts. Artifacts are the contents of the
// package descriptor file and the state of the package.
Nsd *NetworkArtifactMeta
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 658 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "Transcribe"
const ServiceAPIVersion = "2017-10-26"
// Client provides the API client to make operations call for Amazon Transcribe
// Service.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "transcribe", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 435 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new Call Analytics category. All categories are automatically applied
// to your Call Analytics transcriptions. Note that in order to apply categories to
// your transcriptions, you must create them before submitting your transcription
// request, as categories cannot be applied retroactively. When creating a new
// category, you can use the InputType parameter to label the category as a
// POST_CALL or a REAL_TIME category. POST_CALL categories can only be applied to
// post-call transcriptions and REAL_TIME categories can only be applied to
// real-time transcriptions. If you do not include InputType , your category is
// created as a POST_CALL category by default. Call Analytics categories are
// composed of rules. For each category, you must create between 1 and 20 rules.
// Rules can include these parameters: , , , and . To update an existing category,
// see . To learn more about Call Analytics categories, see Creating categories
// for post-call transcriptions (https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-batch.html)
// and Creating categories for real-time transcriptions (https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-stream.html)
// .
func (c *Client) CreateCallAnalyticsCategory(ctx context.Context, params *CreateCallAnalyticsCategoryInput, optFns ...func(*Options)) (*CreateCallAnalyticsCategoryOutput, error) {
if params == nil {
params = &CreateCallAnalyticsCategoryInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateCallAnalyticsCategory", params, optFns, c.addOperationCreateCallAnalyticsCategoryMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateCallAnalyticsCategoryOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateCallAnalyticsCategoryInput struct {
// A unique name, chosen by you, for your Call Analytics category. It's helpful to
// use a detailed naming system that will make sense to you in the future. For
// example, it's better to use sentiment-positive-last30seconds for a category
// over a generic name like test-category . Category names are case sensitive.
//
// This member is required.
CategoryName *string
// Rules define a Call Analytics category. When creating a new category, you must
// create between 1 and 20 rules for that category. For each rule, you specify a
// filter you want applied to the attributes of a call. For example, you can choose
// a sentiment filter that detects if a customer's sentiment was positive during
// the last 30 seconds of the call.
//
// This member is required.
Rules []types.Rule
// Choose whether you want to create a real-time or a post-call category for your
// Call Analytics transcription. Specifying POST_CALL assigns your category to
// post-call transcriptions; categories with this input type cannot be applied to
// streaming (real-time) transcriptions. Specifying REAL_TIME assigns your
// category to streaming transcriptions; categories with this input type cannot be
// applied to post-call transcriptions. If you do not include InputType , your
// category is created as a post-call category by default.
InputType types.InputType
noSmithyDocumentSerde
}
type CreateCallAnalyticsCategoryOutput struct {
// Provides you with the properties of your new category, including its associated
// rules.
CategoryProperties *types.CategoryProperties
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateCallAnalyticsCategoryMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateCallAnalyticsCategory{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateCallAnalyticsCategory{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateCallAnalyticsCategoryValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCallAnalyticsCategory(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateCallAnalyticsCategory(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "CreateCallAnalyticsCategory",
}
}
| 161 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new custom language model. When creating a new custom language model,
// you must specify:
// - If you want a Wideband (audio sample rates over 16,000 Hz) or Narrowband
// (audio sample rates under 16,000 Hz) base model
// - The location of your training and tuning files (this must be an Amazon S3
// URI)
// - The language of your model
// - A unique name for your model
func (c *Client) CreateLanguageModel(ctx context.Context, params *CreateLanguageModelInput, optFns ...func(*Options)) (*CreateLanguageModelOutput, error) {
if params == nil {
params = &CreateLanguageModelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateLanguageModel", params, optFns, c.addOperationCreateLanguageModelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateLanguageModelOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateLanguageModelInput struct {
// The Amazon Transcribe standard language model, or base model, used to create
// your custom language model. Amazon Transcribe offers two options for base
// models: Wideband and Narrowband. If the audio you want to transcribe has a
// sample rate of 16,000 Hz or greater, choose WideBand . To transcribe audio with
// a sample rate less than 16,000 Hz, choose NarrowBand .
//
// This member is required.
BaseModelName types.BaseModelName
// Contains the Amazon S3 location of the training data you want to use to create
// a new custom language model, and permissions to access this location. When using
// InputDataConfig , you must include these sub-parameters: S3Uri , which is the
// Amazon S3 location of your training data, and DataAccessRoleArn , which is the
// Amazon Resource Name (ARN) of the role that has permission to access your
// specified Amazon S3 location. You can optionally include TuningDataS3Uri , which
// is the Amazon S3 location of your tuning data. If you specify different Amazon
// S3 locations for training and tuning data, the ARN you use must have permissions
// to access both locations.
//
// This member is required.
InputDataConfig *types.InputDataConfig
// The language code that represents the language of your model. Each custom
// language model must contain terms in only one language, and the language you
// select for your custom language model must match the language of your training
// and tuning data. For a list of supported languages and their associated language
// codes, refer to the Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table. Note that US English ( en-US ) is the only language supported with Amazon
// Transcribe Medical. A custom language model can only be used to transcribe files
// in the same language as the model. For example, if you create a custom language
// model using US English ( en-US ), you can only apply this model to files that
// contain English audio.
//
// This member is required.
LanguageCode types.CLMLanguageCode
// A unique name, chosen by you, for your custom language model. This name is case
// sensitive, cannot contain spaces, and must be unique within an Amazon Web
// Services account. If you try to create a new custom language model with the same
// name as an existing custom language model, you get a ConflictException error.
//
// This member is required.
ModelName *string
// Adds one or more custom tags, each in the form of a key:value pair, to a new
// custom language model at the time you create this new model. To learn more about
// using tags with Amazon Transcribe, refer to Tagging resources (https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html)
// .
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateLanguageModelOutput struct {
// The Amazon Transcribe standard language model, or base model, you specified
// when creating your custom language model.
BaseModelName types.BaseModelName
// Lists your data access role ARN (Amazon Resource Name) and the Amazon S3
// locations you provided for your training ( S3Uri ) and tuning ( TuningDataS3Uri
// ) data.
InputDataConfig *types.InputDataConfig
// The language code you selected for your custom language model.
LanguageCode types.CLMLanguageCode
// The name of your custom language model.
ModelName *string
// The status of your custom language model. When the status displays as COMPLETED
// , your model is ready to use.
ModelStatus types.ModelStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateLanguageModelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateLanguageModel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateLanguageModel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateLanguageModelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLanguageModel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateLanguageModel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "CreateLanguageModel",
}
}
| 193 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a new custom medical vocabulary. Before creating a new custom medical
// vocabulary, you must first upload a text file that contains your vocabulary
// table into an Amazon S3 bucket. Note that this differs from , where you can
// include a list of terms within your request using the Phrases flag;
// CreateMedicalVocabulary does not support the Phrases flag and only accepts
// vocabularies in table format. Each language has a character set that contains
// all allowed characters for that specific language. If you use unsupported
// characters, your custom vocabulary request fails. Refer to Character Sets for
// Custom Vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html)
// to get the character set for your language. For more information, see Custom
// vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html)
// .
func (c *Client) CreateMedicalVocabulary(ctx context.Context, params *CreateMedicalVocabularyInput, optFns ...func(*Options)) (*CreateMedicalVocabularyOutput, error) {
if params == nil {
params = &CreateMedicalVocabularyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateMedicalVocabulary", params, optFns, c.addOperationCreateMedicalVocabularyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateMedicalVocabularyOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateMedicalVocabularyInput struct {
// The language code that represents the language of the entries in your custom
// vocabulary. US English ( en-US ) is the only language supported with Amazon
// Transcribe Medical.
//
// This member is required.
LanguageCode types.LanguageCode
// The Amazon S3 location (URI) of the text file that contains your custom medical
// vocabulary. The URI must be in the same Amazon Web Services Region as the
// resource you're calling. Here's an example URI path:
// s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txt
//
// This member is required.
VocabularyFileUri *string
// A unique name, chosen by you, for your new custom medical vocabulary. This name
// is case sensitive, cannot contain spaces, and must be unique within an Amazon
// Web Services account. If you try to create a new custom medical vocabulary with
// the same name as an existing custom medical vocabulary, you get a
// ConflictException error.
//
// This member is required.
VocabularyName *string
// Adds one or more custom tags, each in the form of a key:value pair, to a new
// custom medical vocabulary at the time you create this new custom vocabulary. To
// learn more about using tags with Amazon Transcribe, refer to Tagging resources (https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html)
// .
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateMedicalVocabularyOutput struct {
// If VocabularyState is FAILED , FailureReason contains information about why the
// medical transcription job request failed. See also: Common Errors (https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonErrors.html)
// .
FailureReason *string
// The language code you selected for your custom medical vocabulary. US English (
// en-US ) is the only language supported with Amazon Transcribe Medical.
LanguageCode types.LanguageCode
// The date and time you created your custom medical vocabulary. Timestamps are in
// the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// The name you chose for your custom medical vocabulary.
VocabularyName *string
// The processing state of your custom medical vocabulary. If the state is READY ,
// you can use the custom vocabulary in a StartMedicalTranscriptionJob request.
VocabularyState types.VocabularyState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateMedicalVocabularyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateMedicalVocabulary{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateMedicalVocabulary{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateMedicalVocabularyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMedicalVocabulary(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateMedicalVocabulary(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "CreateMedicalVocabulary",
}
}
| 180 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a new custom vocabulary. When creating a new custom vocabulary, you can
// either upload a text file that contains your new entries, phrases, and terms
// into an Amazon S3 bucket and include the URI in your request. Or you can include
// a list of terms directly in your request using the Phrases flag. Each language
// has a character set that contains all allowed characters for that specific
// language. If you use unsupported characters, your custom vocabulary request
// fails. Refer to Character Sets for Custom Vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html)
// to get the character set for your language. For more information, see Custom
// vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html)
// .
func (c *Client) CreateVocabulary(ctx context.Context, params *CreateVocabularyInput, optFns ...func(*Options)) (*CreateVocabularyOutput, error) {
if params == nil {
params = &CreateVocabularyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateVocabulary", params, optFns, c.addOperationCreateVocabularyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateVocabularyOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateVocabularyInput struct {
// The language code that represents the language of the entries in your custom
// vocabulary. Each custom vocabulary must contain terms in only one language. A
// custom vocabulary can only be used to transcribe files in the same language as
// the custom vocabulary. For example, if you create a custom vocabulary using US
// English ( en-US ), you can only apply this custom vocabulary to files that
// contain English audio. For a list of supported languages and their associated
// language codes, refer to the Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table.
//
// This member is required.
LanguageCode types.LanguageCode
// A unique name, chosen by you, for your new custom vocabulary. This name is case
// sensitive, cannot contain spaces, and must be unique within an Amazon Web
// Services account. If you try to create a new custom vocabulary with the same
// name as an existing custom vocabulary, you get a ConflictException error.
//
// This member is required.
VocabularyName *string
// The Amazon Resource Name (ARN) of an IAM role that has permissions to access
// the Amazon S3 bucket that contains your input files (in this case, your custom
// vocabulary). If the role that you specify doesn’t have the appropriate
// permissions to access the specified Amazon S3 location, your request fails. IAM
// role ARNs have the format arn:partition:iam::account:role/role-name-with-path .
// For example: arn:aws:iam::111122223333:role/Admin . For more information, see
// IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns)
// .
DataAccessRoleArn *string
// Use this parameter if you want to create your custom vocabulary by including
// all desired terms, as comma-separated values, within your request. The other
// option for creating your custom vocabulary is to save your entries in a text
// file and upload them to an Amazon S3 bucket, then specify the location of your
// file using the VocabularyFileUri parameter. Note that if you include Phrases in
// your request, you cannot use VocabularyFileUri ; you must choose one or the
// other. Each language has a character set that contains all allowed characters
// for that specific language. If you use unsupported characters, your custom
// vocabulary filter request fails. Refer to Character Sets for Custom Vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html)
// to get the character set for your language.
Phrases []string
// Adds one or more custom tags, each in the form of a key:value pair, to a new
// custom vocabulary at the time you create this new custom vocabulary. To learn
// more about using tags with Amazon Transcribe, refer to Tagging resources (https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html)
// .
Tags []types.Tag
// The Amazon S3 location of the text file that contains your custom vocabulary.
// The URI must be located in the same Amazon Web Services Region as the resource
// you're calling. Here's an example URI path:
// s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txt Note that if you include
// VocabularyFileUri in your request, you cannot use the Phrases flag; you must
// choose one or the other.
VocabularyFileUri *string
noSmithyDocumentSerde
}
type CreateVocabularyOutput struct {
// If VocabularyState is FAILED , FailureReason contains information about why the
// custom vocabulary request failed. See also: Common Errors (https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonErrors.html)
// .
FailureReason *string
// The language code you selected for your custom vocabulary.
LanguageCode types.LanguageCode
// The date and time you created your custom vocabulary. Timestamps are in the
// format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// The name you chose for your custom vocabulary.
VocabularyName *string
// The processing state of your custom vocabulary. If the state is READY , you can
// use the custom vocabulary in a StartTranscriptionJob request.
VocabularyState types.VocabularyState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateVocabularyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateVocabulary{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateVocabulary{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateVocabularyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVocabulary(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateVocabulary(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "CreateVocabulary",
}
}
| 203 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a new custom vocabulary filter. You can use custom vocabulary filters
// to mask, delete, or flag specific words from your transcript. Custom vocabulary
// filters are commonly used to mask profanity in transcripts. Each language has a
// character set that contains all allowed characters for that specific language.
// If you use unsupported characters, your custom vocabulary filter request fails.
// Refer to Character Sets for Custom Vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html)
// to get the character set for your language. For more information, see
// Vocabulary filtering (https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html)
// .
func (c *Client) CreateVocabularyFilter(ctx context.Context, params *CreateVocabularyFilterInput, optFns ...func(*Options)) (*CreateVocabularyFilterOutput, error) {
if params == nil {
params = &CreateVocabularyFilterInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateVocabularyFilter", params, optFns, c.addOperationCreateVocabularyFilterMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateVocabularyFilterOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateVocabularyFilterInput struct {
// The language code that represents the language of the entries in your
// vocabulary filter. Each custom vocabulary filter must contain terms in only one
// language. A custom vocabulary filter can only be used to transcribe files in the
// same language as the filter. For example, if you create a custom vocabulary
// filter using US English ( en-US ), you can only apply this filter to files that
// contain English audio. For a list of supported languages and their associated
// language codes, refer to the Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table.
//
// This member is required.
LanguageCode types.LanguageCode
// A unique name, chosen by you, for your new custom vocabulary filter. This name
// is case sensitive, cannot contain spaces, and must be unique within an Amazon
// Web Services account. If you try to create a new custom vocabulary filter with
// the same name as an existing custom vocabulary filter, you get a
// ConflictException error.
//
// This member is required.
VocabularyFilterName *string
// The Amazon Resource Name (ARN) of an IAM role that has permissions to access
// the Amazon S3 bucket that contains your input files (in this case, your custom
// vocabulary filter). If the role that you specify doesn’t have the appropriate
// permissions to access the specified Amazon S3 location, your request fails. IAM
// role ARNs have the format arn:partition:iam::account:role/role-name-with-path .
// For example: arn:aws:iam::111122223333:role/Admin . For more information, see
// IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns)
// .
DataAccessRoleArn *string
// Adds one or more custom tags, each in the form of a key:value pair, to a new
// custom vocabulary filter at the time you create this new vocabulary filter. To
// learn more about using tags with Amazon Transcribe, refer to Tagging resources (https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html)
// .
Tags []types.Tag
// The Amazon S3 location of the text file that contains your custom vocabulary
// filter terms. The URI must be located in the same Amazon Web Services Region as
// the resource you're calling. Here's an example URI path:
// s3://DOC-EXAMPLE-BUCKET/my-vocab-filter-file.txt Note that if you include
// VocabularyFilterFileUri in your request, you cannot use Words ; you must choose
// one or the other.
VocabularyFilterFileUri *string
// Use this parameter if you want to create your custom vocabulary filter by
// including all desired terms, as comma-separated values, within your request. The
// other option for creating your vocabulary filter is to save your entries in a
// text file and upload them to an Amazon S3 bucket, then specify the location of
// your file using the VocabularyFilterFileUri parameter. Note that if you include
// Words in your request, you cannot use VocabularyFilterFileUri ; you must choose
// one or the other. Each language has a character set that contains all allowed
// characters for that specific language. If you use unsupported characters, your
// custom vocabulary filter request fails. Refer to Character Sets for Custom
// Vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html) to
// get the character set for your language.
Words []string
noSmithyDocumentSerde
}
type CreateVocabularyFilterOutput struct {
// The language code you selected for your custom vocabulary filter.
LanguageCode types.LanguageCode
// The date and time you created your custom vocabulary filter. Timestamps are in
// the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// The name you chose for your custom vocabulary filter.
VocabularyFilterName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateVocabularyFilterMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateVocabularyFilter{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateVocabularyFilter{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateVocabularyFilterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVocabularyFilter(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateVocabularyFilter(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "CreateVocabularyFilter",
}
}
| 195 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a Call Analytics category. To use this operation, specify the name of
// the category you want to delete using CategoryName . Category names are case
// sensitive.
func (c *Client) DeleteCallAnalyticsCategory(ctx context.Context, params *DeleteCallAnalyticsCategoryInput, optFns ...func(*Options)) (*DeleteCallAnalyticsCategoryOutput, error) {
if params == nil {
params = &DeleteCallAnalyticsCategoryInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteCallAnalyticsCategory", params, optFns, c.addOperationDeleteCallAnalyticsCategoryMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteCallAnalyticsCategoryOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteCallAnalyticsCategoryInput struct {
// The name of the Call Analytics category you want to delete. Category names are
// case sensitive.
//
// This member is required.
CategoryName *string
noSmithyDocumentSerde
}
type DeleteCallAnalyticsCategoryOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteCallAnalyticsCategoryMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteCallAnalyticsCategory{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteCallAnalyticsCategory{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteCallAnalyticsCategoryValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCallAnalyticsCategory(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteCallAnalyticsCategory(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "DeleteCallAnalyticsCategory",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a Call Analytics job. To use this operation, specify the name of the
// job you want to delete using CallAnalyticsJobName . Job names are case sensitive.
func (c *Client) DeleteCallAnalyticsJob(ctx context.Context, params *DeleteCallAnalyticsJobInput, optFns ...func(*Options)) (*DeleteCallAnalyticsJobOutput, error) {
if params == nil {
params = &DeleteCallAnalyticsJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteCallAnalyticsJob", params, optFns, c.addOperationDeleteCallAnalyticsJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteCallAnalyticsJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteCallAnalyticsJobInput struct {
// The name of the Call Analytics job you want to delete. Job names are case
// sensitive.
//
// This member is required.
CallAnalyticsJobName *string
noSmithyDocumentSerde
}
type DeleteCallAnalyticsJobOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteCallAnalyticsJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteCallAnalyticsJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteCallAnalyticsJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteCallAnalyticsJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCallAnalyticsJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteCallAnalyticsJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "DeleteCallAnalyticsJob",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a custom language model. To use this operation, specify the name of the
// language model you want to delete using ModelName . custom language model names
// are case sensitive.
func (c *Client) DeleteLanguageModel(ctx context.Context, params *DeleteLanguageModelInput, optFns ...func(*Options)) (*DeleteLanguageModelOutput, error) {
if params == nil {
params = &DeleteLanguageModelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteLanguageModel", params, optFns, c.addOperationDeleteLanguageModelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteLanguageModelOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteLanguageModelInput struct {
// The name of the custom language model you want to delete. Model names are case
// sensitive.
//
// This member is required.
ModelName *string
noSmithyDocumentSerde
}
type DeleteLanguageModelOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteLanguageModelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteLanguageModel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteLanguageModel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteLanguageModelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLanguageModel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteLanguageModel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "DeleteLanguageModel",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a medical transcription job. To use this operation, specify the name of
// the job you want to delete using MedicalTranscriptionJobName . Job names are
// case sensitive.
func (c *Client) DeleteMedicalTranscriptionJob(ctx context.Context, params *DeleteMedicalTranscriptionJobInput, optFns ...func(*Options)) (*DeleteMedicalTranscriptionJobOutput, error) {
if params == nil {
params = &DeleteMedicalTranscriptionJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteMedicalTranscriptionJob", params, optFns, c.addOperationDeleteMedicalTranscriptionJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteMedicalTranscriptionJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteMedicalTranscriptionJobInput struct {
// The name of the medical transcription job you want to delete. Job names are
// case sensitive.
//
// This member is required.
MedicalTranscriptionJobName *string
noSmithyDocumentSerde
}
type DeleteMedicalTranscriptionJobOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteMedicalTranscriptionJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteMedicalTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteMedicalTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteMedicalTranscriptionJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMedicalTranscriptionJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteMedicalTranscriptionJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "DeleteMedicalTranscriptionJob",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a custom medical vocabulary. To use this operation, specify the name of
// the custom vocabulary you want to delete using VocabularyName . Custom
// vocabulary names are case sensitive.
func (c *Client) DeleteMedicalVocabulary(ctx context.Context, params *DeleteMedicalVocabularyInput, optFns ...func(*Options)) (*DeleteMedicalVocabularyOutput, error) {
if params == nil {
params = &DeleteMedicalVocabularyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteMedicalVocabulary", params, optFns, c.addOperationDeleteMedicalVocabularyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteMedicalVocabularyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteMedicalVocabularyInput struct {
// The name of the custom medical vocabulary you want to delete. Custom medical
// vocabulary names are case sensitive.
//
// This member is required.
VocabularyName *string
noSmithyDocumentSerde
}
type DeleteMedicalVocabularyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteMedicalVocabularyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteMedicalVocabulary{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteMedicalVocabulary{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteMedicalVocabularyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMedicalVocabulary(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteMedicalVocabulary(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "DeleteMedicalVocabulary",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a transcription job. To use this operation, specify the name of the job
// you want to delete using TranscriptionJobName . Job names are case sensitive.
func (c *Client) DeleteTranscriptionJob(ctx context.Context, params *DeleteTranscriptionJobInput, optFns ...func(*Options)) (*DeleteTranscriptionJobOutput, error) {
if params == nil {
params = &DeleteTranscriptionJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteTranscriptionJob", params, optFns, c.addOperationDeleteTranscriptionJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteTranscriptionJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteTranscriptionJobInput struct {
// The name of the transcription job you want to delete. Job names are case
// sensitive.
//
// This member is required.
TranscriptionJobName *string
noSmithyDocumentSerde
}
type DeleteTranscriptionJobOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteTranscriptionJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteTranscriptionJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTranscriptionJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteTranscriptionJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "DeleteTranscriptionJob",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a custom vocabulary. To use this operation, specify the name of the
// custom vocabulary you want to delete using VocabularyName . Custom vocabulary
// names are case sensitive.
func (c *Client) DeleteVocabulary(ctx context.Context, params *DeleteVocabularyInput, optFns ...func(*Options)) (*DeleteVocabularyOutput, error) {
if params == nil {
params = &DeleteVocabularyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteVocabulary", params, optFns, c.addOperationDeleteVocabularyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteVocabularyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteVocabularyInput struct {
// The name of the custom vocabulary you want to delete. Custom vocabulary names
// are case sensitive.
//
// This member is required.
VocabularyName *string
noSmithyDocumentSerde
}
type DeleteVocabularyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteVocabularyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteVocabulary{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteVocabulary{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteVocabularyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVocabulary(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteVocabulary(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "DeleteVocabulary",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a custom vocabulary filter. To use this operation, specify the name of
// the custom vocabulary filter you want to delete using VocabularyFilterName .
// Custom vocabulary filter names are case sensitive.
func (c *Client) DeleteVocabularyFilter(ctx context.Context, params *DeleteVocabularyFilterInput, optFns ...func(*Options)) (*DeleteVocabularyFilterOutput, error) {
if params == nil {
params = &DeleteVocabularyFilterInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteVocabularyFilter", params, optFns, c.addOperationDeleteVocabularyFilterMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteVocabularyFilterOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteVocabularyFilterInput struct {
// The name of the custom vocabulary filter you want to delete. Custom vocabulary
// filter names are case sensitive.
//
// This member is required.
VocabularyFilterName *string
noSmithyDocumentSerde
}
type DeleteVocabularyFilterOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteVocabularyFilterMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteVocabularyFilter{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteVocabularyFilter{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteVocabularyFilterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVocabularyFilter(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteVocabularyFilter(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "DeleteVocabularyFilter",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides information about the specified custom language model. This operation
// also shows if the base language model that you used to create your custom
// language model has been updated. If Amazon Transcribe has updated the base
// model, you can create a new custom language model using the updated base model.
// If you tried to create a new custom language model and the request wasn't
// successful, you can use DescribeLanguageModel to help identify the reason for
// this failure.
func (c *Client) DescribeLanguageModel(ctx context.Context, params *DescribeLanguageModelInput, optFns ...func(*Options)) (*DescribeLanguageModelOutput, error) {
if params == nil {
params = &DescribeLanguageModelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeLanguageModel", params, optFns, c.addOperationDescribeLanguageModelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeLanguageModelOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeLanguageModelInput struct {
// The name of the custom language model you want information about. Model names
// are case sensitive.
//
// This member is required.
ModelName *string
noSmithyDocumentSerde
}
type DescribeLanguageModelOutput struct {
// Provides information about the specified custom language model. This parameter
// also shows if the base language model you used to create your custom language
// model has been updated. If Amazon Transcribe has updated the base model, you can
// create a new custom language model using the updated base model. If you tried to
// create a new custom language model and the request wasn't successful, you can
// use this DescribeLanguageModel to help identify the reason for this failure.
LanguageModel *types.LanguageModel
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeLanguageModelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeLanguageModel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeLanguageModel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeLanguageModelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLanguageModel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeLanguageModel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "DescribeLanguageModel",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides information about the specified Call Analytics category. To get a list
// of your Call Analytics categories, use the operation.
func (c *Client) GetCallAnalyticsCategory(ctx context.Context, params *GetCallAnalyticsCategoryInput, optFns ...func(*Options)) (*GetCallAnalyticsCategoryOutput, error) {
if params == nil {
params = &GetCallAnalyticsCategoryInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetCallAnalyticsCategory", params, optFns, c.addOperationGetCallAnalyticsCategoryMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetCallAnalyticsCategoryOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetCallAnalyticsCategoryInput struct {
// The name of the Call Analytics category you want information about. Category
// names are case sensitive.
//
// This member is required.
CategoryName *string
noSmithyDocumentSerde
}
type GetCallAnalyticsCategoryOutput struct {
// Provides you with the properties of the Call Analytics category you specified
// in your GetCallAnalyticsCategory request.
CategoryProperties *types.CategoryProperties
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetCallAnalyticsCategoryMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCallAnalyticsCategory{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCallAnalyticsCategory{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetCallAnalyticsCategoryValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCallAnalyticsCategory(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetCallAnalyticsCategory(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "GetCallAnalyticsCategory",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides information about the specified Call Analytics job. To view the job's
// status, refer to CallAnalyticsJobStatus . If the status is COMPLETED , the job
// is finished. You can find your completed transcript at the URI specified in
// TranscriptFileUri . If the status is FAILED , FailureReason provides details on
// why your transcription job failed. If you enabled personally identifiable
// information (PII) redaction, the redacted transcript appears at the location
// specified in RedactedTranscriptFileUri . If you chose to redact the audio in
// your media file, you can find your redacted media file at the location specified
// in RedactedMediaFileUri . To get a list of your Call Analytics jobs, use the
// operation.
func (c *Client) GetCallAnalyticsJob(ctx context.Context, params *GetCallAnalyticsJobInput, optFns ...func(*Options)) (*GetCallAnalyticsJobOutput, error) {
if params == nil {
params = &GetCallAnalyticsJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetCallAnalyticsJob", params, optFns, c.addOperationGetCallAnalyticsJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetCallAnalyticsJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetCallAnalyticsJobInput struct {
// The name of the Call Analytics job you want information about. Job names are
// case sensitive.
//
// This member is required.
CallAnalyticsJobName *string
noSmithyDocumentSerde
}
type GetCallAnalyticsJobOutput struct {
// Provides detailed information about the specified Call Analytics job, including
// job status and, if applicable, failure reason.
CallAnalyticsJob *types.CallAnalyticsJob
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetCallAnalyticsJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCallAnalyticsJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCallAnalyticsJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetCallAnalyticsJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCallAnalyticsJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetCallAnalyticsJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "GetCallAnalyticsJob",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides information about the specified medical transcription job. To view the
// status of the specified medical transcription job, check the
// TranscriptionJobStatus field. If the status is COMPLETED , the job is finished.
// You can find the results at the location specified in TranscriptFileUri . If the
// status is FAILED , FailureReason provides details on why your transcription job
// failed. To get a list of your medical transcription jobs, use the operation.
func (c *Client) GetMedicalTranscriptionJob(ctx context.Context, params *GetMedicalTranscriptionJobInput, optFns ...func(*Options)) (*GetMedicalTranscriptionJobOutput, error) {
if params == nil {
params = &GetMedicalTranscriptionJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetMedicalTranscriptionJob", params, optFns, c.addOperationGetMedicalTranscriptionJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetMedicalTranscriptionJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetMedicalTranscriptionJobInput struct {
// The name of the medical transcription job you want information about. Job names
// are case sensitive.
//
// This member is required.
MedicalTranscriptionJobName *string
noSmithyDocumentSerde
}
type GetMedicalTranscriptionJobOutput struct {
// Provides detailed information about the specified medical transcription job,
// including job status and, if applicable, failure reason.
MedicalTranscriptionJob *types.MedicalTranscriptionJob
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetMedicalTranscriptionJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMedicalTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMedicalTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetMedicalTranscriptionJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMedicalTranscriptionJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetMedicalTranscriptionJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "GetMedicalTranscriptionJob",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides information about the specified custom medical vocabulary. To view the
// status of the specified custom medical vocabulary, check the VocabularyState
// field. If the status is READY , your custom vocabulary is available to use. If
// the status is FAILED , FailureReason provides details on why your vocabulary
// failed. To get a list of your custom medical vocabularies, use the operation.
func (c *Client) GetMedicalVocabulary(ctx context.Context, params *GetMedicalVocabularyInput, optFns ...func(*Options)) (*GetMedicalVocabularyOutput, error) {
if params == nil {
params = &GetMedicalVocabularyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetMedicalVocabulary", params, optFns, c.addOperationGetMedicalVocabularyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetMedicalVocabularyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetMedicalVocabularyInput struct {
// The name of the custom medical vocabulary you want information about. Custom
// medical vocabulary names are case sensitive.
//
// This member is required.
VocabularyName *string
noSmithyDocumentSerde
}
type GetMedicalVocabularyOutput struct {
// The S3 location where the specified custom medical vocabulary is stored; use
// this URI to view or download the custom vocabulary.
DownloadUri *string
// If VocabularyState is FAILED , FailureReason contains information about why the
// custom medical vocabulary request failed. See also: Common Errors (https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonErrors.html)
// .
FailureReason *string
// The language code you selected for your custom medical vocabulary. US English (
// en-US ) is the only language supported with Amazon Transcribe Medical.
LanguageCode types.LanguageCode
// The date and time the specified custom medical vocabulary was last modified.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// The name of the custom medical vocabulary you requested information about.
VocabularyName *string
// The processing state of your custom medical vocabulary. If the state is READY ,
// you can use the custom vocabulary in a StartMedicalTranscriptionJob request.
VocabularyState types.VocabularyState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetMedicalVocabularyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMedicalVocabulary{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMedicalVocabulary{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetMedicalVocabularyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMedicalVocabulary(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetMedicalVocabulary(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "GetMedicalVocabulary",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides information about the specified transcription job. To view the status
// of the specified transcription job, check the TranscriptionJobStatus field. If
// the status is COMPLETED , the job is finished. You can find the results at the
// location specified in TranscriptFileUri . If the status is FAILED ,
// FailureReason provides details on why your transcription job failed. If you
// enabled content redaction, the redacted transcript can be found at the location
// specified in RedactedTranscriptFileUri . To get a list of your transcription
// jobs, use the operation.
func (c *Client) GetTranscriptionJob(ctx context.Context, params *GetTranscriptionJobInput, optFns ...func(*Options)) (*GetTranscriptionJobOutput, error) {
if params == nil {
params = &GetTranscriptionJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetTranscriptionJob", params, optFns, c.addOperationGetTranscriptionJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetTranscriptionJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetTranscriptionJobInput struct {
// The name of the transcription job you want information about. Job names are
// case sensitive.
//
// This member is required.
TranscriptionJobName *string
noSmithyDocumentSerde
}
type GetTranscriptionJobOutput struct {
// Provides detailed information about the specified transcription job, including
// job status and, if applicable, failure reason.
TranscriptionJob *types.TranscriptionJob
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetTranscriptionJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetTranscriptionJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTranscriptionJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetTranscriptionJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "GetTranscriptionJob",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides information about the specified custom vocabulary. To view the status
// of the specified custom vocabulary, check the VocabularyState field. If the
// status is READY , your custom vocabulary is available to use. If the status is
// FAILED , FailureReason provides details on why your custom vocabulary failed.
// To get a list of your custom vocabularies, use the operation.
func (c *Client) GetVocabulary(ctx context.Context, params *GetVocabularyInput, optFns ...func(*Options)) (*GetVocabularyOutput, error) {
if params == nil {
params = &GetVocabularyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetVocabulary", params, optFns, c.addOperationGetVocabularyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetVocabularyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetVocabularyInput struct {
// The name of the custom vocabulary you want information about. Custom vocabulary
// names are case sensitive.
//
// This member is required.
VocabularyName *string
noSmithyDocumentSerde
}
type GetVocabularyOutput struct {
// The S3 location where the custom vocabulary is stored; use this URI to view or
// download the custom vocabulary.
DownloadUri *string
// If VocabularyState is FAILED , FailureReason contains information about why the
// custom vocabulary request failed. See also: Common Errors (https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonErrors.html)
// .
FailureReason *string
// The language code you selected for your custom vocabulary.
LanguageCode types.LanguageCode
// The date and time the specified custom vocabulary was last modified. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// The name of the custom vocabulary you requested information about.
VocabularyName *string
// The processing state of your custom vocabulary. If the state is READY , you can
// use the custom vocabulary in a StartTranscriptionJob request.
VocabularyState types.VocabularyState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetVocabularyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetVocabulary{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetVocabulary{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetVocabularyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVocabulary(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetVocabulary(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "GetVocabulary",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides information about the specified custom vocabulary filter. To get a
// list of your custom vocabulary filters, use the operation.
func (c *Client) GetVocabularyFilter(ctx context.Context, params *GetVocabularyFilterInput, optFns ...func(*Options)) (*GetVocabularyFilterOutput, error) {
if params == nil {
params = &GetVocabularyFilterInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetVocabularyFilter", params, optFns, c.addOperationGetVocabularyFilterMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetVocabularyFilterOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetVocabularyFilterInput struct {
// The name of the custom vocabulary filter you want information about. Custom
// vocabulary filter names are case sensitive.
//
// This member is required.
VocabularyFilterName *string
noSmithyDocumentSerde
}
type GetVocabularyFilterOutput struct {
// The Amazon S3 location where the custom vocabulary filter is stored; use this
// URI to view or download the custom vocabulary filter.
DownloadUri *string
// The language code you selected for your custom vocabulary filter.
LanguageCode types.LanguageCode
// The date and time the specified custom vocabulary filter was last modified.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// The name of the custom vocabulary filter you requested information about.
VocabularyFilterName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetVocabularyFilterMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetVocabularyFilter{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetVocabularyFilter{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetVocabularyFilterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVocabularyFilter(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetVocabularyFilter(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "GetVocabularyFilter",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides a list of Call Analytics categories, including all rules that make up
// each category. To get detailed information about a specific Call Analytics
// category, use the operation.
func (c *Client) ListCallAnalyticsCategories(ctx context.Context, params *ListCallAnalyticsCategoriesInput, optFns ...func(*Options)) (*ListCallAnalyticsCategoriesOutput, error) {
if params == nil {
params = &ListCallAnalyticsCategoriesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListCallAnalyticsCategories", params, optFns, c.addOperationListCallAnalyticsCategoriesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListCallAnalyticsCategoriesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListCallAnalyticsCategoriesInput struct {
// The maximum number of Call Analytics categories to return in each page of
// results. If there are fewer results than the value that you specify, only the
// actual results are returned. If you don't specify a value, a default of 5 is
// used.
MaxResults *int32
// If your ListCallAnalyticsCategories request returns more results than can be
// displayed, NextToken is displayed in the response with an associated string. To
// get the next page of results, copy this string and repeat your request,
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
noSmithyDocumentSerde
}
type ListCallAnalyticsCategoriesOutput struct {
// Provides detailed information about your Call Analytics categories, including
// all the rules associated with each category.
Categories []types.CategoryProperties
// If NextToken is present in your response, it indicates that not all results are
// displayed. To view the next set of results, copy the string associated with the
// NextToken parameter in your results output, then run your request again
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListCallAnalyticsCategoriesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCallAnalyticsCategories{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCallAnalyticsCategories{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCallAnalyticsCategories(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListCallAnalyticsCategoriesAPIClient is a client that implements the
// ListCallAnalyticsCategories operation.
type ListCallAnalyticsCategoriesAPIClient interface {
ListCallAnalyticsCategories(context.Context, *ListCallAnalyticsCategoriesInput, ...func(*Options)) (*ListCallAnalyticsCategoriesOutput, error)
}
var _ ListCallAnalyticsCategoriesAPIClient = (*Client)(nil)
// ListCallAnalyticsCategoriesPaginatorOptions is the paginator options for
// ListCallAnalyticsCategories
type ListCallAnalyticsCategoriesPaginatorOptions struct {
// The maximum number of Call Analytics categories to return in each page of
// results. If there are fewer results than the value that you specify, only the
// actual results are returned. If you don't specify a value, a default of 5 is
// used.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListCallAnalyticsCategoriesPaginator is a paginator for
// ListCallAnalyticsCategories
type ListCallAnalyticsCategoriesPaginator struct {
options ListCallAnalyticsCategoriesPaginatorOptions
client ListCallAnalyticsCategoriesAPIClient
params *ListCallAnalyticsCategoriesInput
nextToken *string
firstPage bool
}
// NewListCallAnalyticsCategoriesPaginator returns a new
// ListCallAnalyticsCategoriesPaginator
func NewListCallAnalyticsCategoriesPaginator(client ListCallAnalyticsCategoriesAPIClient, params *ListCallAnalyticsCategoriesInput, optFns ...func(*ListCallAnalyticsCategoriesPaginatorOptions)) *ListCallAnalyticsCategoriesPaginator {
if params == nil {
params = &ListCallAnalyticsCategoriesInput{}
}
options := ListCallAnalyticsCategoriesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListCallAnalyticsCategoriesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListCallAnalyticsCategoriesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListCallAnalyticsCategories page.
func (p *ListCallAnalyticsCategoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCallAnalyticsCategoriesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListCallAnalyticsCategories(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListCallAnalyticsCategories(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "ListCallAnalyticsCategories",
}
}
| 237 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides a list of Call Analytics jobs that match the specified criteria. If no
// criteria are specified, all Call Analytics jobs are returned. To get detailed
// information about a specific Call Analytics job, use the operation.
func (c *Client) ListCallAnalyticsJobs(ctx context.Context, params *ListCallAnalyticsJobsInput, optFns ...func(*Options)) (*ListCallAnalyticsJobsOutput, error) {
if params == nil {
params = &ListCallAnalyticsJobsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListCallAnalyticsJobs", params, optFns, c.addOperationListCallAnalyticsJobsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListCallAnalyticsJobsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListCallAnalyticsJobsInput struct {
// Returns only the Call Analytics jobs that contain the specified string. The
// search is not case sensitive.
JobNameContains *string
// The maximum number of Call Analytics jobs to return in each page of results. If
// there are fewer results than the value that you specify, only the actual results
// are returned. If you don't specify a value, a default of 5 is used.
MaxResults *int32
// If your ListCallAnalyticsJobs request returns more results than can be
// displayed, NextToken is displayed in the response with an associated string. To
// get the next page of results, copy this string and repeat your request,
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Returns only Call Analytics jobs with the specified status. Jobs are ordered by
// creation date, with the newest job first. If you don't include Status , all Call
// Analytics jobs are returned.
Status types.CallAnalyticsJobStatus
noSmithyDocumentSerde
}
type ListCallAnalyticsJobsOutput struct {
// Provides a summary of information about each result.
CallAnalyticsJobSummaries []types.CallAnalyticsJobSummary
// If NextToken is present in your response, it indicates that not all results are
// displayed. To view the next set of results, copy the string associated with the
// NextToken parameter in your results output, then run your request again
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Lists all Call Analytics jobs that have the status specified in your request.
// Jobs are ordered by creation date, with the newest job first.
Status types.CallAnalyticsJobStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListCallAnalyticsJobsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCallAnalyticsJobs{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCallAnalyticsJobs{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCallAnalyticsJobs(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListCallAnalyticsJobsAPIClient is a client that implements the
// ListCallAnalyticsJobs operation.
type ListCallAnalyticsJobsAPIClient interface {
ListCallAnalyticsJobs(context.Context, *ListCallAnalyticsJobsInput, ...func(*Options)) (*ListCallAnalyticsJobsOutput, error)
}
var _ ListCallAnalyticsJobsAPIClient = (*Client)(nil)
// ListCallAnalyticsJobsPaginatorOptions is the paginator options for
// ListCallAnalyticsJobs
type ListCallAnalyticsJobsPaginatorOptions struct {
// The maximum number of Call Analytics jobs to return in each page of results. If
// there are fewer results than the value that you specify, only the actual results
// are returned. If you don't specify a value, a default of 5 is used.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListCallAnalyticsJobsPaginator is a paginator for ListCallAnalyticsJobs
type ListCallAnalyticsJobsPaginator struct {
options ListCallAnalyticsJobsPaginatorOptions
client ListCallAnalyticsJobsAPIClient
params *ListCallAnalyticsJobsInput
nextToken *string
firstPage bool
}
// NewListCallAnalyticsJobsPaginator returns a new ListCallAnalyticsJobsPaginator
func NewListCallAnalyticsJobsPaginator(client ListCallAnalyticsJobsAPIClient, params *ListCallAnalyticsJobsInput, optFns ...func(*ListCallAnalyticsJobsPaginatorOptions)) *ListCallAnalyticsJobsPaginator {
if params == nil {
params = &ListCallAnalyticsJobsInput{}
}
options := ListCallAnalyticsJobsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListCallAnalyticsJobsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListCallAnalyticsJobsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListCallAnalyticsJobs page.
func (p *ListCallAnalyticsJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCallAnalyticsJobsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListCallAnalyticsJobs(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListCallAnalyticsJobs(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "ListCallAnalyticsJobs",
}
}
| 245 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides a list of custom language models that match the specified criteria. If
// no criteria are specified, all custom language models are returned. To get
// detailed information about a specific custom language model, use the operation.
func (c *Client) ListLanguageModels(ctx context.Context, params *ListLanguageModelsInput, optFns ...func(*Options)) (*ListLanguageModelsOutput, error) {
if params == nil {
params = &ListLanguageModelsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLanguageModels", params, optFns, c.addOperationListLanguageModelsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLanguageModelsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLanguageModelsInput struct {
// The maximum number of custom language models to return in each page of results.
// If there are fewer results than the value that you specify, only the actual
// results are returned. If you don't specify a value, a default of 5 is used.
MaxResults *int32
// Returns only the custom language models that contain the specified string. The
// search is not case sensitive.
NameContains *string
// If your ListLanguageModels request returns more results than can be displayed,
// NextToken is displayed in the response with an associated string. To get the
// next page of results, copy this string and repeat your request, including
// NextToken with the value of the copied string. Repeat as needed to view all your
// results.
NextToken *string
// Returns only custom language models with the specified status. Language models
// are ordered by creation date, with the newest model first. If you don't include
// StatusEquals , all custom language models are returned.
StatusEquals types.ModelStatus
noSmithyDocumentSerde
}
type ListLanguageModelsOutput struct {
// Provides information about the custom language models that match the criteria
// specified in your request.
Models []types.LanguageModel
// If NextToken is present in your response, it indicates that not all results are
// displayed. To view the next set of results, copy the string associated with the
// NextToken parameter in your results output, then run your request again
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLanguageModelsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLanguageModels{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLanguageModels{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLanguageModels(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListLanguageModelsAPIClient is a client that implements the ListLanguageModels
// operation.
type ListLanguageModelsAPIClient interface {
ListLanguageModels(context.Context, *ListLanguageModelsInput, ...func(*Options)) (*ListLanguageModelsOutput, error)
}
var _ ListLanguageModelsAPIClient = (*Client)(nil)
// ListLanguageModelsPaginatorOptions is the paginator options for
// ListLanguageModels
type ListLanguageModelsPaginatorOptions struct {
// The maximum number of custom language models to return in each page of results.
// If there are fewer results than the value that you specify, only the actual
// results are returned. If you don't specify a value, a default of 5 is used.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListLanguageModelsPaginator is a paginator for ListLanguageModels
type ListLanguageModelsPaginator struct {
options ListLanguageModelsPaginatorOptions
client ListLanguageModelsAPIClient
params *ListLanguageModelsInput
nextToken *string
firstPage bool
}
// NewListLanguageModelsPaginator returns a new ListLanguageModelsPaginator
func NewListLanguageModelsPaginator(client ListLanguageModelsAPIClient, params *ListLanguageModelsInput, optFns ...func(*ListLanguageModelsPaginatorOptions)) *ListLanguageModelsPaginator {
if params == nil {
params = &ListLanguageModelsInput{}
}
options := ListLanguageModelsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListLanguageModelsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListLanguageModelsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListLanguageModels page.
func (p *ListLanguageModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLanguageModelsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListLanguageModels(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListLanguageModels(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "ListLanguageModels",
}
}
| 242 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides a list of medical transcription jobs that match the specified
// criteria. If no criteria are specified, all medical transcription jobs are
// returned. To get detailed information about a specific medical transcription
// job, use the operation.
func (c *Client) ListMedicalTranscriptionJobs(ctx context.Context, params *ListMedicalTranscriptionJobsInput, optFns ...func(*Options)) (*ListMedicalTranscriptionJobsOutput, error) {
if params == nil {
params = &ListMedicalTranscriptionJobsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListMedicalTranscriptionJobs", params, optFns, c.addOperationListMedicalTranscriptionJobsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListMedicalTranscriptionJobsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListMedicalTranscriptionJobsInput struct {
// Returns only the medical transcription jobs that contain the specified string.
// The search is not case sensitive.
JobNameContains *string
// The maximum number of medical transcription jobs to return in each page of
// results. If there are fewer results than the value that you specify, only the
// actual results are returned. If you don't specify a value, a default of 5 is
// used.
MaxResults *int32
// If your ListMedicalTranscriptionJobs request returns more results than can be
// displayed, NextToken is displayed in the response with an associated string. To
// get the next page of results, copy this string and repeat your request,
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Returns only medical transcription jobs with the specified status. Jobs are
// ordered by creation date, with the newest job first. If you don't include Status
// , all medical transcription jobs are returned.
Status types.TranscriptionJobStatus
noSmithyDocumentSerde
}
type ListMedicalTranscriptionJobsOutput struct {
// Provides a summary of information about each result.
MedicalTranscriptionJobSummaries []types.MedicalTranscriptionJobSummary
// If NextToken is present in your response, it indicates that not all results are
// displayed. To view the next set of results, copy the string associated with the
// NextToken parameter in your results output, then run your request again
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Lists all medical transcription jobs that have the status specified in your
// request. Jobs are ordered by creation date, with the newest job first.
Status types.TranscriptionJobStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListMedicalTranscriptionJobsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListMedicalTranscriptionJobs{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListMedicalTranscriptionJobs{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMedicalTranscriptionJobs(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListMedicalTranscriptionJobsAPIClient is a client that implements the
// ListMedicalTranscriptionJobs operation.
type ListMedicalTranscriptionJobsAPIClient interface {
ListMedicalTranscriptionJobs(context.Context, *ListMedicalTranscriptionJobsInput, ...func(*Options)) (*ListMedicalTranscriptionJobsOutput, error)
}
var _ ListMedicalTranscriptionJobsAPIClient = (*Client)(nil)
// ListMedicalTranscriptionJobsPaginatorOptions is the paginator options for
// ListMedicalTranscriptionJobs
type ListMedicalTranscriptionJobsPaginatorOptions struct {
// The maximum number of medical transcription jobs to return in each page of
// results. If there are fewer results than the value that you specify, only the
// actual results are returned. If you don't specify a value, a default of 5 is
// used.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListMedicalTranscriptionJobsPaginator is a paginator for
// ListMedicalTranscriptionJobs
type ListMedicalTranscriptionJobsPaginator struct {
options ListMedicalTranscriptionJobsPaginatorOptions
client ListMedicalTranscriptionJobsAPIClient
params *ListMedicalTranscriptionJobsInput
nextToken *string
firstPage bool
}
// NewListMedicalTranscriptionJobsPaginator returns a new
// ListMedicalTranscriptionJobsPaginator
func NewListMedicalTranscriptionJobsPaginator(client ListMedicalTranscriptionJobsAPIClient, params *ListMedicalTranscriptionJobsInput, optFns ...func(*ListMedicalTranscriptionJobsPaginatorOptions)) *ListMedicalTranscriptionJobsPaginator {
if params == nil {
params = &ListMedicalTranscriptionJobsInput{}
}
options := ListMedicalTranscriptionJobsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListMedicalTranscriptionJobsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListMedicalTranscriptionJobsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListMedicalTranscriptionJobs page.
func (p *ListMedicalTranscriptionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMedicalTranscriptionJobsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListMedicalTranscriptionJobs(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListMedicalTranscriptionJobs(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "ListMedicalTranscriptionJobs",
}
}
| 250 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides a list of custom medical vocabularies that match the specified
// criteria. If no criteria are specified, all custom medical vocabularies are
// returned. To get detailed information about a specific custom medical
// vocabulary, use the operation.
func (c *Client) ListMedicalVocabularies(ctx context.Context, params *ListMedicalVocabulariesInput, optFns ...func(*Options)) (*ListMedicalVocabulariesOutput, error) {
if params == nil {
params = &ListMedicalVocabulariesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListMedicalVocabularies", params, optFns, c.addOperationListMedicalVocabulariesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListMedicalVocabulariesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListMedicalVocabulariesInput struct {
// The maximum number of custom medical vocabularies to return in each page of
// results. If there are fewer results than the value that you specify, only the
// actual results are returned. If you don't specify a value, a default of 5 is
// used.
MaxResults *int32
// Returns only the custom medical vocabularies that contain the specified string.
// The search is not case sensitive.
NameContains *string
// If your ListMedicalVocabularies request returns more results than can be
// displayed, NextToken is displayed in the response with an associated string. To
// get the next page of results, copy this string and repeat your request,
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Returns only custom medical vocabularies with the specified state. Custom
// vocabularies are ordered by creation date, with the newest vocabulary first. If
// you don't include StateEquals , all custom medical vocabularies are returned.
StateEquals types.VocabularyState
noSmithyDocumentSerde
}
type ListMedicalVocabulariesOutput struct {
// If NextToken is present in your response, it indicates that not all results are
// displayed. To view the next set of results, copy the string associated with the
// NextToken parameter in your results output, then run your request again
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Lists all custom medical vocabularies that have the status specified in your
// request. Custom vocabularies are ordered by creation date, with the newest
// vocabulary first.
Status types.VocabularyState
// Provides information about the custom medical vocabularies that match the
// criteria specified in your request.
Vocabularies []types.VocabularyInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListMedicalVocabulariesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListMedicalVocabularies{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListMedicalVocabularies{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMedicalVocabularies(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListMedicalVocabulariesAPIClient is a client that implements the
// ListMedicalVocabularies operation.
type ListMedicalVocabulariesAPIClient interface {
ListMedicalVocabularies(context.Context, *ListMedicalVocabulariesInput, ...func(*Options)) (*ListMedicalVocabulariesOutput, error)
}
var _ ListMedicalVocabulariesAPIClient = (*Client)(nil)
// ListMedicalVocabulariesPaginatorOptions is the paginator options for
// ListMedicalVocabularies
type ListMedicalVocabulariesPaginatorOptions struct {
// The maximum number of custom medical vocabularies to return in each page of
// results. If there are fewer results than the value that you specify, only the
// actual results are returned. If you don't specify a value, a default of 5 is
// used.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListMedicalVocabulariesPaginator is a paginator for ListMedicalVocabularies
type ListMedicalVocabulariesPaginator struct {
options ListMedicalVocabulariesPaginatorOptions
client ListMedicalVocabulariesAPIClient
params *ListMedicalVocabulariesInput
nextToken *string
firstPage bool
}
// NewListMedicalVocabulariesPaginator returns a new
// ListMedicalVocabulariesPaginator
func NewListMedicalVocabulariesPaginator(client ListMedicalVocabulariesAPIClient, params *ListMedicalVocabulariesInput, optFns ...func(*ListMedicalVocabulariesPaginatorOptions)) *ListMedicalVocabulariesPaginator {
if params == nil {
params = &ListMedicalVocabulariesInput{}
}
options := ListMedicalVocabulariesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListMedicalVocabulariesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListMedicalVocabulariesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListMedicalVocabularies page.
func (p *ListMedicalVocabulariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMedicalVocabulariesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListMedicalVocabularies(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListMedicalVocabularies(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "ListMedicalVocabularies",
}
}
| 251 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all tags associated with the specified transcription job, vocabulary,
// model, or resource. To learn more about using tags with Amazon Transcribe, refer
// to Tagging resources (https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html)
// .
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// Returns a list of all tags associated with the specified Amazon Resource Name
// (ARN). ARNs have the format
// arn:partition:service:region:account-id:resource-type/resource-id . For example,
// arn:aws:transcribe:us-west-2:111122223333:transcription-job/transcription-job-name
// . Valid values for resource-type are: transcription-job ,
// medical-transcription-job , vocabulary , medical-vocabulary , vocabulary-filter
// , and language-model .
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The Amazon Resource Name (ARN) specified in your request.
ResourceArn *string
// Lists all tags associated with the given transcription job, vocabulary, model,
// or resource.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "ListTagsForResource",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides a list of transcription jobs that match the specified criteria. If no
// criteria are specified, all transcription jobs are returned. To get detailed
// information about a specific transcription job, use the operation.
func (c *Client) ListTranscriptionJobs(ctx context.Context, params *ListTranscriptionJobsInput, optFns ...func(*Options)) (*ListTranscriptionJobsOutput, error) {
if params == nil {
params = &ListTranscriptionJobsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTranscriptionJobs", params, optFns, c.addOperationListTranscriptionJobsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTranscriptionJobsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTranscriptionJobsInput struct {
// Returns only the transcription jobs that contain the specified string. The
// search is not case sensitive.
JobNameContains *string
// The maximum number of transcription jobs to return in each page of results. If
// there are fewer results than the value that you specify, only the actual results
// are returned. If you don't specify a value, a default of 5 is used.
MaxResults *int32
// If your ListTranscriptionJobs request returns more results than can be
// displayed, NextToken is displayed in the response with an associated string. To
// get the next page of results, copy this string and repeat your request,
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Returns only transcription jobs with the specified status. Jobs are ordered by
// creation date, with the newest job first. If you don't include Status , all
// transcription jobs are returned.
Status types.TranscriptionJobStatus
noSmithyDocumentSerde
}
type ListTranscriptionJobsOutput struct {
// If NextToken is present in your response, it indicates that not all results are
// displayed. To view the next set of results, copy the string associated with the
// NextToken parameter in your results output, then run your request again
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Lists all transcription jobs that have the status specified in your request.
// Jobs are ordered by creation date, with the newest job first.
Status types.TranscriptionJobStatus
// Provides a summary of information about each result.
TranscriptionJobSummaries []types.TranscriptionJobSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTranscriptionJobsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTranscriptionJobs{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTranscriptionJobs{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTranscriptionJobs(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListTranscriptionJobsAPIClient is a client that implements the
// ListTranscriptionJobs operation.
type ListTranscriptionJobsAPIClient interface {
ListTranscriptionJobs(context.Context, *ListTranscriptionJobsInput, ...func(*Options)) (*ListTranscriptionJobsOutput, error)
}
var _ ListTranscriptionJobsAPIClient = (*Client)(nil)
// ListTranscriptionJobsPaginatorOptions is the paginator options for
// ListTranscriptionJobs
type ListTranscriptionJobsPaginatorOptions struct {
// The maximum number of transcription jobs to return in each page of results. If
// there are fewer results than the value that you specify, only the actual results
// are returned. If you don't specify a value, a default of 5 is used.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTranscriptionJobsPaginator is a paginator for ListTranscriptionJobs
type ListTranscriptionJobsPaginator struct {
options ListTranscriptionJobsPaginatorOptions
client ListTranscriptionJobsAPIClient
params *ListTranscriptionJobsInput
nextToken *string
firstPage bool
}
// NewListTranscriptionJobsPaginator returns a new ListTranscriptionJobsPaginator
func NewListTranscriptionJobsPaginator(client ListTranscriptionJobsAPIClient, params *ListTranscriptionJobsInput, optFns ...func(*ListTranscriptionJobsPaginatorOptions)) *ListTranscriptionJobsPaginator {
if params == nil {
params = &ListTranscriptionJobsInput{}
}
options := ListTranscriptionJobsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListTranscriptionJobsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTranscriptionJobsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTranscriptionJobs page.
func (p *ListTranscriptionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTranscriptionJobsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListTranscriptionJobs(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListTranscriptionJobs(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "ListTranscriptionJobs",
}
}
| 245 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides a list of custom vocabularies that match the specified criteria. If no
// criteria are specified, all custom vocabularies are returned. To get detailed
// information about a specific custom vocabulary, use the operation.
func (c *Client) ListVocabularies(ctx context.Context, params *ListVocabulariesInput, optFns ...func(*Options)) (*ListVocabulariesOutput, error) {
if params == nil {
params = &ListVocabulariesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListVocabularies", params, optFns, c.addOperationListVocabulariesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListVocabulariesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListVocabulariesInput struct {
// The maximum number of custom vocabularies to return in each page of results. If
// there are fewer results than the value that you specify, only the actual results
// are returned. If you don't specify a value, a default of 5 is used.
MaxResults *int32
// Returns only the custom vocabularies that contain the specified string. The
// search is not case sensitive.
NameContains *string
// If your ListVocabularies request returns more results than can be displayed,
// NextToken is displayed in the response with an associated string. To get the
// next page of results, copy this string and repeat your request, including
// NextToken with the value of the copied string. Repeat as needed to view all your
// results.
NextToken *string
// Returns only custom vocabularies with the specified state. Vocabularies are
// ordered by creation date, with the newest vocabulary first. If you don't include
// StateEquals , all custom medical vocabularies are returned.
StateEquals types.VocabularyState
noSmithyDocumentSerde
}
type ListVocabulariesOutput struct {
// If NextToken is present in your response, it indicates that not all results are
// displayed. To view the next set of results, copy the string associated with the
// NextToken parameter in your results output, then run your request again
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Lists all custom vocabularies that have the status specified in your request.
// Vocabularies are ordered by creation date, with the newest vocabulary first.
Status types.VocabularyState
// Provides information about the custom vocabularies that match the criteria
// specified in your request.
Vocabularies []types.VocabularyInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListVocabulariesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListVocabularies{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListVocabularies{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVocabularies(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListVocabulariesAPIClient is a client that implements the ListVocabularies
// operation.
type ListVocabulariesAPIClient interface {
ListVocabularies(context.Context, *ListVocabulariesInput, ...func(*Options)) (*ListVocabulariesOutput, error)
}
var _ ListVocabulariesAPIClient = (*Client)(nil)
// ListVocabulariesPaginatorOptions is the paginator options for ListVocabularies
type ListVocabulariesPaginatorOptions struct {
// The maximum number of custom vocabularies to return in each page of results. If
// there are fewer results than the value that you specify, only the actual results
// are returned. If you don't specify a value, a default of 5 is used.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListVocabulariesPaginator is a paginator for ListVocabularies
type ListVocabulariesPaginator struct {
options ListVocabulariesPaginatorOptions
client ListVocabulariesAPIClient
params *ListVocabulariesInput
nextToken *string
firstPage bool
}
// NewListVocabulariesPaginator returns a new ListVocabulariesPaginator
func NewListVocabulariesPaginator(client ListVocabulariesAPIClient, params *ListVocabulariesInput, optFns ...func(*ListVocabulariesPaginatorOptions)) *ListVocabulariesPaginator {
if params == nil {
params = &ListVocabulariesInput{}
}
options := ListVocabulariesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListVocabulariesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListVocabulariesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListVocabularies page.
func (p *ListVocabulariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVocabulariesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListVocabularies(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListVocabularies(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "ListVocabularies",
}
}
| 245 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides a list of custom vocabulary filters that match the specified criteria.
// If no criteria are specified, all custom vocabularies are returned. To get
// detailed information about a specific custom vocabulary filter, use the
// operation.
func (c *Client) ListVocabularyFilters(ctx context.Context, params *ListVocabularyFiltersInput, optFns ...func(*Options)) (*ListVocabularyFiltersOutput, error) {
if params == nil {
params = &ListVocabularyFiltersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListVocabularyFilters", params, optFns, c.addOperationListVocabularyFiltersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListVocabularyFiltersOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListVocabularyFiltersInput struct {
// The maximum number of custom vocabulary filters to return in each page of
// results. If there are fewer results than the value that you specify, only the
// actual results are returned. If you don't specify a value, a default of 5 is
// used.
MaxResults *int32
// Returns only the custom vocabulary filters that contain the specified string.
// The search is not case sensitive.
NameContains *string
// If your ListVocabularyFilters request returns more results than can be
// displayed, NextToken is displayed in the response with an associated string. To
// get the next page of results, copy this string and repeat your request,
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
noSmithyDocumentSerde
}
type ListVocabularyFiltersOutput struct {
// If NextToken is present in your response, it indicates that not all results are
// displayed. To view the next set of results, copy the string associated with the
// NextToken parameter in your results output, then run your request again
// including NextToken with the value of the copied string. Repeat as needed to
// view all your results.
NextToken *string
// Provides information about the custom vocabulary filters that match the
// criteria specified in your request.
VocabularyFilters []types.VocabularyFilterInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListVocabularyFiltersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListVocabularyFilters{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListVocabularyFilters{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVocabularyFilters(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListVocabularyFiltersAPIClient is a client that implements the
// ListVocabularyFilters operation.
type ListVocabularyFiltersAPIClient interface {
ListVocabularyFilters(context.Context, *ListVocabularyFiltersInput, ...func(*Options)) (*ListVocabularyFiltersOutput, error)
}
var _ ListVocabularyFiltersAPIClient = (*Client)(nil)
// ListVocabularyFiltersPaginatorOptions is the paginator options for
// ListVocabularyFilters
type ListVocabularyFiltersPaginatorOptions struct {
// The maximum number of custom vocabulary filters to return in each page of
// results. If there are fewer results than the value that you specify, only the
// actual results are returned. If you don't specify a value, a default of 5 is
// used.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListVocabularyFiltersPaginator is a paginator for ListVocabularyFilters
type ListVocabularyFiltersPaginator struct {
options ListVocabularyFiltersPaginatorOptions
client ListVocabularyFiltersAPIClient
params *ListVocabularyFiltersInput
nextToken *string
firstPage bool
}
// NewListVocabularyFiltersPaginator returns a new ListVocabularyFiltersPaginator
func NewListVocabularyFiltersPaginator(client ListVocabularyFiltersAPIClient, params *ListVocabularyFiltersInput, optFns ...func(*ListVocabularyFiltersPaginatorOptions)) *ListVocabularyFiltersPaginator {
if params == nil {
params = &ListVocabularyFiltersInput{}
}
options := ListVocabularyFiltersPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListVocabularyFiltersPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListVocabularyFiltersPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListVocabularyFilters page.
func (p *ListVocabularyFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVocabularyFiltersOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListVocabularyFilters(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListVocabularyFilters(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "ListVocabularyFilters",
}
}
| 240 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Transcribes the audio from a customer service call and applies any additional
// Request Parameters you choose to include in your request. In addition to many
// standard transcription features, Call Analytics provides you with call
// characteristics, call summarization, speaker sentiment, and optional redaction
// of your text transcript and your audio file. You can also apply custom
// categories to flag specified conditions. To learn more about these features and
// insights, refer to Analyzing call center audio with Call Analytics (https://docs.aws.amazon.com/transcribe/latest/dg/call-analytics.html)
// . If you want to apply categories to your Call Analytics job, you must create
// them before submitting your job request. Categories cannot be retroactively
// applied to a job. To create a new category, use the operation. To learn more
// about Call Analytics categories, see Creating categories for post-call
// transcriptions (https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-batch.html)
// and Creating categories for real-time transcriptions (https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-stream.html)
// . To make a StartCallAnalyticsJob request, you must first upload your media
// file into an Amazon S3 bucket; you can then specify the Amazon S3 location of
// the file using the Media parameter. Note that job queuing is enabled by default
// for Call Analytics jobs. You must include the following parameters in your
// StartCallAnalyticsJob request:
// - region : The Amazon Web Services Region where you are making your request.
// For a list of Amazon Web Services Regions supported with Amazon Transcribe,
// refer to Amazon Transcribe endpoints and quotas (https://docs.aws.amazon.com/general/latest/gr/transcribe.html)
// .
// - CallAnalyticsJobName : A custom name that you create for your transcription
// job that's unique within your Amazon Web Services account.
// - DataAccessRoleArn : The Amazon Resource Name (ARN) of an IAM role that has
// permissions to access the Amazon S3 bucket that contains your input files.
// - Media ( MediaFileUri or RedactedMediaFileUri ): The Amazon S3 location of
// your media file.
//
// With Call Analytics, you can redact the audio contained in your media file by
// including RedactedMediaFileUri , instead of MediaFileUri , to specify the
// location of your input audio. If you choose to redact your audio, you can find
// your redacted media at the location specified in the RedactedMediaFileUri field
// of your response.
func (c *Client) StartCallAnalyticsJob(ctx context.Context, params *StartCallAnalyticsJobInput, optFns ...func(*Options)) (*StartCallAnalyticsJobOutput, error) {
if params == nil {
params = &StartCallAnalyticsJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartCallAnalyticsJob", params, optFns, c.addOperationStartCallAnalyticsJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartCallAnalyticsJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartCallAnalyticsJobInput struct {
// A unique name, chosen by you, for your Call Analytics job. This name is case
// sensitive, cannot contain spaces, and must be unique within an Amazon Web
// Services account. If you try to create a new job with the same name as an
// existing job, you get a ConflictException error.
//
// This member is required.
CallAnalyticsJobName *string
// Describes the Amazon S3 location of the media file you want to use in your Call
// Analytics request.
//
// This member is required.
Media *types.Media
// Makes it possible to specify which speaker is on which channel. For example, if
// your agent is the first participant to speak, you would set ChannelId to 0 (to
// indicate the first channel) and ParticipantRole to AGENT (to indicate that it's
// the agent speaking).
ChannelDefinitions []types.ChannelDefinition
// The Amazon Resource Name (ARN) of an IAM role that has permissions to access
// the Amazon S3 bucket that contains your input files. If the role that you
// specify doesn’t have the appropriate permissions to access the specified Amazon
// S3 location, your request fails. IAM role ARNs have the format
// arn:partition:iam::account:role/role-name-with-path . For example:
// arn:aws:iam::111122223333:role/Admin . For more information, see IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns)
// .
DataAccessRoleArn *string
// The KMS key you want to use to encrypt your Call Analytics output. If using a
// key located in the current Amazon Web Services account, you can specify your KMS
// key in one of four ways:
// - Use the KMS key ID itself. For example, 1234abcd-12ab-34cd-56ef-1234567890ab
// .
// - Use an alias for the KMS key ID. For example, alias/ExampleAlias .
// - Use the Amazon Resource Name (ARN) for the KMS key ID. For example,
// arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab .
// - Use the ARN for the KMS key alias. For example,
// arn:aws:kms:region:account-ID:alias/ExampleAlias .
// If using a key located in a different Amazon Web Services account than the
// current Amazon Web Services account, you can specify your KMS key in one of two
// ways:
// - Use the ARN for the KMS key ID. For example,
// arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab .
// - Use the ARN for the KMS key alias. For example,
// arn:aws:kms:region:account-ID:alias/ExampleAlias .
// If you don't specify an encryption key, your output is encrypted with the
// default Amazon S3 key (SSE-S3). If you specify a KMS key to encrypt your output,
// you must also specify an output location using the OutputLocation parameter.
// Note that the role making the request must have permission to use the specified
// KMS key.
OutputEncryptionKMSKeyId *string
// The Amazon S3 location where you want your Call Analytics transcription output
// stored. You can use any of the following formats to specify the output location:
//
// - s3://DOC-EXAMPLE-BUCKET
// - s3://DOC-EXAMPLE-BUCKET/my-output-folder/
// - s3://DOC-EXAMPLE-BUCKET/my-output-folder/my-call-analytics-job.json
// Unless you specify a file name (option 3), the name of your output file has a
// default value that matches the name you specified for your transcription job
// using the CallAnalyticsJobName parameter. You can specify a KMS key to encrypt
// your output using the OutputEncryptionKMSKeyId parameter. If you don't specify
// a KMS key, Amazon Transcribe uses the default Amazon S3 key for server-side
// encryption. If you don't specify OutputLocation , your transcript is placed in a
// service-managed Amazon S3 bucket and you are provided with a URI to access your
// transcript.
OutputLocation *string
// Specify additional optional settings in your request, including content
// redaction; allows you to apply custom language models, vocabulary filters, and
// custom vocabularies to your Call Analytics job.
Settings *types.CallAnalyticsJobSettings
noSmithyDocumentSerde
}
type StartCallAnalyticsJobOutput struct {
// Provides detailed information about the current Call Analytics job, including
// job status and, if applicable, failure reason.
CallAnalyticsJob *types.CallAnalyticsJob
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartCallAnalyticsJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartCallAnalyticsJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartCallAnalyticsJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartCallAnalyticsJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartCallAnalyticsJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartCallAnalyticsJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "StartCallAnalyticsJob",
}
}
| 228 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Transcribes the audio from a medical dictation or conversation and applies any
// additional Request Parameters you choose to include in your request. In addition
// to many standard transcription features, Amazon Transcribe Medical provides you
// with a robust medical vocabulary and, optionally, content identification, which
// adds flags to personal health information (PHI). To learn more about these
// features, refer to How Amazon Transcribe Medical works (https://docs.aws.amazon.com/transcribe/latest/dg/how-it-works-med.html)
// . To make a StartMedicalTranscriptionJob request, you must first upload your
// media file into an Amazon S3 bucket; you can then specify the S3 location of the
// file using the Media parameter. You must include the following parameters in
// your StartMedicalTranscriptionJob request:
// - region : The Amazon Web Services Region where you are making your request.
// For a list of Amazon Web Services Regions supported with Amazon Transcribe,
// refer to Amazon Transcribe endpoints and quotas (https://docs.aws.amazon.com/general/latest/gr/transcribe.html)
// .
// - MedicalTranscriptionJobName : A custom name you create for your
// transcription job that is unique within your Amazon Web Services account.
// - Media ( MediaFileUri ): The Amazon S3 location of your media file.
// - LanguageCode : This must be en-US .
// - OutputBucketName : The Amazon S3 bucket where you want your transcript
// stored. If you want your output stored in a sub-folder of this bucket, you must
// also include OutputKey .
// - Specialty : This must be PRIMARYCARE .
// - Type : Choose whether your audio is a conversation or a dictation.
func (c *Client) StartMedicalTranscriptionJob(ctx context.Context, params *StartMedicalTranscriptionJobInput, optFns ...func(*Options)) (*StartMedicalTranscriptionJobOutput, error) {
if params == nil {
params = &StartMedicalTranscriptionJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartMedicalTranscriptionJob", params, optFns, c.addOperationStartMedicalTranscriptionJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartMedicalTranscriptionJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartMedicalTranscriptionJobInput struct {
// The language code that represents the language spoken in the input media file.
// US English ( en-US ) is the only valid value for medical transcription jobs. Any
// other value you enter for language code results in a BadRequestException error.
//
// This member is required.
LanguageCode types.LanguageCode
// Describes the Amazon S3 location of the media file you want to use in your
// request. For information on supported media formats, refer to the MediaFormat (https://docs.aws.amazon.com/APIReference/API_StartTranscriptionJob.html#transcribe-StartTranscriptionJob-request-MediaFormat)
// parameter or the Media formats (https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio)
// section in the Amazon S3 Developer Guide.
//
// This member is required.
Media *types.Media
// A unique name, chosen by you, for your medical transcription job. The name that
// you specify is also used as the default name of your transcription output file.
// If you want to specify a different name for your transcription output, use the
// OutputKey parameter. This name is case sensitive, cannot contain spaces, and
// must be unique within an Amazon Web Services account. If you try to create a new
// job with the same name as an existing job, you get a ConflictException error.
//
// This member is required.
MedicalTranscriptionJobName *string
// The name of the Amazon S3 bucket where you want your medical transcription
// output stored. Do not include the S3:// prefix of the specified bucket. If you
// want your output to go to a sub-folder of this bucket, specify it using the
// OutputKey parameter; OutputBucketName only accepts the name of a bucket. For
// example, if you want your output stored in S3://DOC-EXAMPLE-BUCKET , set
// OutputBucketName to DOC-EXAMPLE-BUCKET . However, if you want your output stored
// in S3://DOC-EXAMPLE-BUCKET/test-files/ , set OutputBucketName to
// DOC-EXAMPLE-BUCKET and OutputKey to test-files/ . Note that Amazon Transcribe
// must have permission to use the specified location. You can change Amazon S3
// permissions using the Amazon Web Services Management Console (https://console.aws.amazon.com/s3)
// . See also Permissions Required for IAM User Roles (https://docs.aws.amazon.com/transcribe/latest/dg/security_iam_id-based-policy-examples.html#auth-role-iam-user)
// .
//
// This member is required.
OutputBucketName *string
// Specify the predominant medical specialty represented in your media. For batch
// transcriptions, PRIMARYCARE is the only valid value. If you require additional
// specialties, refer to .
//
// This member is required.
Specialty types.Specialty
// Specify whether your input media contains only one person ( DICTATION ) or
// contains a conversation between two people ( CONVERSATION ). For example,
// DICTATION could be used for a medical professional wanting to transcribe voice
// memos; CONVERSATION could be used for transcribing the doctor-patient dialogue
// during the patient's office visit.
//
// This member is required.
Type types.Type
// Labels all personal health information (PHI) identified in your transcript. For
// more information, see Identifying personal health information (PHI) in a
// transcription (https://docs.aws.amazon.com/transcribe/latest/dg/phi-id.html) .
ContentIdentificationType types.MedicalContentIdentificationType
// A map of plain text, non-secret key:value pairs, known as encryption context
// pairs, that provide an added layer of security for your data. For more
// information, see KMS encryption context (https://docs.aws.amazon.com/transcribe/latest/dg/key-management.html#kms-context)
// and Asymmetric keys in KMS (https://docs.aws.amazon.com/transcribe/latest/dg/symmetric-asymmetric.html)
// .
KMSEncryptionContext map[string]string
// Specify the format of your input media file.
MediaFormat types.MediaFormat
// The sample rate, in hertz, of the audio track in your input media file. If you
// don't specify the media sample rate, Amazon Transcribe Medical determines it for
// you. If you specify the sample rate, it must match the rate detected by Amazon
// Transcribe Medical; if there's a mismatch between the value that you specify and
// the value detected, your job fails. Therefore, in most cases, it's advised to
// omit MediaSampleRateHertz and let Amazon Transcribe Medical determine the
// sample rate.
MediaSampleRateHertz *int32
// The KMS key you want to use to encrypt your medical transcription output. If
// using a key located in the current Amazon Web Services account, you can specify
// your KMS key in one of four ways:
// - Use the KMS key ID itself. For example, 1234abcd-12ab-34cd-56ef-1234567890ab
// .
// - Use an alias for the KMS key ID. For example, alias/ExampleAlias .
// - Use the Amazon Resource Name (ARN) for the KMS key ID. For example,
// arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab .
// - Use the ARN for the KMS key alias. For example,
// arn:aws:kms:region:account-ID:alias/ExampleAlias .
// If using a key located in a different Amazon Web Services account than the
// current Amazon Web Services account, you can specify your KMS key in one of two
// ways:
// - Use the ARN for the KMS key ID. For example,
// arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab .
// - Use the ARN for the KMS key alias. For example,
// arn:aws:kms:region:account-ID:alias/ExampleAlias .
// If you don't specify an encryption key, your output is encrypted with the
// default Amazon S3 key (SSE-S3). If you specify a KMS key to encrypt your output,
// you must also specify an output location using the OutputLocation parameter.
// Note that the role making the request must have permission to use the specified
// KMS key.
OutputEncryptionKMSKeyId *string
// Use in combination with OutputBucketName to specify the output location of your
// transcript and, optionally, a unique name for your output file. The default name
// for your transcription output is the same as the name you specified for your
// medical transcription job ( MedicalTranscriptionJobName ). Here are some
// examples of how you can use OutputKey :
// - If you specify 'DOC-EXAMPLE-BUCKET' as the OutputBucketName and
// 'my-transcript.json' as the OutputKey , your transcription output path is
// s3://DOC-EXAMPLE-BUCKET/my-transcript.json .
// - If you specify 'my-first-transcription' as the MedicalTranscriptionJobName ,
// 'DOC-EXAMPLE-BUCKET' as the OutputBucketName , and 'my-transcript' as the
// OutputKey , your transcription output path is
// s3://DOC-EXAMPLE-BUCKET/my-transcript/my-first-transcription.json .
// - If you specify 'DOC-EXAMPLE-BUCKET' as the OutputBucketName and
// 'test-files/my-transcript.json' as the OutputKey , your transcription output
// path is s3://DOC-EXAMPLE-BUCKET/test-files/my-transcript.json .
// - If you specify 'my-first-transcription' as the MedicalTranscriptionJobName ,
// 'DOC-EXAMPLE-BUCKET' as the OutputBucketName , and 'test-files/my-transcript'
// as the OutputKey , your transcription output path is
// s3://DOC-EXAMPLE-BUCKET/test-files/my-transcript/my-first-transcription.json .
// If you specify the name of an Amazon S3 bucket sub-folder that doesn't exist,
// one is created for you.
OutputKey *string
// Specify additional optional settings in your request, including channel
// identification, alternative transcriptions, and speaker partitioning. You can
// use that to apply custom vocabularies to your transcription job.
Settings *types.MedicalTranscriptionSetting
// Adds one or more custom tags, each in the form of a key:value pair, to a new
// medical transcription job at the time you start this new job. To learn more
// about using tags with Amazon Transcribe, refer to Tagging resources (https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html)
// .
Tags []types.Tag
noSmithyDocumentSerde
}
type StartMedicalTranscriptionJobOutput struct {
// Provides detailed information about the current medical transcription job,
// including job status and, if applicable, failure reason.
MedicalTranscriptionJob *types.MedicalTranscriptionJob
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartMedicalTranscriptionJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartMedicalTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartMedicalTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartMedicalTranscriptionJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartMedicalTranscriptionJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartMedicalTranscriptionJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "StartMedicalTranscriptionJob",
}
}
| 282 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Transcribes the audio from a media file and applies any additional Request
// Parameters you choose to include in your request. To make a
// StartTranscriptionJob request, you must first upload your media file into an
// Amazon S3 bucket; you can then specify the Amazon S3 location of the file using
// the Media parameter. You must include the following parameters in your
// StartTranscriptionJob request:
// - region : The Amazon Web Services Region where you are making your request.
// For a list of Amazon Web Services Regions supported with Amazon Transcribe,
// refer to Amazon Transcribe endpoints and quotas (https://docs.aws.amazon.com/general/latest/gr/transcribe.html)
// .
// - TranscriptionJobName : A custom name you create for your transcription job
// that is unique within your Amazon Web Services account.
// - Media ( MediaFileUri ): The Amazon S3 location of your media file.
// - One of LanguageCode , IdentifyLanguage , or IdentifyMultipleLanguages : If
// you know the language of your media file, specify it using the LanguageCode
// parameter; you can find all valid language codes in the Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table. If you don't know the languages spoken in your media, use either
// IdentifyLanguage or IdentifyMultipleLanguages and let Amazon Transcribe
// identify the languages for you.
func (c *Client) StartTranscriptionJob(ctx context.Context, params *StartTranscriptionJobInput, optFns ...func(*Options)) (*StartTranscriptionJobOutput, error) {
if params == nil {
params = &StartTranscriptionJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartTranscriptionJob", params, optFns, c.addOperationStartTranscriptionJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartTranscriptionJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartTranscriptionJobInput struct {
// Describes the Amazon S3 location of the media file you want to use in your
// request.
//
// This member is required.
Media *types.Media
// A unique name, chosen by you, for your transcription job. The name that you
// specify is also used as the default name of your transcription output file. If
// you want to specify a different name for your transcription output, use the
// OutputKey parameter. This name is case sensitive, cannot contain spaces, and
// must be unique within an Amazon Web Services account. If you try to create a new
// job with the same name as an existing job, you get a ConflictException error.
//
// This member is required.
TranscriptionJobName *string
// Makes it possible to redact or flag specified personally identifiable
// information (PII) in your transcript. If you use ContentRedaction , you must
// also include the sub-parameters: PiiEntityTypes , RedactionOutput , and
// RedactionType .
ContentRedaction *types.ContentRedaction
// Enables automatic language identification in your transcription job request.
// Use this parameter if your media file contains only one language. If your media
// contains multiple languages, use IdentifyMultipleLanguages instead. If you
// include IdentifyLanguage , you can optionally include a list of language codes,
// using LanguageOptions , that you think may be present in your media file.
// Including LanguageOptions restricts IdentifyLanguage to only the language
// options that you specify, which can improve transcription accuracy. If you want
// to apply a custom language model, a custom vocabulary, or a custom vocabulary
// filter to your automatic language identification request, include
// LanguageIdSettings with the relevant sub-parameters ( VocabularyName ,
// LanguageModelName , and VocabularyFilterName ). If you include
// LanguageIdSettings , also include LanguageOptions . Note that you must include
// one of LanguageCode , IdentifyLanguage , or IdentifyMultipleLanguages in your
// request. If you include more than one of these parameters, your transcription
// job fails.
IdentifyLanguage *bool
// Enables automatic multi-language identification in your transcription job
// request. Use this parameter if your media file contains more than one language.
// If your media contains only one language, use IdentifyLanguage instead. If you
// include IdentifyMultipleLanguages , you can optionally include a list of
// language codes, using LanguageOptions , that you think may be present in your
// media file. Including LanguageOptions restricts IdentifyLanguage to only the
// language options that you specify, which can improve transcription accuracy. If
// you want to apply a custom vocabulary or a custom vocabulary filter to your
// automatic language identification request, include LanguageIdSettings with the
// relevant sub-parameters ( VocabularyName and VocabularyFilterName ). If you
// include LanguageIdSettings , also include LanguageOptions . Note that you must
// include one of LanguageCode , IdentifyLanguage , or IdentifyMultipleLanguages
// in your request. If you include more than one of these parameters, your
// transcription job fails.
IdentifyMultipleLanguages *bool
// Makes it possible to control how your transcription job is processed.
// Currently, the only JobExecutionSettings modification you can choose is
// enabling job queueing using the AllowDeferredExecution sub-parameter. If you
// include JobExecutionSettings in your request, you must also include the
// sub-parameters: AllowDeferredExecution and DataAccessRoleArn .
JobExecutionSettings *types.JobExecutionSettings
// A map of plain text, non-secret key:value pairs, known as encryption context
// pairs, that provide an added layer of security for your data. For more
// information, see KMS encryption context (https://docs.aws.amazon.com/transcribe/latest/dg/key-management.html#kms-context)
// and Asymmetric keys in KMS (https://docs.aws.amazon.com/transcribe/latest/dg/symmetric-asymmetric.html)
// .
KMSEncryptionContext map[string]string
// The language code that represents the language spoken in the input media file.
// If you're unsure of the language spoken in your media file, consider using
// IdentifyLanguage or IdentifyMultipleLanguages to enable automatic language
// identification. Note that you must include one of LanguageCode ,
// IdentifyLanguage , or IdentifyMultipleLanguages in your request. If you include
// more than one of these parameters, your transcription job fails. For a list of
// supported languages and their associated language codes, refer to the Supported
// languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table. To transcribe speech in Modern Standard Arabic ( ar-SA ), your media file
// must be encoded at a sample rate of 16,000 Hz or higher.
LanguageCode types.LanguageCode
// If using automatic language identification in your request and you want to
// apply a custom language model, a custom vocabulary, or a custom vocabulary
// filter, include LanguageIdSettings with the relevant sub-parameters (
// VocabularyName , LanguageModelName , and VocabularyFilterName ). Note that
// multi-language identification ( IdentifyMultipleLanguages ) doesn't support
// custom language models. LanguageIdSettings supports two to five language codes.
// Each language code you include can have an associated custom language model,
// custom vocabulary, and custom vocabulary filter. The language codes that you
// specify must match the languages of the associated custom language models,
// custom vocabularies, and custom vocabulary filters. It's recommended that you
// include LanguageOptions when using LanguageIdSettings to ensure that the
// correct language dialect is identified. For example, if you specify a custom
// vocabulary that is in en-US but Amazon Transcribe determines that the language
// spoken in your media is en-AU , your custom vocabulary is not applied to your
// transcription. If you include LanguageOptions and include en-US as the only
// English language dialect, your custom vocabulary is applied to your
// transcription. If you want to include a custom language model with your request
// but do not want to use automatic language identification, use instead the
// parameter with the LanguageModelName sub-parameter. If you want to include a
// custom vocabulary or a custom vocabulary filter (or both) with your request but
// do not want to use automatic language identification, use instead the parameter
// with the VocabularyName or VocabularyFilterName (or both) sub-parameter.
LanguageIdSettings map[string]types.LanguageIdSettings
// You can specify two or more language codes that represent the languages you
// think may be present in your media. Including more than five is not recommended.
// If you're unsure what languages are present, do not include this parameter. If
// you include LanguageOptions in your request, you must also include
// IdentifyLanguage . For more information, refer to Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// . To transcribe speech in Modern Standard Arabic ( ar-SA ), your media file must
// be encoded at a sample rate of 16,000 Hz or higher.
LanguageOptions []types.LanguageCode
// Specify the format of your input media file.
MediaFormat types.MediaFormat
// The sample rate, in hertz, of the audio track in your input media file. If you
// don't specify the media sample rate, Amazon Transcribe determines it for you. If
// you specify the sample rate, it must match the rate detected by Amazon
// Transcribe. If there's a mismatch between the value that you specify and the
// value detected, your job fails. In most cases, you can omit MediaSampleRateHertz
// and let Amazon Transcribe determine the sample rate.
MediaSampleRateHertz *int32
// Specify the custom language model you want to include with your transcription
// job. If you include ModelSettings in your request, you must include the
// LanguageModelName sub-parameter. For more information, see Custom language
// models (https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html)
// .
ModelSettings *types.ModelSettings
// The name of the Amazon S3 bucket where you want your transcription output
// stored. Do not include the S3:// prefix of the specified bucket. If you want
// your output to go to a sub-folder of this bucket, specify it using the OutputKey
// parameter; OutputBucketName only accepts the name of a bucket. For example, if
// you want your output stored in S3://DOC-EXAMPLE-BUCKET , set OutputBucketName
// to DOC-EXAMPLE-BUCKET . However, if you want your output stored in
// S3://DOC-EXAMPLE-BUCKET/test-files/ , set OutputBucketName to DOC-EXAMPLE-BUCKET
// and OutputKey to test-files/ . Note that Amazon Transcribe must have permission
// to use the specified location. You can change Amazon S3 permissions using the
// Amazon Web Services Management Console (https://console.aws.amazon.com/s3) . See
// also Permissions Required for IAM User Roles (https://docs.aws.amazon.com/transcribe/latest/dg/security_iam_id-based-policy-examples.html#auth-role-iam-user)
// . If you don't specify OutputBucketName , your transcript is placed in a
// service-managed Amazon S3 bucket and you are provided with a URI to access your
// transcript.
OutputBucketName *string
// The KMS key you want to use to encrypt your transcription output. If using a
// key located in the current Amazon Web Services account, you can specify your KMS
// key in one of four ways:
// - Use the KMS key ID itself. For example, 1234abcd-12ab-34cd-56ef-1234567890ab
// .
// - Use an alias for the KMS key ID. For example, alias/ExampleAlias .
// - Use the Amazon Resource Name (ARN) for the KMS key ID. For example,
// arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab .
// - Use the ARN for the KMS key alias. For example,
// arn:aws:kms:region:account-ID:alias/ExampleAlias .
// If using a key located in a different Amazon Web Services account than the
// current Amazon Web Services account, you can specify your KMS key in one of two
// ways:
// - Use the ARN for the KMS key ID. For example,
// arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab .
// - Use the ARN for the KMS key alias. For example,
// arn:aws:kms:region:account-ID:alias/ExampleAlias .
// If you don't specify an encryption key, your output is encrypted with the
// default Amazon S3 key (SSE-S3). If you specify a KMS key to encrypt your output,
// you must also specify an output location using the OutputLocation parameter.
// Note that the role making the request must have permission to use the specified
// KMS key.
OutputEncryptionKMSKeyId *string
// Use in combination with OutputBucketName to specify the output location of your
// transcript and, optionally, a unique name for your output file. The default name
// for your transcription output is the same as the name you specified for your
// transcription job ( TranscriptionJobName ). Here are some examples of how you
// can use OutputKey :
// - If you specify 'DOC-EXAMPLE-BUCKET' as the OutputBucketName and
// 'my-transcript.json' as the OutputKey , your transcription output path is
// s3://DOC-EXAMPLE-BUCKET/my-transcript.json .
// - If you specify 'my-first-transcription' as the TranscriptionJobName ,
// 'DOC-EXAMPLE-BUCKET' as the OutputBucketName , and 'my-transcript' as the
// OutputKey , your transcription output path is
// s3://DOC-EXAMPLE-BUCKET/my-transcript/my-first-transcription.json .
// - If you specify 'DOC-EXAMPLE-BUCKET' as the OutputBucketName and
// 'test-files/my-transcript.json' as the OutputKey , your transcription output
// path is s3://DOC-EXAMPLE-BUCKET/test-files/my-transcript.json .
// - If you specify 'my-first-transcription' as the TranscriptionJobName ,
// 'DOC-EXAMPLE-BUCKET' as the OutputBucketName , and 'test-files/my-transcript'
// as the OutputKey , your transcription output path is
// s3://DOC-EXAMPLE-BUCKET/test-files/my-transcript/my-first-transcription.json .
// If you specify the name of an Amazon S3 bucket sub-folder that doesn't exist,
// one is created for you.
OutputKey *string
// Specify additional optional settings in your request, including channel
// identification, alternative transcriptions, speaker partitioning. You can use
// that to apply custom vocabularies and vocabulary filters. If you want to include
// a custom vocabulary or a custom vocabulary filter (or both) with your request
// but do not want to use automatic language identification, use Settings with the
// VocabularyName or VocabularyFilterName (or both) sub-parameter. If you're using
// automatic language identification with your request and want to include a custom
// language model, a custom vocabulary, or a custom vocabulary filter, use instead
// the parameter with the LanguageModelName , VocabularyName or
// VocabularyFilterName sub-parameters.
Settings *types.Settings
// Produces subtitle files for your input media. You can specify WebVTT (*.vtt)
// and SubRip (*.srt) formats.
Subtitles *types.Subtitles
// Adds one or more custom tags, each in the form of a key:value pair, to a new
// transcription job at the time you start this new job. To learn more about using
// tags with Amazon Transcribe, refer to Tagging resources (https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html)
// .
Tags []types.Tag
noSmithyDocumentSerde
}
type StartTranscriptionJobOutput struct {
// Provides detailed information about the current transcription job, including
// job status and, if applicable, failure reason.
TranscriptionJob *types.TranscriptionJob
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartTranscriptionJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartTranscriptionJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartTranscriptionJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartTranscriptionJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartTranscriptionJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "StartTranscriptionJob",
}
}
| 356 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds one or more custom tags, each in the form of a key:value pair, to the
// specified resource. To learn more about using tags with Amazon Transcribe, refer
// to Tagging resources (https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html)
// .
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource you want to tag. ARNs have the
// format arn:partition:service:region:account-id:resource-type/resource-id . For
// example,
// arn:aws:transcribe:us-west-2:111122223333:transcription-job/transcription-job-name
// . Valid values for resource-type are: transcription-job ,
// medical-transcription-job , vocabulary , medical-vocabulary , vocabulary-filter
// , and language-model .
//
// This member is required.
ResourceArn *string
// Adds one or more custom tags, each in the form of a key:value pair, to the
// specified resource. To learn more about using tags with Amazon Transcribe, refer
// to Tagging resources (https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html)
// .
//
// This member is required.
Tags []types.Tag
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "TagResource",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes the specified tags from the specified Amazon Transcribe resource. If
// you include UntagResource in your request, you must also include ResourceArn
// and TagKeys .
func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {
if params == nil {
params = &UntagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagResourceInput struct {
// The Amazon Resource Name (ARN) of the Amazon Transcribe resource you want to
// remove tags from. ARNs have the format
// arn:partition:service:region:account-id:resource-type/resource-id . For example,
// arn:aws:transcribe:us-west-2:111122223333:transcription-job/transcription-job-name
// . Valid values for resource-type are: transcription-job ,
// medical-transcription-job , vocabulary , medical-vocabulary , vocabulary-filter
// , and language-model .
//
// This member is required.
ResourceArn *string
// Removes the specified tag keys from the specified Amazon Transcribe resource.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
type UntagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "UntagResource",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified Call Analytics category with new rules. Note that the
// UpdateCallAnalyticsCategory operation overwrites all existing rules contained in
// the specified category. You cannot append additional rules onto an existing
// category. To create a new category, see .
func (c *Client) UpdateCallAnalyticsCategory(ctx context.Context, params *UpdateCallAnalyticsCategoryInput, optFns ...func(*Options)) (*UpdateCallAnalyticsCategoryOutput, error) {
if params == nil {
params = &UpdateCallAnalyticsCategoryInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateCallAnalyticsCategory", params, optFns, c.addOperationUpdateCallAnalyticsCategoryMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateCallAnalyticsCategoryOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateCallAnalyticsCategoryInput struct {
// The name of the Call Analytics category you want to update. Category names are
// case sensitive.
//
// This member is required.
CategoryName *string
// The rules used for the updated Call Analytics category. The rules you provide
// in this field replace the ones that are currently being used in the specified
// category.
//
// This member is required.
Rules []types.Rule
// Choose whether you want to update a real-time or a post-call category. The
// input type you specify must match the input type specified when the category was
// created. For example, if you created a category with the POST_CALL input type,
// you must use POST_CALL as the input type when updating this category.
InputType types.InputType
noSmithyDocumentSerde
}
type UpdateCallAnalyticsCategoryOutput struct {
// Provides you with the properties of the Call Analytics category you specified
// in your UpdateCallAnalyticsCategory request.
CategoryProperties *types.CategoryProperties
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateCallAnalyticsCategoryMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateCallAnalyticsCategory{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateCallAnalyticsCategory{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateCallAnalyticsCategoryValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCallAnalyticsCategory(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateCallAnalyticsCategory(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "UpdateCallAnalyticsCategory",
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates an existing custom medical vocabulary with new values. This operation
// overwrites all existing information with your new values; you cannot append new
// terms onto an existing custom vocabulary.
func (c *Client) UpdateMedicalVocabulary(ctx context.Context, params *UpdateMedicalVocabularyInput, optFns ...func(*Options)) (*UpdateMedicalVocabularyOutput, error) {
if params == nil {
params = &UpdateMedicalVocabularyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateMedicalVocabulary", params, optFns, c.addOperationUpdateMedicalVocabularyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateMedicalVocabularyOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateMedicalVocabularyInput struct {
// The language code that represents the language of the entries in the custom
// vocabulary you want to update. US English ( en-US ) is the only language
// supported with Amazon Transcribe Medical.
//
// This member is required.
LanguageCode types.LanguageCode
// The Amazon S3 location of the text file that contains your custom medical
// vocabulary. The URI must be located in the same Amazon Web Services Region as
// the resource you're calling. Here's an example URI path:
// s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txt
//
// This member is required.
VocabularyFileUri *string
// The name of the custom medical vocabulary you want to update. Custom medical
// vocabulary names are case sensitive.
//
// This member is required.
VocabularyName *string
noSmithyDocumentSerde
}
type UpdateMedicalVocabularyOutput struct {
// The language code you selected for your custom medical vocabulary. US English (
// en-US ) is the only language supported with Amazon Transcribe Medical.
LanguageCode types.LanguageCode
// The date and time the specified custom medical vocabulary was last updated.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// The name of the updated custom medical vocabulary.
VocabularyName *string
// The processing state of your custom medical vocabulary. If the state is READY ,
// you can use the custom vocabulary in a StartMedicalTranscriptionJob request.
VocabularyState types.VocabularyState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateMedicalVocabularyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateMedicalVocabulary{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateMedicalVocabulary{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateMedicalVocabularyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMedicalVocabulary(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateMedicalVocabulary(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "UpdateMedicalVocabulary",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates an existing custom vocabulary with new values. This operation
// overwrites all existing information with your new values; you cannot append new
// terms onto an existing custom vocabulary.
func (c *Client) UpdateVocabulary(ctx context.Context, params *UpdateVocabularyInput, optFns ...func(*Options)) (*UpdateVocabularyOutput, error) {
if params == nil {
params = &UpdateVocabularyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateVocabulary", params, optFns, c.addOperationUpdateVocabularyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateVocabularyOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateVocabularyInput struct {
// The language code that represents the language of the entries in the custom
// vocabulary you want to update. Each custom vocabulary must contain terms in only
// one language. A custom vocabulary can only be used to transcribe files in the
// same language as the custom vocabulary. For example, if you create a custom
// vocabulary using US English ( en-US ), you can only apply this custom vocabulary
// to files that contain English audio. For a list of supported languages and their
// associated language codes, refer to the Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table.
//
// This member is required.
LanguageCode types.LanguageCode
// The name of the custom vocabulary you want to update. Custom vocabulary names
// are case sensitive.
//
// This member is required.
VocabularyName *string
// The Amazon Resource Name (ARN) of an IAM role that has permissions to access
// the Amazon S3 bucket that contains your input files (in this case, your custom
// vocabulary). If the role that you specify doesn’t have the appropriate
// permissions to access the specified Amazon S3 location, your request fails. IAM
// role ARNs have the format arn:partition:iam::account:role/role-name-with-path .
// For example: arn:aws:iam::111122223333:role/Admin . For more information, see
// IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns)
// .
DataAccessRoleArn *string
// Use this parameter if you want to update your custom vocabulary by including
// all desired terms, as comma-separated values, within your request. The other
// option for updating your custom vocabulary is to save your entries in a text
// file and upload them to an Amazon S3 bucket, then specify the location of your
// file using the VocabularyFileUri parameter. Note that if you include Phrases in
// your request, you cannot use VocabularyFileUri ; you must choose one or the
// other. Each language has a character set that contains all allowed characters
// for that specific language. If you use unsupported characters, your custom
// vocabulary filter request fails. Refer to Character Sets for Custom Vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html)
// to get the character set for your language.
Phrases []string
// The Amazon S3 location of the text file that contains your custom vocabulary.
// The URI must be located in the same Amazon Web Services Region as the resource
// you're calling. Here's an example URI path:
// s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txt Note that if you include
// VocabularyFileUri in your request, you cannot use the Phrases flag; you must
// choose one or the other.
VocabularyFileUri *string
noSmithyDocumentSerde
}
type UpdateVocabularyOutput struct {
// The language code you selected for your custom vocabulary.
LanguageCode types.LanguageCode
// The date and time the specified custom vocabulary was last updated. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// The name of the updated custom vocabulary.
VocabularyName *string
// The processing state of your custom vocabulary. If the state is READY , you can
// use the custom vocabulary in a StartTranscriptionJob request.
VocabularyState types.VocabularyState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateVocabularyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateVocabulary{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateVocabulary{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateVocabularyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateVocabulary(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateVocabulary(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "UpdateVocabulary",
}
}
| 183 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates an existing custom vocabulary filter with a new list of words. The new
// list you provide overwrites all previous entries; you cannot append new terms
// onto an existing custom vocabulary filter.
func (c *Client) UpdateVocabularyFilter(ctx context.Context, params *UpdateVocabularyFilterInput, optFns ...func(*Options)) (*UpdateVocabularyFilterOutput, error) {
if params == nil {
params = &UpdateVocabularyFilterInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateVocabularyFilter", params, optFns, c.addOperationUpdateVocabularyFilterMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateVocabularyFilterOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateVocabularyFilterInput struct {
// The name of the custom vocabulary filter you want to update. Custom vocabulary
// filter names are case sensitive.
//
// This member is required.
VocabularyFilterName *string
// The Amazon Resource Name (ARN) of an IAM role that has permissions to access
// the Amazon S3 bucket that contains your input files (in this case, your custom
// vocabulary filter). If the role that you specify doesn’t have the appropriate
// permissions to access the specified Amazon S3 location, your request fails. IAM
// role ARNs have the format arn:partition:iam::account:role/role-name-with-path .
// For example: arn:aws:iam::111122223333:role/Admin . For more information, see
// IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns)
// .
DataAccessRoleArn *string
// The Amazon S3 location of the text file that contains your custom vocabulary
// filter terms. The URI must be located in the same Amazon Web Services Region as
// the resource you're calling. Here's an example URI path:
// s3://DOC-EXAMPLE-BUCKET/my-vocab-filter-file.txt Note that if you include
// VocabularyFilterFileUri in your request, you cannot use Words ; you must choose
// one or the other.
VocabularyFilterFileUri *string
// Use this parameter if you want to update your custom vocabulary filter by
// including all desired terms, as comma-separated values, within your request. The
// other option for updating your vocabulary filter is to save your entries in a
// text file and upload them to an Amazon S3 bucket, then specify the location of
// your file using the VocabularyFilterFileUri parameter. Note that if you include
// Words in your request, you cannot use VocabularyFilterFileUri ; you must choose
// one or the other. Each language has a character set that contains all allowed
// characters for that specific language. If you use unsupported characters, your
// custom vocabulary filter request fails. Refer to Character Sets for Custom
// Vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html) to
// get the character set for your language.
Words []string
noSmithyDocumentSerde
}
type UpdateVocabularyFilterOutput struct {
// The language code you selected for your custom vocabulary filter.
LanguageCode types.LanguageCode
// The date and time the specified custom vocabulary filter was last updated.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// The name of the updated custom vocabulary filter.
VocabularyFilterName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateVocabularyFilterMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateVocabularyFilter{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateVocabularyFilter{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateVocabularyFilterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateVocabularyFilter(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateVocabularyFilter(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "UpdateVocabularyFilter",
}
}
| 168 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/transcribe/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"
"math"
"strings"
)
type awsAwsjson11_deserializeOpCreateCallAnalyticsCategory struct {
}
func (*awsAwsjson11_deserializeOpCreateCallAnalyticsCategory) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateCallAnalyticsCategory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateCallAnalyticsCategory(response, &metadata)
}
output := &CreateCallAnalyticsCategoryOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateCallAnalyticsCategoryOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateCallAnalyticsCategory(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateLanguageModel struct {
}
func (*awsAwsjson11_deserializeOpCreateLanguageModel) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateLanguageModel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateLanguageModel(response, &metadata)
}
output := &CreateLanguageModelOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateLanguageModelOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateLanguageModel(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateMedicalVocabulary struct {
}
func (*awsAwsjson11_deserializeOpCreateMedicalVocabulary) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateMedicalVocabulary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateMedicalVocabulary(response, &metadata)
}
output := &CreateMedicalVocabularyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateMedicalVocabularyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateMedicalVocabulary(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateVocabulary struct {
}
func (*awsAwsjson11_deserializeOpCreateVocabulary) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateVocabulary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateVocabulary(response, &metadata)
}
output := &CreateVocabularyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateVocabularyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateVocabulary(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateVocabularyFilter struct {
}
func (*awsAwsjson11_deserializeOpCreateVocabularyFilter) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateVocabularyFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateVocabularyFilter(response, &metadata)
}
output := &CreateVocabularyFilterOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateVocabularyFilterOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateVocabularyFilter(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteCallAnalyticsCategory struct {
}
func (*awsAwsjson11_deserializeOpDeleteCallAnalyticsCategory) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteCallAnalyticsCategory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteCallAnalyticsCategory(response, &metadata)
}
output := &DeleteCallAnalyticsCategoryOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteCallAnalyticsCategoryOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteCallAnalyticsCategory(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteCallAnalyticsJob struct {
}
func (*awsAwsjson11_deserializeOpDeleteCallAnalyticsJob) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteCallAnalyticsJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteCallAnalyticsJob(response, &metadata)
}
output := &DeleteCallAnalyticsJobOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteCallAnalyticsJobOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteCallAnalyticsJob(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteLanguageModel struct {
}
func (*awsAwsjson11_deserializeOpDeleteLanguageModel) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteLanguageModel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLanguageModel(response, &metadata)
}
output := &DeleteLanguageModelOutput{}
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 awsAwsjson11_deserializeOpErrorDeleteLanguageModel(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteMedicalTranscriptionJob struct {
}
func (*awsAwsjson11_deserializeOpDeleteMedicalTranscriptionJob) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteMedicalTranscriptionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMedicalTranscriptionJob(response, &metadata)
}
output := &DeleteMedicalTranscriptionJobOutput{}
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 awsAwsjson11_deserializeOpErrorDeleteMedicalTranscriptionJob(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteMedicalVocabulary struct {
}
func (*awsAwsjson11_deserializeOpDeleteMedicalVocabulary) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteMedicalVocabulary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMedicalVocabulary(response, &metadata)
}
output := &DeleteMedicalVocabularyOutput{}
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 awsAwsjson11_deserializeOpErrorDeleteMedicalVocabulary(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteTranscriptionJob struct {
}
func (*awsAwsjson11_deserializeOpDeleteTranscriptionJob) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteTranscriptionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteTranscriptionJob(response, &metadata)
}
output := &DeleteTranscriptionJobOutput{}
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 awsAwsjson11_deserializeOpErrorDeleteTranscriptionJob(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteVocabulary struct {
}
func (*awsAwsjson11_deserializeOpDeleteVocabulary) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteVocabulary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteVocabulary(response, &metadata)
}
output := &DeleteVocabularyOutput{}
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 awsAwsjson11_deserializeOpErrorDeleteVocabulary(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteVocabularyFilter struct {
}
func (*awsAwsjson11_deserializeOpDeleteVocabularyFilter) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteVocabularyFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteVocabularyFilter(response, &metadata)
}
output := &DeleteVocabularyFilterOutput{}
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 awsAwsjson11_deserializeOpErrorDeleteVocabularyFilter(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeLanguageModel struct {
}
func (*awsAwsjson11_deserializeOpDescribeLanguageModel) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeLanguageModel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDescribeLanguageModel(response, &metadata)
}
output := &DescribeLanguageModelOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDescribeLanguageModelOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeLanguageModel(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetCallAnalyticsCategory struct {
}
func (*awsAwsjson11_deserializeOpGetCallAnalyticsCategory) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetCallAnalyticsCategory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetCallAnalyticsCategory(response, &metadata)
}
output := &GetCallAnalyticsCategoryOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetCallAnalyticsCategoryOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetCallAnalyticsCategory(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetCallAnalyticsJob struct {
}
func (*awsAwsjson11_deserializeOpGetCallAnalyticsJob) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetCallAnalyticsJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetCallAnalyticsJob(response, &metadata)
}
output := &GetCallAnalyticsJobOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetCallAnalyticsJobOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetCallAnalyticsJob(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetMedicalTranscriptionJob struct {
}
func (*awsAwsjson11_deserializeOpGetMedicalTranscriptionJob) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetMedicalTranscriptionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetMedicalTranscriptionJob(response, &metadata)
}
output := &GetMedicalTranscriptionJobOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetMedicalTranscriptionJobOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetMedicalTranscriptionJob(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetMedicalVocabulary struct {
}
func (*awsAwsjson11_deserializeOpGetMedicalVocabulary) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetMedicalVocabulary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetMedicalVocabulary(response, &metadata)
}
output := &GetMedicalVocabularyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetMedicalVocabularyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetMedicalVocabulary(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetTranscriptionJob struct {
}
func (*awsAwsjson11_deserializeOpGetTranscriptionJob) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetTranscriptionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetTranscriptionJob(response, &metadata)
}
output := &GetTranscriptionJobOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetTranscriptionJobOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetTranscriptionJob(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetVocabulary struct {
}
func (*awsAwsjson11_deserializeOpGetVocabulary) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetVocabulary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetVocabulary(response, &metadata)
}
output := &GetVocabularyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetVocabularyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetVocabulary(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetVocabularyFilter struct {
}
func (*awsAwsjson11_deserializeOpGetVocabularyFilter) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetVocabularyFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetVocabularyFilter(response, &metadata)
}
output := &GetVocabularyFilterOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetVocabularyFilterOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetVocabularyFilter(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListCallAnalyticsCategories struct {
}
func (*awsAwsjson11_deserializeOpListCallAnalyticsCategories) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListCallAnalyticsCategories) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListCallAnalyticsCategories(response, &metadata)
}
output := &ListCallAnalyticsCategoriesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListCallAnalyticsCategoriesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListCallAnalyticsCategories(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListCallAnalyticsJobs struct {
}
func (*awsAwsjson11_deserializeOpListCallAnalyticsJobs) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListCallAnalyticsJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListCallAnalyticsJobs(response, &metadata)
}
output := &ListCallAnalyticsJobsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListCallAnalyticsJobsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListCallAnalyticsJobs(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListLanguageModels struct {
}
func (*awsAwsjson11_deserializeOpListLanguageModels) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListLanguageModels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListLanguageModels(response, &metadata)
}
output := &ListLanguageModelsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListLanguageModelsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListLanguageModels(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListMedicalTranscriptionJobs struct {
}
func (*awsAwsjson11_deserializeOpListMedicalTranscriptionJobs) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListMedicalTranscriptionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListMedicalTranscriptionJobs(response, &metadata)
}
output := &ListMedicalTranscriptionJobsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListMedicalTranscriptionJobsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListMedicalTranscriptionJobs(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListMedicalVocabularies struct {
}
func (*awsAwsjson11_deserializeOpListMedicalVocabularies) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListMedicalVocabularies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListMedicalVocabularies(response, &metadata)
}
output := &ListMedicalVocabulariesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListMedicalVocabulariesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListMedicalVocabularies(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTagsForResource struct {
}
func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTranscriptionJobs struct {
}
func (*awsAwsjson11_deserializeOpListTranscriptionJobs) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTranscriptionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListTranscriptionJobs(response, &metadata)
}
output := &ListTranscriptionJobsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListTranscriptionJobsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListTranscriptionJobs(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListVocabularies struct {
}
func (*awsAwsjson11_deserializeOpListVocabularies) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListVocabularies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListVocabularies(response, &metadata)
}
output := &ListVocabulariesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListVocabulariesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListVocabularies(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListVocabularyFilters struct {
}
func (*awsAwsjson11_deserializeOpListVocabularyFilters) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListVocabularyFilters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListVocabularyFilters(response, &metadata)
}
output := &ListVocabularyFiltersOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListVocabularyFiltersOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListVocabularyFilters(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStartCallAnalyticsJob struct {
}
func (*awsAwsjson11_deserializeOpStartCallAnalyticsJob) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStartCallAnalyticsJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorStartCallAnalyticsJob(response, &metadata)
}
output := &StartCallAnalyticsJobOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentStartCallAnalyticsJobOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorStartCallAnalyticsJob(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStartMedicalTranscriptionJob struct {
}
func (*awsAwsjson11_deserializeOpStartMedicalTranscriptionJob) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStartMedicalTranscriptionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorStartMedicalTranscriptionJob(response, &metadata)
}
output := &StartMedicalTranscriptionJobOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentStartMedicalTranscriptionJobOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorStartMedicalTranscriptionJob(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStartTranscriptionJob struct {
}
func (*awsAwsjson11_deserializeOpStartTranscriptionJob) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStartTranscriptionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorStartTranscriptionJob(response, &metadata)
}
output := &StartTranscriptionJobOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentStartTranscriptionJobOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorStartTranscriptionJob(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpTagResource struct {
}
func (*awsAwsjson11_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUntagResource struct {
}
func (*awsAwsjson11_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateCallAnalyticsCategory struct {
}
func (*awsAwsjson11_deserializeOpUpdateCallAnalyticsCategory) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateCallAnalyticsCategory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateCallAnalyticsCategory(response, &metadata)
}
output := &UpdateCallAnalyticsCategoryOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateCallAnalyticsCategoryOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateCallAnalyticsCategory(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateMedicalVocabulary struct {
}
func (*awsAwsjson11_deserializeOpUpdateMedicalVocabulary) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateMedicalVocabulary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMedicalVocabulary(response, &metadata)
}
output := &UpdateMedicalVocabularyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateMedicalVocabularyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateMedicalVocabulary(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateVocabulary struct {
}
func (*awsAwsjson11_deserializeOpUpdateVocabulary) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateVocabulary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateVocabulary(response, &metadata)
}
output := &UpdateVocabularyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateVocabularyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateVocabulary(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateVocabularyFilter struct {
}
func (*awsAwsjson11_deserializeOpUpdateVocabularyFilter) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateVocabularyFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateVocabularyFilter(response, &metadata)
}
output := &UpdateVocabularyFilterOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateVocabularyFilterOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateVocabularyFilter(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 awsAwsjson11_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.BadRequestException{}
err := awsAwsjson11_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 awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ConflictException{}
err := awsAwsjson11_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 awsAwsjson11_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.InternalFailureException{}
err := awsAwsjson11_deserializeDocumentInternalFailureException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.LimitExceededException{}
err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.NotFoundException{}
err := awsAwsjson11_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 awsAwsjson11_deserializeDocumentAbsoluteTimeRange(v **types.AbsoluteTimeRange, 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.AbsoluteTimeRange
if *v == nil {
sv = &types.AbsoluteTimeRange{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EndTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampMilliseconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.EndTime = ptr.Int64(i64)
}
case "First":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampMilliseconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.First = ptr.Int64(i64)
}
case "Last":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampMilliseconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Last = ptr.Int64(i64)
}
case "StartTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampMilliseconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.StartTime = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_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 "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCallAnalyticsJob(v **types.CallAnalyticsJob, 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.CallAnalyticsJob
if *v == nil {
sv = &types.CallAnalyticsJob{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CallAnalyticsJobName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CallAnalyticsJobName to be of type string, got %T instead", value)
}
sv.CallAnalyticsJobName = ptr.String(jtv)
}
case "CallAnalyticsJobStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CallAnalyticsJobStatus to be of type string, got %T instead", value)
}
sv.CallAnalyticsJobStatus = types.CallAnalyticsJobStatus(jtv)
}
case "ChannelDefinitions":
if err := awsAwsjson11_deserializeDocumentChannelDefinitions(&sv.ChannelDefinitions, value); err != nil {
return err
}
case "CompletionTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CompletionTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "CreationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "DataAccessRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataAccessRoleArn to be of type string, got %T instead", value)
}
sv.DataAccessRoleArn = ptr.String(jtv)
}
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "IdentifiedLanguageScore":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.IdentifiedLanguageScore = ptr.Float32(float32(f64))
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.IdentifiedLanguageScore = ptr.Float32(float32(f64))
default:
return fmt.Errorf("expected IdentifiedLanguageScore to be a JSON Number, got %T instead", value)
}
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "Media":
if err := awsAwsjson11_deserializeDocumentMedia(&sv.Media, value); err != nil {
return err
}
case "MediaFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MediaFormat to be of type string, got %T instead", value)
}
sv.MediaFormat = types.MediaFormat(jtv)
}
case "MediaSampleRateHertz":
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.MediaSampleRateHertz = ptr.Int32(int32(i64))
}
case "Settings":
if err := awsAwsjson11_deserializeDocumentCallAnalyticsJobSettings(&sv.Settings, value); err != nil {
return err
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "Transcript":
if err := awsAwsjson11_deserializeDocumentTranscript(&sv.Transcript, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCallAnalyticsJobSettings(v **types.CallAnalyticsJobSettings, 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.CallAnalyticsJobSettings
if *v == nil {
sv = &types.CallAnalyticsJobSettings{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ContentRedaction":
if err := awsAwsjson11_deserializeDocumentContentRedaction(&sv.ContentRedaction, value); err != nil {
return err
}
case "LanguageIdSettings":
if err := awsAwsjson11_deserializeDocumentLanguageIdSettingsMap(&sv.LanguageIdSettings, value); err != nil {
return err
}
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 err := awsAwsjson11_deserializeDocumentLanguageOptions(&sv.LanguageOptions, 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 awsAwsjson11_deserializeDocumentCallAnalyticsJobSummaries(v *[]types.CallAnalyticsJobSummary, 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.CallAnalyticsJobSummary
if *v == nil {
cv = []types.CallAnalyticsJobSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CallAnalyticsJobSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCallAnalyticsJobSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCallAnalyticsJobSummary(v **types.CallAnalyticsJobSummary, 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.CallAnalyticsJobSummary
if *v == nil {
sv = &types.CallAnalyticsJobSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CallAnalyticsJobName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CallAnalyticsJobName to be of type string, got %T instead", value)
}
sv.CallAnalyticsJobName = ptr.String(jtv)
}
case "CallAnalyticsJobStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CallAnalyticsJobStatus to be of type string, got %T instead", value)
}
sv.CallAnalyticsJobStatus = types.CallAnalyticsJobStatus(jtv)
}
case "CompletionTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CompletionTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "CreationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCategoryProperties(v **types.CategoryProperties, 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.CategoryProperties
if *v == nil {
sv = &types.CategoryProperties{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CategoryName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CategoryName to be of type string, got %T instead", value)
}
sv.CategoryName = ptr.String(jtv)
}
case "CreateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "InputType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InputType to be of type string, got %T instead", value)
}
sv.InputType = types.InputType(jtv)
}
case "LastUpdateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "Rules":
if err := awsAwsjson11_deserializeDocumentRuleList(&sv.Rules, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCategoryPropertiesList(v *[]types.CategoryProperties, 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.CategoryProperties
if *v == nil {
cv = []types.CategoryProperties{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CategoryProperties
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCategoryProperties(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_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 awsAwsjson11_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 := awsAwsjson11_deserializeDocumentChannelDefinition(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_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 "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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentContentRedaction(v **types.ContentRedaction, 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.ContentRedaction
if *v == nil {
sv = &types.ContentRedaction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "PiiEntityTypes":
if err := awsAwsjson11_deserializeDocumentPiiEntityTypes(&sv.PiiEntityTypes, value); err != nil {
return err
}
case "RedactionOutput":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RedactionOutput to be of type string, got %T instead", value)
}
sv.RedactionOutput = types.RedactionOutput(jtv)
}
case "RedactionType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RedactionType to be of type string, got %T instead", value)
}
sv.RedactionType = types.RedactionType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInputDataConfig(v **types.InputDataConfig, 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.InputDataConfig
if *v == nil {
sv = &types.InputDataConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DataAccessRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataAccessRoleArn to be of type string, got %T instead", value)
}
sv.DataAccessRoleArn = ptr.String(jtv)
}
case "S3Uri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uri to be of type string, got %T instead", value)
}
sv.S3Uri = ptr.String(jtv)
}
case "TuningDataS3Uri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uri to be of type string, got %T instead", value)
}
sv.TuningDataS3Uri = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInternalFailureException(v **types.InternalFailureException, 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.InternalFailureException
if *v == nil {
sv = &types.InternalFailureException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInterruptionFilter(v **types.InterruptionFilter, 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.InterruptionFilter
if *v == nil {
sv = &types.InterruptionFilter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AbsoluteTimeRange":
if err := awsAwsjson11_deserializeDocumentAbsoluteTimeRange(&sv.AbsoluteTimeRange, 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 = ptr.Bool(jtv)
}
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)
}
case "RelativeTimeRange":
if err := awsAwsjson11_deserializeDocumentRelativeTimeRange(&sv.RelativeTimeRange, value); err != nil {
return err
}
case "Threshold":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampMilliseconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Threshold = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentJobExecutionSettings(v **types.JobExecutionSettings, 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.JobExecutionSettings
if *v == nil {
sv = &types.JobExecutionSettings{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AllowDeferredExecution":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.AllowDeferredExecution = ptr.Bool(jtv)
}
case "DataAccessRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataAccessRoleArn to be of type string, got %T instead", value)
}
sv.DataAccessRoleArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLanguageCodeItem(v **types.LanguageCodeItem, 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.LanguageCodeItem
if *v == nil {
sv = &types.LanguageCodeItem{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DurationInSeconds":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.DurationInSeconds = ptr.Float32(float32(f64))
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.DurationInSeconds = ptr.Float32(float32(f64))
default:
return fmt.Errorf("expected DurationInSeconds to be a JSON Number, got %T instead", value)
}
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLanguageCodeList(v *[]types.LanguageCodeItem, 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.LanguageCodeItem
if *v == nil {
cv = []types.LanguageCodeItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LanguageCodeItem
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLanguageCodeItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLanguageIdSettings(v **types.LanguageIdSettings, 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.LanguageIdSettings
if *v == nil {
sv = &types.LanguageIdSettings{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
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 "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 awsAwsjson11_deserializeDocumentLanguageIdSettingsMap(v *map[string]types.LanguageIdSettings, 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]types.LanguageIdSettings
if *v == nil {
mv = map[string]types.LanguageIdSettings{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.LanguageIdSettings
mapVar := parsedVal
destAddr := &mapVar
if err := awsAwsjson11_deserializeDocumentLanguageIdSettings(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsAwsjson11_deserializeDocumentLanguageModel(v **types.LanguageModel, 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.LanguageModel
if *v == nil {
sv = &types.LanguageModel{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BaseModelName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BaseModelName to be of type string, got %T instead", value)
}
sv.BaseModelName = types.BaseModelName(jtv)
}
case "CreateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "InputDataConfig":
if err := awsAwsjson11_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil {
return err
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CLMLanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.CLMLanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "ModelName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ModelName to be of type string, got %T instead", value)
}
sv.ModelName = ptr.String(jtv)
}
case "ModelStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ModelStatus to be of type string, got %T instead", value)
}
sv.ModelStatus = types.ModelStatus(jtv)
}
case "UpgradeAvailability":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.UpgradeAvailability = ptr.Bool(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLanguageOptions(v *[]types.LanguageCode, 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.LanguageCode
if *v == nil {
cv = []types.LanguageCode{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LanguageCode
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
col = types.LanguageCode(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LimitExceededException
if *v == nil {
sv = &types.LimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMedia(v **types.Media, 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.Media
if *v == nil {
sv = &types.Media{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MediaFileUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uri to be of type string, got %T instead", value)
}
sv.MediaFileUri = ptr.String(jtv)
}
case "RedactedMediaFileUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uri to be of type string, got %T instead", value)
}
sv.RedactedMediaFileUri = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMedicalTranscript(v **types.MedicalTranscript, 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.MedicalTranscript
if *v == nil {
sv = &types.MedicalTranscript{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "TranscriptFileUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uri to be of type string, got %T instead", value)
}
sv.TranscriptFileUri = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMedicalTranscriptionJob(v **types.MedicalTranscriptionJob, 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.MedicalTranscriptionJob
if *v == nil {
sv = &types.MedicalTranscriptionJob{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CompletionTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CompletionTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "ContentIdentificationType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MedicalContentIdentificationType to be of type string, got %T instead", value)
}
sv.ContentIdentificationType = types.MedicalContentIdentificationType(jtv)
}
case "CreationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "Media":
if err := awsAwsjson11_deserializeDocumentMedia(&sv.Media, value); err != nil {
return err
}
case "MediaFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MediaFormat to be of type string, got %T instead", value)
}
sv.MediaFormat = types.MediaFormat(jtv)
}
case "MediaSampleRateHertz":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MedicalMediaSampleRateHertz to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MediaSampleRateHertz = ptr.Int32(int32(i64))
}
case "MedicalTranscriptionJobName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscriptionJobName to be of type string, got %T instead", value)
}
sv.MedicalTranscriptionJobName = ptr.String(jtv)
}
case "Settings":
if err := awsAwsjson11_deserializeDocumentMedicalTranscriptionSetting(&sv.Settings, value); err != nil {
return err
}
case "Specialty":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Specialty to be of type string, got %T instead", value)
}
sv.Specialty = types.Specialty(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
case "Transcript":
if err := awsAwsjson11_deserializeDocumentMedicalTranscript(&sv.Transcript, value); err != nil {
return err
}
case "TranscriptionJobStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscriptionJobStatus to be of type string, got %T instead", value)
}
sv.TranscriptionJobStatus = types.TranscriptionJobStatus(jtv)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Type to be of type string, got %T instead", value)
}
sv.Type = types.Type(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMedicalTranscriptionJobSummaries(v *[]types.MedicalTranscriptionJobSummary, 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.MedicalTranscriptionJobSummary
if *v == nil {
cv = []types.MedicalTranscriptionJobSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MedicalTranscriptionJobSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentMedicalTranscriptionJobSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentMedicalTranscriptionJobSummary(v **types.MedicalTranscriptionJobSummary, 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.MedicalTranscriptionJobSummary
if *v == nil {
sv = &types.MedicalTranscriptionJobSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CompletionTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CompletionTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "ContentIdentificationType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MedicalContentIdentificationType to be of type string, got %T instead", value)
}
sv.ContentIdentificationType = types.MedicalContentIdentificationType(jtv)
}
case "CreationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "MedicalTranscriptionJobName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscriptionJobName to be of type string, got %T instead", value)
}
sv.MedicalTranscriptionJobName = ptr.String(jtv)
}
case "OutputLocationType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutputLocationType to be of type string, got %T instead", value)
}
sv.OutputLocationType = types.OutputLocationType(jtv)
}
case "Specialty":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Specialty to be of type string, got %T instead", value)
}
sv.Specialty = types.Specialty(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "TranscriptionJobStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscriptionJobStatus to be of type string, got %T instead", value)
}
sv.TranscriptionJobStatus = types.TranscriptionJobStatus(jtv)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Type to be of type string, got %T instead", value)
}
sv.Type = types.Type(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMedicalTranscriptionSetting(v **types.MedicalTranscriptionSetting, 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.MedicalTranscriptionSetting
if *v == nil {
sv = &types.MedicalTranscriptionSetting{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChannelIdentification":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.ChannelIdentification = ptr.Bool(jtv)
}
case "MaxAlternatives":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MaxAlternatives to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxAlternatives = ptr.Int32(int32(i64))
}
case "MaxSpeakerLabels":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MaxSpeakers to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxSpeakerLabels = ptr.Int32(int32(i64))
}
case "ShowAlternatives":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.ShowAlternatives = ptr.Bool(jtv)
}
case "ShowSpeakerLabels":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.ShowSpeakerLabels = ptr.Bool(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 awsAwsjson11_deserializeDocumentModels(v *[]types.LanguageModel, 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.LanguageModel
if *v == nil {
cv = []types.LanguageModel{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LanguageModel
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLanguageModel(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentModelSettings(v **types.ModelSettings, 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.ModelSettings
if *v == nil {
sv = &types.ModelSettings{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentNonTalkTimeFilter(v **types.NonTalkTimeFilter, 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.NonTalkTimeFilter
if *v == nil {
sv = &types.NonTalkTimeFilter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AbsoluteTimeRange":
if err := awsAwsjson11_deserializeDocumentAbsoluteTimeRange(&sv.AbsoluteTimeRange, 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 = ptr.Bool(jtv)
}
case "RelativeTimeRange":
if err := awsAwsjson11_deserializeDocumentRelativeTimeRange(&sv.RelativeTimeRange, value); err != nil {
return err
}
case "Threshold":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampMilliseconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Threshold = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_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 "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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPiiEntityTypes(v *[]types.PiiEntityType, 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.PiiEntityType
if *v == nil {
cv = []types.PiiEntityType{}
} else {
cv = *v
}
for _, value := range shape {
var col types.PiiEntityType
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PiiEntityType to be of type string, got %T instead", value)
}
col = types.PiiEntityType(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRelativeTimeRange(v **types.RelativeTimeRange, 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.RelativeTimeRange
if *v == nil {
sv = &types.RelativeTimeRange{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EndPercentage":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.EndPercentage = ptr.Int32(int32(i64))
}
case "First":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.First = ptr.Int32(int32(i64))
}
case "Last":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Last = ptr.Int32(int32(i64))
}
case "StartPercentage":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.StartPercentage = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRule(v *types.Rule, 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 uv types.Rule
loop:
for key, value := range shape {
if value == nil {
continue
}
switch key {
case "InterruptionFilter":
var mv types.InterruptionFilter
destAddr := &mv
if err := awsAwsjson11_deserializeDocumentInterruptionFilter(&destAddr, value); err != nil {
return err
}
mv = *destAddr
uv = &types.RuleMemberInterruptionFilter{Value: mv}
break loop
case "NonTalkTimeFilter":
var mv types.NonTalkTimeFilter
destAddr := &mv
if err := awsAwsjson11_deserializeDocumentNonTalkTimeFilter(&destAddr, value); err != nil {
return err
}
mv = *destAddr
uv = &types.RuleMemberNonTalkTimeFilter{Value: mv}
break loop
case "SentimentFilter":
var mv types.SentimentFilter
destAddr := &mv
if err := awsAwsjson11_deserializeDocumentSentimentFilter(&destAddr, value); err != nil {
return err
}
mv = *destAddr
uv = &types.RuleMemberSentimentFilter{Value: mv}
break loop
case "TranscriptFilter":
var mv types.TranscriptFilter
destAddr := &mv
if err := awsAwsjson11_deserializeDocumentTranscriptFilter(&destAddr, value); err != nil {
return err
}
mv = *destAddr
uv = &types.RuleMemberTranscriptFilter{Value: mv}
break loop
default:
uv = &types.UnknownUnionMember{Tag: key}
break loop
}
}
*v = uv
return nil
}
func awsAwsjson11_deserializeDocumentRuleList(v *[]types.Rule, 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.Rule
if *v == nil {
cv = []types.Rule{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Rule
if err := awsAwsjson11_deserializeDocumentRule(&col, value); err != nil {
return err
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSentimentFilter(v **types.SentimentFilter, 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.SentimentFilter
if *v == nil {
sv = &types.SentimentFilter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AbsoluteTimeRange":
if err := awsAwsjson11_deserializeDocumentAbsoluteTimeRange(&sv.AbsoluteTimeRange, 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 = ptr.Bool(jtv)
}
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)
}
case "RelativeTimeRange":
if err := awsAwsjson11_deserializeDocumentRelativeTimeRange(&sv.RelativeTimeRange, value); err != nil {
return err
}
case "Sentiments":
if err := awsAwsjson11_deserializeDocumentSentimentValueList(&sv.Sentiments, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSentimentValueList(v *[]types.SentimentValue, 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.SentimentValue
if *v == nil {
cv = []types.SentimentValue{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SentimentValue
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SentimentValue to be of type string, got %T instead", value)
}
col = types.SentimentValue(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSettings(v **types.Settings, 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.Settings
if *v == nil {
sv = &types.Settings{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChannelIdentification":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.ChannelIdentification = ptr.Bool(jtv)
}
case "MaxAlternatives":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MaxAlternatives to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxAlternatives = ptr.Int32(int32(i64))
}
case "MaxSpeakerLabels":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MaxSpeakers to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxSpeakerLabels = ptr.Int32(int32(i64))
}
case "ShowAlternatives":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.ShowAlternatives = ptr.Bool(jtv)
}
case "ShowSpeakerLabels":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.ShowSpeakerLabels = ptr.Bool(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 "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 awsAwsjson11_deserializeDocumentStringTargetList(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 NonEmptyString to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSubtitleFileUris(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 Uri to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSubtitleFormats(v *[]types.SubtitleFormat, 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.SubtitleFormat
if *v == nil {
cv = []types.SubtitleFormat{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SubtitleFormat
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubtitleFormat to be of type string, got %T instead", value)
}
col = types.SubtitleFormat(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSubtitlesOutput(v **types.SubtitlesOutput, 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.SubtitlesOutput
if *v == nil {
sv = &types.SubtitlesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Formats":
if err := awsAwsjson11_deserializeDocumentSubtitleFormats(&sv.Formats, value); err != nil {
return err
}
case "OutputStartIndex":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SubtitleOutputStartIndex to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.OutputStartIndex = ptr.Int32(int32(i64))
}
case "SubtitleFileUris":
if err := awsAwsjson11_deserializeDocumentSubtitleFileUris(&sv.SubtitleFileUris, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTranscript(v **types.Transcript, 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.Transcript
if *v == nil {
sv = &types.Transcript{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RedactedTranscriptFileUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uri to be of type string, got %T instead", value)
}
sv.RedactedTranscriptFileUri = ptr.String(jtv)
}
case "TranscriptFileUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uri to be of type string, got %T instead", value)
}
sv.TranscriptFileUri = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTranscriptFilter(v **types.TranscriptFilter, 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.TranscriptFilter
if *v == nil {
sv = &types.TranscriptFilter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AbsoluteTimeRange":
if err := awsAwsjson11_deserializeDocumentAbsoluteTimeRange(&sv.AbsoluteTimeRange, 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 = ptr.Bool(jtv)
}
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)
}
case "RelativeTimeRange":
if err := awsAwsjson11_deserializeDocumentRelativeTimeRange(&sv.RelativeTimeRange, value); err != nil {
return err
}
case "Targets":
if err := awsAwsjson11_deserializeDocumentStringTargetList(&sv.Targets, value); err != nil {
return err
}
case "TranscriptFilterType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscriptFilterType to be of type string, got %T instead", value)
}
sv.TranscriptFilterType = types.TranscriptFilterType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTranscriptionJob(v **types.TranscriptionJob, 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.TranscriptionJob
if *v == nil {
sv = &types.TranscriptionJob{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CompletionTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CompletionTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "ContentRedaction":
if err := awsAwsjson11_deserializeDocumentContentRedaction(&sv.ContentRedaction, value); err != nil {
return err
}
case "CreationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "IdentifiedLanguageScore":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.IdentifiedLanguageScore = ptr.Float32(float32(f64))
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.IdentifiedLanguageScore = ptr.Float32(float32(f64))
default:
return fmt.Errorf("expected IdentifiedLanguageScore to be a JSON Number, got %T instead", value)
}
}
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 = ptr.Bool(jtv)
}
case "IdentifyMultipleLanguages":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.IdentifyMultipleLanguages = ptr.Bool(jtv)
}
case "JobExecutionSettings":
if err := awsAwsjson11_deserializeDocumentJobExecutionSettings(&sv.JobExecutionSettings, value); err != nil {
return err
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LanguageCodes":
if err := awsAwsjson11_deserializeDocumentLanguageCodeList(&sv.LanguageCodes, value); err != nil {
return err
}
case "LanguageIdSettings":
if err := awsAwsjson11_deserializeDocumentLanguageIdSettingsMap(&sv.LanguageIdSettings, value); err != nil {
return err
}
case "LanguageOptions":
if err := awsAwsjson11_deserializeDocumentLanguageOptions(&sv.LanguageOptions, value); err != nil {
return err
}
case "Media":
if err := awsAwsjson11_deserializeDocumentMedia(&sv.Media, value); err != nil {
return err
}
case "MediaFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MediaFormat to be of type string, got %T instead", value)
}
sv.MediaFormat = types.MediaFormat(jtv)
}
case "MediaSampleRateHertz":
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.MediaSampleRateHertz = ptr.Int32(int32(i64))
}
case "ModelSettings":
if err := awsAwsjson11_deserializeDocumentModelSettings(&sv.ModelSettings, value); err != nil {
return err
}
case "Settings":
if err := awsAwsjson11_deserializeDocumentSettings(&sv.Settings, value); err != nil {
return err
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "Subtitles":
if err := awsAwsjson11_deserializeDocumentSubtitlesOutput(&sv.Subtitles, value); err != nil {
return err
}
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
case "Transcript":
if err := awsAwsjson11_deserializeDocumentTranscript(&sv.Transcript, value); err != nil {
return err
}
case "TranscriptionJobName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscriptionJobName to be of type string, got %T instead", value)
}
sv.TranscriptionJobName = ptr.String(jtv)
}
case "TranscriptionJobStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscriptionJobStatus to be of type string, got %T instead", value)
}
sv.TranscriptionJobStatus = types.TranscriptionJobStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTranscriptionJobSummaries(v *[]types.TranscriptionJobSummary, 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.TranscriptionJobSummary
if *v == nil {
cv = []types.TranscriptionJobSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TranscriptionJobSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTranscriptionJobSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTranscriptionJobSummary(v **types.TranscriptionJobSummary, 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.TranscriptionJobSummary
if *v == nil {
sv = &types.TranscriptionJobSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CompletionTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CompletionTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "ContentRedaction":
if err := awsAwsjson11_deserializeDocumentContentRedaction(&sv.ContentRedaction, value); err != nil {
return err
}
case "CreationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "IdentifiedLanguageScore":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.IdentifiedLanguageScore = ptr.Float32(float32(f64))
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.IdentifiedLanguageScore = ptr.Float32(float32(f64))
default:
return fmt.Errorf("expected IdentifiedLanguageScore to be a JSON Number, got %T instead", value)
}
}
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 = ptr.Bool(jtv)
}
case "IdentifyMultipleLanguages":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.IdentifyMultipleLanguages = ptr.Bool(jtv)
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LanguageCodes":
if err := awsAwsjson11_deserializeDocumentLanguageCodeList(&sv.LanguageCodes, value); err != nil {
return err
}
case "ModelSettings":
if err := awsAwsjson11_deserializeDocumentModelSettings(&sv.ModelSettings, value); err != nil {
return err
}
case "OutputLocationType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutputLocationType to be of type string, got %T instead", value)
}
sv.OutputLocationType = types.OutputLocationType(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "TranscriptionJobName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscriptionJobName to be of type string, got %T instead", value)
}
sv.TranscriptionJobName = ptr.String(jtv)
}
case "TranscriptionJobStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscriptionJobStatus to be of type string, got %T instead", value)
}
sv.TranscriptionJobStatus = types.TranscriptionJobStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentVocabularies(v *[]types.VocabularyInfo, 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.VocabularyInfo
if *v == nil {
cv = []types.VocabularyInfo{}
} else {
cv = *v
}
for _, value := range shape {
var col types.VocabularyInfo
destAddr := &col
if err := awsAwsjson11_deserializeDocumentVocabularyInfo(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentVocabularyFilterInfo(v **types.VocabularyFilterInfo, 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.VocabularyFilterInfo
if *v == nil {
sv = &types.VocabularyFilterInfo{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentVocabularyFilters(v *[]types.VocabularyFilterInfo, 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.VocabularyFilterInfo
if *v == nil {
cv = []types.VocabularyFilterInfo{}
} else {
cv = *v
}
for _, value := range shape {
var col types.VocabularyFilterInfo
destAddr := &col
if err := awsAwsjson11_deserializeDocumentVocabularyFilterInfo(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentVocabularyInfo(v **types.VocabularyInfo, 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.VocabularyInfo
if *v == nil {
sv = &types.VocabularyInfo{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
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 "VocabularyState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VocabularyState to be of type string, got %T instead", value)
}
sv.VocabularyState = types.VocabularyState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateCallAnalyticsCategoryOutput(v **CreateCallAnalyticsCategoryOutput, 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 *CreateCallAnalyticsCategoryOutput
if *v == nil {
sv = &CreateCallAnalyticsCategoryOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CategoryProperties":
if err := awsAwsjson11_deserializeDocumentCategoryProperties(&sv.CategoryProperties, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateLanguageModelOutput(v **CreateLanguageModelOutput, 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 *CreateLanguageModelOutput
if *v == nil {
sv = &CreateLanguageModelOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BaseModelName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BaseModelName to be of type string, got %T instead", value)
}
sv.BaseModelName = types.BaseModelName(jtv)
}
case "InputDataConfig":
if err := awsAwsjson11_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil {
return err
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CLMLanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.CLMLanguageCode(jtv)
}
case "ModelName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ModelName to be of type string, got %T instead", value)
}
sv.ModelName = ptr.String(jtv)
}
case "ModelStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ModelStatus to be of type string, got %T instead", value)
}
sv.ModelStatus = types.ModelStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateMedicalVocabularyOutput(v **CreateMedicalVocabularyOutput, 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 *CreateMedicalVocabularyOutput
if *v == nil {
sv = &CreateMedicalVocabularyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
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 "VocabularyState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VocabularyState to be of type string, got %T instead", value)
}
sv.VocabularyState = types.VocabularyState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateVocabularyFilterOutput(v **CreateVocabularyFilterOutput, 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 *CreateVocabularyFilterOutput
if *v == nil {
sv = &CreateVocabularyFilterOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateVocabularyOutput(v **CreateVocabularyOutput, 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 *CreateVocabularyOutput
if *v == nil {
sv = &CreateVocabularyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
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 "VocabularyState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VocabularyState to be of type string, got %T instead", value)
}
sv.VocabularyState = types.VocabularyState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteCallAnalyticsCategoryOutput(v **DeleteCallAnalyticsCategoryOutput, 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 *DeleteCallAnalyticsCategoryOutput
if *v == nil {
sv = &DeleteCallAnalyticsCategoryOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteCallAnalyticsJobOutput(v **DeleteCallAnalyticsJobOutput, 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 *DeleteCallAnalyticsJobOutput
if *v == nil {
sv = &DeleteCallAnalyticsJobOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeLanguageModelOutput(v **DescribeLanguageModelOutput, 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 *DescribeLanguageModelOutput
if *v == nil {
sv = &DescribeLanguageModelOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LanguageModel":
if err := awsAwsjson11_deserializeDocumentLanguageModel(&sv.LanguageModel, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetCallAnalyticsCategoryOutput(v **GetCallAnalyticsCategoryOutput, 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 *GetCallAnalyticsCategoryOutput
if *v == nil {
sv = &GetCallAnalyticsCategoryOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CategoryProperties":
if err := awsAwsjson11_deserializeDocumentCategoryProperties(&sv.CategoryProperties, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetCallAnalyticsJobOutput(v **GetCallAnalyticsJobOutput, 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 *GetCallAnalyticsJobOutput
if *v == nil {
sv = &GetCallAnalyticsJobOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CallAnalyticsJob":
if err := awsAwsjson11_deserializeDocumentCallAnalyticsJob(&sv.CallAnalyticsJob, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetMedicalTranscriptionJobOutput(v **GetMedicalTranscriptionJobOutput, 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 *GetMedicalTranscriptionJobOutput
if *v == nil {
sv = &GetMedicalTranscriptionJobOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MedicalTranscriptionJob":
if err := awsAwsjson11_deserializeDocumentMedicalTranscriptionJob(&sv.MedicalTranscriptionJob, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetMedicalVocabularyOutput(v **GetMedicalVocabularyOutput, 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 *GetMedicalVocabularyOutput
if *v == nil {
sv = &GetMedicalVocabularyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DownloadUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uri to be of type string, got %T instead", value)
}
sv.DownloadUri = ptr.String(jtv)
}
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
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 "VocabularyState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VocabularyState to be of type string, got %T instead", value)
}
sv.VocabularyState = types.VocabularyState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetTranscriptionJobOutput(v **GetTranscriptionJobOutput, 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 *GetTranscriptionJobOutput
if *v == nil {
sv = &GetTranscriptionJobOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "TranscriptionJob":
if err := awsAwsjson11_deserializeDocumentTranscriptionJob(&sv.TranscriptionJob, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetVocabularyFilterOutput(v **GetVocabularyFilterOutput, 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 *GetVocabularyFilterOutput
if *v == nil {
sv = &GetVocabularyFilterOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DownloadUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uri to be of type string, got %T instead", value)
}
sv.DownloadUri = ptr.String(jtv)
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetVocabularyOutput(v **GetVocabularyOutput, 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 *GetVocabularyOutput
if *v == nil {
sv = &GetVocabularyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DownloadUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Uri to be of type string, got %T instead", value)
}
sv.DownloadUri = ptr.String(jtv)
}
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
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 "VocabularyState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VocabularyState to be of type string, got %T instead", value)
}
sv.VocabularyState = types.VocabularyState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListCallAnalyticsCategoriesOutput(v **ListCallAnalyticsCategoriesOutput, 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 *ListCallAnalyticsCategoriesOutput
if *v == nil {
sv = &ListCallAnalyticsCategoriesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Categories":
if err := awsAwsjson11_deserializeDocumentCategoryPropertiesList(&sv.Categories, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListCallAnalyticsJobsOutput(v **ListCallAnalyticsJobsOutput, 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 *ListCallAnalyticsJobsOutput
if *v == nil {
sv = &ListCallAnalyticsJobsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CallAnalyticsJobSummaries":
if err := awsAwsjson11_deserializeDocumentCallAnalyticsJobSummaries(&sv.CallAnalyticsJobSummaries, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CallAnalyticsJobStatus to be of type string, got %T instead", value)
}
sv.Status = types.CallAnalyticsJobStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListLanguageModelsOutput(v **ListLanguageModelsOutput, 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 *ListLanguageModelsOutput
if *v == nil {
sv = &ListLanguageModelsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Models":
if err := awsAwsjson11_deserializeDocumentModels(&sv.Models, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListMedicalTranscriptionJobsOutput(v **ListMedicalTranscriptionJobsOutput, 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 *ListMedicalTranscriptionJobsOutput
if *v == nil {
sv = &ListMedicalTranscriptionJobsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MedicalTranscriptionJobSummaries":
if err := awsAwsjson11_deserializeDocumentMedicalTranscriptionJobSummaries(&sv.MedicalTranscriptionJobSummaries, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscriptionJobStatus to be of type string, got %T instead", value)
}
sv.Status = types.TranscriptionJobStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListMedicalVocabulariesOutput(v **ListMedicalVocabulariesOutput, 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 *ListMedicalVocabulariesOutput
if *v == nil {
sv = &ListMedicalVocabulariesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VocabularyState to be of type string, got %T instead", value)
}
sv.Status = types.VocabularyState(jtv)
}
case "Vocabularies":
if err := awsAwsjson11_deserializeDocumentVocabularies(&sv.Vocabularies, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscribeArn to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTranscriptionJobsOutput(v **ListTranscriptionJobsOutput, 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 *ListTranscriptionJobsOutput
if *v == nil {
sv = &ListTranscriptionJobsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TranscriptionJobStatus to be of type string, got %T instead", value)
}
sv.Status = types.TranscriptionJobStatus(jtv)
}
case "TranscriptionJobSummaries":
if err := awsAwsjson11_deserializeDocumentTranscriptionJobSummaries(&sv.TranscriptionJobSummaries, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListVocabulariesOutput(v **ListVocabulariesOutput, 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 *ListVocabulariesOutput
if *v == nil {
sv = &ListVocabulariesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VocabularyState to be of type string, got %T instead", value)
}
sv.Status = types.VocabularyState(jtv)
}
case "Vocabularies":
if err := awsAwsjson11_deserializeDocumentVocabularies(&sv.Vocabularies, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListVocabularyFiltersOutput(v **ListVocabularyFiltersOutput, 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 *ListVocabularyFiltersOutput
if *v == nil {
sv = &ListVocabularyFiltersOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "VocabularyFilters":
if err := awsAwsjson11_deserializeDocumentVocabularyFilters(&sv.VocabularyFilters, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentStartCallAnalyticsJobOutput(v **StartCallAnalyticsJobOutput, 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 *StartCallAnalyticsJobOutput
if *v == nil {
sv = &StartCallAnalyticsJobOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CallAnalyticsJob":
if err := awsAwsjson11_deserializeDocumentCallAnalyticsJob(&sv.CallAnalyticsJob, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentStartMedicalTranscriptionJobOutput(v **StartMedicalTranscriptionJobOutput, 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 *StartMedicalTranscriptionJobOutput
if *v == nil {
sv = &StartMedicalTranscriptionJobOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MedicalTranscriptionJob":
if err := awsAwsjson11_deserializeDocumentMedicalTranscriptionJob(&sv.MedicalTranscriptionJob, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentStartTranscriptionJobOutput(v **StartTranscriptionJobOutput, 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 *StartTranscriptionJobOutput
if *v == nil {
sv = &StartTranscriptionJobOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "TranscriptionJob":
if err := awsAwsjson11_deserializeDocumentTranscriptionJob(&sv.TranscriptionJob, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *TagResourceOutput
if *v == nil {
sv = &TagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UntagResourceOutput
if *v == nil {
sv = &UntagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateCallAnalyticsCategoryOutput(v **UpdateCallAnalyticsCategoryOutput, 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 *UpdateCallAnalyticsCategoryOutput
if *v == nil {
sv = &UpdateCallAnalyticsCategoryOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CategoryProperties":
if err := awsAwsjson11_deserializeDocumentCategoryProperties(&sv.CategoryProperties, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateMedicalVocabularyOutput(v **UpdateMedicalVocabularyOutput, 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 *UpdateMedicalVocabularyOutput
if *v == nil {
sv = &UpdateMedicalVocabularyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
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 "VocabularyState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VocabularyState to be of type string, got %T instead", value)
}
sv.VocabularyState = types.VocabularyState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateVocabularyFilterOutput(v **UpdateVocabularyFilterOutput, 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 *UpdateVocabularyFilterOutput
if *v == nil {
sv = &UpdateVocabularyFilterOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateVocabularyOutput(v **UpdateVocabularyOutput, 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 *UpdateVocabularyOutput
if *v == nil {
sv = &UpdateVocabularyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
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 "VocabularyState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VocabularyState to be of type string, got %T instead", value)
}
sv.VocabularyState = types.VocabularyState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 10,109 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package transcribe provides the API client, operations, and parameter types for
// Amazon Transcribe Service.
//
// Amazon Transcribe offers three main types of batch transcription: Standard,
// Medical, and Call Analytics.
// - Standard transcriptions are the most common option. Refer to for details.
// - Medical transcriptions are tailored to medical professionals and
// incorporate medical terms. A common use case for this service is transcribing
// doctor-patient dialogue into after-visit notes. Refer to for details.
// - Call Analytics transcriptions are designed for use with call center audio
// on two different channels; if you're looking for insight into customer service
// calls, use this option. Refer to for details.
package transcribe
| 16 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/transcribe/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "transcribe"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
return next.HandleSerialize(ctx, in)
}
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package transcribe
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.26.8"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"path"
)
type awsAwsjson11_serializeOpCreateCallAnalyticsCategory struct {
}
func (*awsAwsjson11_serializeOpCreateCallAnalyticsCategory) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateCallAnalyticsCategory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateCallAnalyticsCategoryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.CreateCallAnalyticsCategory")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateCallAnalyticsCategoryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateLanguageModel struct {
}
func (*awsAwsjson11_serializeOpCreateLanguageModel) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateLanguageModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateLanguageModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.CreateLanguageModel")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateLanguageModelInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateMedicalVocabulary struct {
}
func (*awsAwsjson11_serializeOpCreateMedicalVocabulary) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateMedicalVocabulary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateMedicalVocabularyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.CreateMedicalVocabulary")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateMedicalVocabularyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateVocabulary struct {
}
func (*awsAwsjson11_serializeOpCreateVocabulary) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateVocabulary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateVocabularyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.CreateVocabulary")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateVocabularyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateVocabularyFilter struct {
}
func (*awsAwsjson11_serializeOpCreateVocabularyFilter) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateVocabularyFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateVocabularyFilterInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.CreateVocabularyFilter")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateVocabularyFilterInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteCallAnalyticsCategory struct {
}
func (*awsAwsjson11_serializeOpDeleteCallAnalyticsCategory) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteCallAnalyticsCategory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteCallAnalyticsCategoryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.DeleteCallAnalyticsCategory")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteCallAnalyticsCategoryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteCallAnalyticsJob struct {
}
func (*awsAwsjson11_serializeOpDeleteCallAnalyticsJob) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteCallAnalyticsJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteCallAnalyticsJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.DeleteCallAnalyticsJob")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteCallAnalyticsJobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteLanguageModel struct {
}
func (*awsAwsjson11_serializeOpDeleteLanguageModel) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteLanguageModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteLanguageModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.DeleteLanguageModel")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteLanguageModelInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteMedicalTranscriptionJob struct {
}
func (*awsAwsjson11_serializeOpDeleteMedicalTranscriptionJob) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteMedicalTranscriptionJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteMedicalTranscriptionJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.DeleteMedicalTranscriptionJob")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteMedicalTranscriptionJobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteMedicalVocabulary struct {
}
func (*awsAwsjson11_serializeOpDeleteMedicalVocabulary) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteMedicalVocabulary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteMedicalVocabularyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.DeleteMedicalVocabulary")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteMedicalVocabularyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteTranscriptionJob struct {
}
func (*awsAwsjson11_serializeOpDeleteTranscriptionJob) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteTranscriptionJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteTranscriptionJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.DeleteTranscriptionJob")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteTranscriptionJobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteVocabulary struct {
}
func (*awsAwsjson11_serializeOpDeleteVocabulary) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteVocabulary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteVocabularyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.DeleteVocabulary")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteVocabularyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteVocabularyFilter struct {
}
func (*awsAwsjson11_serializeOpDeleteVocabularyFilter) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteVocabularyFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteVocabularyFilterInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.DeleteVocabularyFilter")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteVocabularyFilterInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeLanguageModel struct {
}
func (*awsAwsjson11_serializeOpDescribeLanguageModel) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeLanguageModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeLanguageModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.DescribeLanguageModel")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeLanguageModelInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetCallAnalyticsCategory struct {
}
func (*awsAwsjson11_serializeOpGetCallAnalyticsCategory) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetCallAnalyticsCategory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetCallAnalyticsCategoryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.GetCallAnalyticsCategory")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetCallAnalyticsCategoryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetCallAnalyticsJob struct {
}
func (*awsAwsjson11_serializeOpGetCallAnalyticsJob) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetCallAnalyticsJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetCallAnalyticsJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.GetCallAnalyticsJob")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetCallAnalyticsJobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetMedicalTranscriptionJob struct {
}
func (*awsAwsjson11_serializeOpGetMedicalTranscriptionJob) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetMedicalTranscriptionJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetMedicalTranscriptionJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.GetMedicalTranscriptionJob")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetMedicalTranscriptionJobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetMedicalVocabulary struct {
}
func (*awsAwsjson11_serializeOpGetMedicalVocabulary) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetMedicalVocabulary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetMedicalVocabularyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.GetMedicalVocabulary")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetMedicalVocabularyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetTranscriptionJob struct {
}
func (*awsAwsjson11_serializeOpGetTranscriptionJob) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetTranscriptionJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetTranscriptionJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.GetTranscriptionJob")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetTranscriptionJobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetVocabulary struct {
}
func (*awsAwsjson11_serializeOpGetVocabulary) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetVocabulary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetVocabularyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.GetVocabulary")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetVocabularyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetVocabularyFilter struct {
}
func (*awsAwsjson11_serializeOpGetVocabularyFilter) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetVocabularyFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetVocabularyFilterInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.GetVocabularyFilter")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetVocabularyFilterInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListCallAnalyticsCategories struct {
}
func (*awsAwsjson11_serializeOpListCallAnalyticsCategories) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListCallAnalyticsCategories) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListCallAnalyticsCategoriesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.ListCallAnalyticsCategories")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListCallAnalyticsCategoriesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListCallAnalyticsJobs struct {
}
func (*awsAwsjson11_serializeOpListCallAnalyticsJobs) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListCallAnalyticsJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListCallAnalyticsJobsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.ListCallAnalyticsJobs")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListCallAnalyticsJobsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListLanguageModels struct {
}
func (*awsAwsjson11_serializeOpListLanguageModels) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListLanguageModels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListLanguageModelsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.ListLanguageModels")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListLanguageModelsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListMedicalTranscriptionJobs struct {
}
func (*awsAwsjson11_serializeOpListMedicalTranscriptionJobs) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListMedicalTranscriptionJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListMedicalTranscriptionJobsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.ListMedicalTranscriptionJobs")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListMedicalTranscriptionJobsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListMedicalVocabularies struct {
}
func (*awsAwsjson11_serializeOpListMedicalVocabularies) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListMedicalVocabularies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListMedicalVocabulariesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.ListMedicalVocabularies")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListMedicalVocabulariesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTagsForResource struct {
}
func (*awsAwsjson11_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.ListTagsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTranscriptionJobs struct {
}
func (*awsAwsjson11_serializeOpListTranscriptionJobs) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTranscriptionJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTranscriptionJobsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.ListTranscriptionJobs")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTranscriptionJobsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListVocabularies struct {
}
func (*awsAwsjson11_serializeOpListVocabularies) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListVocabularies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListVocabulariesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.ListVocabularies")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListVocabulariesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListVocabularyFilters struct {
}
func (*awsAwsjson11_serializeOpListVocabularyFilters) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListVocabularyFilters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListVocabularyFiltersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.ListVocabularyFilters")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListVocabularyFiltersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStartCallAnalyticsJob struct {
}
func (*awsAwsjson11_serializeOpStartCallAnalyticsJob) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartCallAnalyticsJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartCallAnalyticsJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.StartCallAnalyticsJob")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartCallAnalyticsJobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStartMedicalTranscriptionJob struct {
}
func (*awsAwsjson11_serializeOpStartMedicalTranscriptionJob) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartMedicalTranscriptionJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartMedicalTranscriptionJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.StartMedicalTranscriptionJob")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartMedicalTranscriptionJobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStartTranscriptionJob struct {
}
func (*awsAwsjson11_serializeOpStartTranscriptionJob) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartTranscriptionJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartTranscriptionJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.StartTranscriptionJob")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartTranscriptionJobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpTagResource struct {
}
func (*awsAwsjson11_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.TagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUntagResource struct {
}
func (*awsAwsjson11_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.UntagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateCallAnalyticsCategory struct {
}
func (*awsAwsjson11_serializeOpUpdateCallAnalyticsCategory) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateCallAnalyticsCategory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateCallAnalyticsCategoryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.UpdateCallAnalyticsCategory")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateCallAnalyticsCategoryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateMedicalVocabulary struct {
}
func (*awsAwsjson11_serializeOpUpdateMedicalVocabulary) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateMedicalVocabulary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateMedicalVocabularyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.UpdateMedicalVocabulary")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateMedicalVocabularyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateVocabulary struct {
}
func (*awsAwsjson11_serializeOpUpdateVocabulary) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateVocabulary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateVocabularyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.UpdateVocabulary")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateVocabularyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateVocabularyFilter struct {
}
func (*awsAwsjson11_serializeOpUpdateVocabularyFilter) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateVocabularyFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateVocabularyFilterInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Transcribe.UpdateVocabularyFilter")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateVocabularyFilterInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsAwsjson11_serializeDocumentAbsoluteTimeRange(v *types.AbsoluteTimeRange, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTime != nil {
ok := object.Key("EndTime")
ok.Long(*v.EndTime)
}
if v.First != nil {
ok := object.Key("First")
ok.Long(*v.First)
}
if v.Last != nil {
ok := object.Key("Last")
ok.Long(*v.Last)
}
if v.StartTime != nil {
ok := object.Key("StartTime")
ok.Long(*v.StartTime)
}
return nil
}
func awsAwsjson11_serializeDocumentCallAnalyticsJobSettings(v *types.CallAnalyticsJobSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContentRedaction != nil {
ok := object.Key("ContentRedaction")
if err := awsAwsjson11_serializeDocumentContentRedaction(v.ContentRedaction, ok); err != nil {
return err
}
}
if v.LanguageIdSettings != nil {
ok := object.Key("LanguageIdSettings")
if err := awsAwsjson11_serializeDocumentLanguageIdSettingsMap(v.LanguageIdSettings, ok); err != nil {
return err
}
}
if v.LanguageModelName != nil {
ok := object.Key("LanguageModelName")
ok.String(*v.LanguageModelName)
}
if v.LanguageOptions != nil {
ok := object.Key("LanguageOptions")
if err := awsAwsjson11_serializeDocumentLanguageOptions(v.LanguageOptions, ok); err != nil {
return err
}
}
if len(v.VocabularyFilterMethod) > 0 {
ok := object.Key("VocabularyFilterMethod")
ok.String(string(v.VocabularyFilterMethod))
}
if v.VocabularyFilterName != nil {
ok := object.Key("VocabularyFilterName")
ok.String(*v.VocabularyFilterName)
}
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
func awsAwsjson11_serializeDocumentChannelDefinition(v *types.ChannelDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChannelId != 0 {
ok := object.Key("ChannelId")
ok.Integer(v.ChannelId)
}
if len(v.ParticipantRole) > 0 {
ok := object.Key("ParticipantRole")
ok.String(string(v.ParticipantRole))
}
return nil
}
func awsAwsjson11_serializeDocumentChannelDefinitions(v []types.ChannelDefinition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentChannelDefinition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentContentRedaction(v *types.ContentRedaction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PiiEntityTypes != nil {
ok := object.Key("PiiEntityTypes")
if err := awsAwsjson11_serializeDocumentPiiEntityTypes(v.PiiEntityTypes, ok); err != nil {
return err
}
}
if len(v.RedactionOutput) > 0 {
ok := object.Key("RedactionOutput")
ok.String(string(v.RedactionOutput))
}
if len(v.RedactionType) > 0 {
ok := object.Key("RedactionType")
ok.String(string(v.RedactionType))
}
return nil
}
func awsAwsjson11_serializeDocumentInputDataConfig(v *types.InputDataConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DataAccessRoleArn != nil {
ok := object.Key("DataAccessRoleArn")
ok.String(*v.DataAccessRoleArn)
}
if v.S3Uri != nil {
ok := object.Key("S3Uri")
ok.String(*v.S3Uri)
}
if v.TuningDataS3Uri != nil {
ok := object.Key("TuningDataS3Uri")
ok.String(*v.TuningDataS3Uri)
}
return nil
}
func awsAwsjson11_serializeDocumentInterruptionFilter(v *types.InterruptionFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AbsoluteTimeRange != nil {
ok := object.Key("AbsoluteTimeRange")
if err := awsAwsjson11_serializeDocumentAbsoluteTimeRange(v.AbsoluteTimeRange, ok); err != nil {
return err
}
}
if v.Negate != nil {
ok := object.Key("Negate")
ok.Boolean(*v.Negate)
}
if len(v.ParticipantRole) > 0 {
ok := object.Key("ParticipantRole")
ok.String(string(v.ParticipantRole))
}
if v.RelativeTimeRange != nil {
ok := object.Key("RelativeTimeRange")
if err := awsAwsjson11_serializeDocumentRelativeTimeRange(v.RelativeTimeRange, ok); err != nil {
return err
}
}
if v.Threshold != nil {
ok := object.Key("Threshold")
ok.Long(*v.Threshold)
}
return nil
}
func awsAwsjson11_serializeDocumentJobExecutionSettings(v *types.JobExecutionSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowDeferredExecution != nil {
ok := object.Key("AllowDeferredExecution")
ok.Boolean(*v.AllowDeferredExecution)
}
if v.DataAccessRoleArn != nil {
ok := object.Key("DataAccessRoleArn")
ok.String(*v.DataAccessRoleArn)
}
return nil
}
func awsAwsjson11_serializeDocumentKMSEncryptionContextMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsAwsjson11_serializeDocumentLanguageIdSettings(v *types.LanguageIdSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LanguageModelName != nil {
ok := object.Key("LanguageModelName")
ok.String(*v.LanguageModelName)
}
if v.VocabularyFilterName != nil {
ok := object.Key("VocabularyFilterName")
ok.String(*v.VocabularyFilterName)
}
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
func awsAwsjson11_serializeDocumentLanguageIdSettingsMap(v map[string]types.LanguageIdSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsAwsjson11_serializeDocumentLanguageIdSettings(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentLanguageOptions(v []types.LanguageCode, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentMedia(v *types.Media, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MediaFileUri != nil {
ok := object.Key("MediaFileUri")
ok.String(*v.MediaFileUri)
}
if v.RedactedMediaFileUri != nil {
ok := object.Key("RedactedMediaFileUri")
ok.String(*v.RedactedMediaFileUri)
}
return nil
}
func awsAwsjson11_serializeDocumentMedicalTranscriptionSetting(v *types.MedicalTranscriptionSetting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChannelIdentification != nil {
ok := object.Key("ChannelIdentification")
ok.Boolean(*v.ChannelIdentification)
}
if v.MaxAlternatives != nil {
ok := object.Key("MaxAlternatives")
ok.Integer(*v.MaxAlternatives)
}
if v.MaxSpeakerLabels != nil {
ok := object.Key("MaxSpeakerLabels")
ok.Integer(*v.MaxSpeakerLabels)
}
if v.ShowAlternatives != nil {
ok := object.Key("ShowAlternatives")
ok.Boolean(*v.ShowAlternatives)
}
if v.ShowSpeakerLabels != nil {
ok := object.Key("ShowSpeakerLabels")
ok.Boolean(*v.ShowSpeakerLabels)
}
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
func awsAwsjson11_serializeDocumentModelSettings(v *types.ModelSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LanguageModelName != nil {
ok := object.Key("LanguageModelName")
ok.String(*v.LanguageModelName)
}
return nil
}
func awsAwsjson11_serializeDocumentNonTalkTimeFilter(v *types.NonTalkTimeFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AbsoluteTimeRange != nil {
ok := object.Key("AbsoluteTimeRange")
if err := awsAwsjson11_serializeDocumentAbsoluteTimeRange(v.AbsoluteTimeRange, ok); err != nil {
return err
}
}
if v.Negate != nil {
ok := object.Key("Negate")
ok.Boolean(*v.Negate)
}
if v.RelativeTimeRange != nil {
ok := object.Key("RelativeTimeRange")
if err := awsAwsjson11_serializeDocumentRelativeTimeRange(v.RelativeTimeRange, ok); err != nil {
return err
}
}
if v.Threshold != nil {
ok := object.Key("Threshold")
ok.Long(*v.Threshold)
}
return nil
}
func awsAwsjson11_serializeDocumentPhrases(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentPiiEntityTypes(v []types.PiiEntityType, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentRelativeTimeRange(v *types.RelativeTimeRange, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndPercentage != nil {
ok := object.Key("EndPercentage")
ok.Integer(*v.EndPercentage)
}
if v.First != nil {
ok := object.Key("First")
ok.Integer(*v.First)
}
if v.Last != nil {
ok := object.Key("Last")
ok.Integer(*v.Last)
}
if v.StartPercentage != nil {
ok := object.Key("StartPercentage")
ok.Integer(*v.StartPercentage)
}
return nil
}
func awsAwsjson11_serializeDocumentRule(v types.Rule, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
switch uv := v.(type) {
case *types.RuleMemberInterruptionFilter:
av := object.Key("InterruptionFilter")
if err := awsAwsjson11_serializeDocumentInterruptionFilter(&uv.Value, av); err != nil {
return err
}
case *types.RuleMemberNonTalkTimeFilter:
av := object.Key("NonTalkTimeFilter")
if err := awsAwsjson11_serializeDocumentNonTalkTimeFilter(&uv.Value, av); err != nil {
return err
}
case *types.RuleMemberSentimentFilter:
av := object.Key("SentimentFilter")
if err := awsAwsjson11_serializeDocumentSentimentFilter(&uv.Value, av); err != nil {
return err
}
case *types.RuleMemberTranscriptFilter:
av := object.Key("TranscriptFilter")
if err := awsAwsjson11_serializeDocumentTranscriptFilter(&uv.Value, av); err != nil {
return err
}
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsAwsjson11_serializeDocumentRuleList(v []types.Rule, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if vv := v[i]; vv == nil {
continue
}
if err := awsAwsjson11_serializeDocumentRule(v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSentimentFilter(v *types.SentimentFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AbsoluteTimeRange != nil {
ok := object.Key("AbsoluteTimeRange")
if err := awsAwsjson11_serializeDocumentAbsoluteTimeRange(v.AbsoluteTimeRange, ok); err != nil {
return err
}
}
if v.Negate != nil {
ok := object.Key("Negate")
ok.Boolean(*v.Negate)
}
if len(v.ParticipantRole) > 0 {
ok := object.Key("ParticipantRole")
ok.String(string(v.ParticipantRole))
}
if v.RelativeTimeRange != nil {
ok := object.Key("RelativeTimeRange")
if err := awsAwsjson11_serializeDocumentRelativeTimeRange(v.RelativeTimeRange, ok); err != nil {
return err
}
}
if v.Sentiments != nil {
ok := object.Key("Sentiments")
if err := awsAwsjson11_serializeDocumentSentimentValueList(v.Sentiments, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSentimentValueList(v []types.SentimentValue, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentSettings(v *types.Settings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChannelIdentification != nil {
ok := object.Key("ChannelIdentification")
ok.Boolean(*v.ChannelIdentification)
}
if v.MaxAlternatives != nil {
ok := object.Key("MaxAlternatives")
ok.Integer(*v.MaxAlternatives)
}
if v.MaxSpeakerLabels != nil {
ok := object.Key("MaxSpeakerLabels")
ok.Integer(*v.MaxSpeakerLabels)
}
if v.ShowAlternatives != nil {
ok := object.Key("ShowAlternatives")
ok.Boolean(*v.ShowAlternatives)
}
if v.ShowSpeakerLabels != nil {
ok := object.Key("ShowSpeakerLabels")
ok.Boolean(*v.ShowSpeakerLabels)
}
if len(v.VocabularyFilterMethod) > 0 {
ok := object.Key("VocabularyFilterMethod")
ok.String(string(v.VocabularyFilterMethod))
}
if v.VocabularyFilterName != nil {
ok := object.Key("VocabularyFilterName")
ok.String(*v.VocabularyFilterName)
}
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
func awsAwsjson11_serializeDocumentStringTargetList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentSubtitleFormats(v []types.SubtitleFormat, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentSubtitles(v *types.Subtitles, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Formats != nil {
ok := object.Key("Formats")
if err := awsAwsjson11_serializeDocumentSubtitleFormats(v.Formats, ok); err != nil {
return err
}
}
if v.OutputStartIndex != nil {
ok := object.Key("OutputStartIndex")
ok.Integer(*v.OutputStartIndex)
}
return nil
}
func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Key != nil {
ok := object.Key("Key")
ok.String(*v.Key)
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentTranscriptFilter(v *types.TranscriptFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AbsoluteTimeRange != nil {
ok := object.Key("AbsoluteTimeRange")
if err := awsAwsjson11_serializeDocumentAbsoluteTimeRange(v.AbsoluteTimeRange, ok); err != nil {
return err
}
}
if v.Negate != nil {
ok := object.Key("Negate")
ok.Boolean(*v.Negate)
}
if len(v.ParticipantRole) > 0 {
ok := object.Key("ParticipantRole")
ok.String(string(v.ParticipantRole))
}
if v.RelativeTimeRange != nil {
ok := object.Key("RelativeTimeRange")
if err := awsAwsjson11_serializeDocumentRelativeTimeRange(v.RelativeTimeRange, ok); err != nil {
return err
}
}
if v.Targets != nil {
ok := object.Key("Targets")
if err := awsAwsjson11_serializeDocumentStringTargetList(v.Targets, ok); err != nil {
return err
}
}
if len(v.TranscriptFilterType) > 0 {
ok := object.Key("TranscriptFilterType")
ok.String(string(v.TranscriptFilterType))
}
return nil
}
func awsAwsjson11_serializeDocumentWords(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateCallAnalyticsCategoryInput(v *CreateCallAnalyticsCategoryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CategoryName != nil {
ok := object.Key("CategoryName")
ok.String(*v.CategoryName)
}
if len(v.InputType) > 0 {
ok := object.Key("InputType")
ok.String(string(v.InputType))
}
if v.Rules != nil {
ok := object.Key("Rules")
if err := awsAwsjson11_serializeDocumentRuleList(v.Rules, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateLanguageModelInput(v *CreateLanguageModelInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.BaseModelName) > 0 {
ok := object.Key("BaseModelName")
ok.String(string(v.BaseModelName))
}
if v.InputDataConfig != nil {
ok := object.Key("InputDataConfig")
if err := awsAwsjson11_serializeDocumentInputDataConfig(v.InputDataConfig, ok); err != nil {
return err
}
}
if len(v.LanguageCode) > 0 {
ok := object.Key("LanguageCode")
ok.String(string(v.LanguageCode))
}
if v.ModelName != nil {
ok := object.Key("ModelName")
ok.String(*v.ModelName)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateMedicalVocabularyInput(v *CreateMedicalVocabularyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.LanguageCode) > 0 {
ok := object.Key("LanguageCode")
ok.String(string(v.LanguageCode))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.VocabularyFileUri != nil {
ok := object.Key("VocabularyFileUri")
ok.String(*v.VocabularyFileUri)
}
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateVocabularyFilterInput(v *CreateVocabularyFilterInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DataAccessRoleArn != nil {
ok := object.Key("DataAccessRoleArn")
ok.String(*v.DataAccessRoleArn)
}
if len(v.LanguageCode) > 0 {
ok := object.Key("LanguageCode")
ok.String(string(v.LanguageCode))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.VocabularyFilterFileUri != nil {
ok := object.Key("VocabularyFilterFileUri")
ok.String(*v.VocabularyFilterFileUri)
}
if v.VocabularyFilterName != nil {
ok := object.Key("VocabularyFilterName")
ok.String(*v.VocabularyFilterName)
}
if v.Words != nil {
ok := object.Key("Words")
if err := awsAwsjson11_serializeDocumentWords(v.Words, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateVocabularyInput(v *CreateVocabularyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DataAccessRoleArn != nil {
ok := object.Key("DataAccessRoleArn")
ok.String(*v.DataAccessRoleArn)
}
if len(v.LanguageCode) > 0 {
ok := object.Key("LanguageCode")
ok.String(string(v.LanguageCode))
}
if v.Phrases != nil {
ok := object.Key("Phrases")
if err := awsAwsjson11_serializeDocumentPhrases(v.Phrases, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.VocabularyFileUri != nil {
ok := object.Key("VocabularyFileUri")
ok.String(*v.VocabularyFileUri)
}
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteCallAnalyticsCategoryInput(v *DeleteCallAnalyticsCategoryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CategoryName != nil {
ok := object.Key("CategoryName")
ok.String(*v.CategoryName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteCallAnalyticsJobInput(v *DeleteCallAnalyticsJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CallAnalyticsJobName != nil {
ok := object.Key("CallAnalyticsJobName")
ok.String(*v.CallAnalyticsJobName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteLanguageModelInput(v *DeleteLanguageModelInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ModelName != nil {
ok := object.Key("ModelName")
ok.String(*v.ModelName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteMedicalTranscriptionJobInput(v *DeleteMedicalTranscriptionJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MedicalTranscriptionJobName != nil {
ok := object.Key("MedicalTranscriptionJobName")
ok.String(*v.MedicalTranscriptionJobName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteMedicalVocabularyInput(v *DeleteMedicalVocabularyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteTranscriptionJobInput(v *DeleteTranscriptionJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TranscriptionJobName != nil {
ok := object.Key("TranscriptionJobName")
ok.String(*v.TranscriptionJobName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteVocabularyFilterInput(v *DeleteVocabularyFilterInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VocabularyFilterName != nil {
ok := object.Key("VocabularyFilterName")
ok.String(*v.VocabularyFilterName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteVocabularyInput(v *DeleteVocabularyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeLanguageModelInput(v *DescribeLanguageModelInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ModelName != nil {
ok := object.Key("ModelName")
ok.String(*v.ModelName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetCallAnalyticsCategoryInput(v *GetCallAnalyticsCategoryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CategoryName != nil {
ok := object.Key("CategoryName")
ok.String(*v.CategoryName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetCallAnalyticsJobInput(v *GetCallAnalyticsJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CallAnalyticsJobName != nil {
ok := object.Key("CallAnalyticsJobName")
ok.String(*v.CallAnalyticsJobName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetMedicalTranscriptionJobInput(v *GetMedicalTranscriptionJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MedicalTranscriptionJobName != nil {
ok := object.Key("MedicalTranscriptionJobName")
ok.String(*v.MedicalTranscriptionJobName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetMedicalVocabularyInput(v *GetMedicalVocabularyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetTranscriptionJobInput(v *GetTranscriptionJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TranscriptionJobName != nil {
ok := object.Key("TranscriptionJobName")
ok.String(*v.TranscriptionJobName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetVocabularyFilterInput(v *GetVocabularyFilterInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VocabularyFilterName != nil {
ok := object.Key("VocabularyFilterName")
ok.String(*v.VocabularyFilterName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetVocabularyInput(v *GetVocabularyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListCallAnalyticsCategoriesInput(v *ListCallAnalyticsCategoriesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListCallAnalyticsJobsInput(v *ListCallAnalyticsJobsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobNameContains != nil {
ok := object.Key("JobNameContains")
ok.String(*v.JobNameContains)
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if len(v.Status) > 0 {
ok := object.Key("Status")
ok.String(string(v.Status))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListLanguageModelsInput(v *ListLanguageModelsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NameContains != nil {
ok := object.Key("NameContains")
ok.String(*v.NameContains)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if len(v.StatusEquals) > 0 {
ok := object.Key("StatusEquals")
ok.String(string(v.StatusEquals))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListMedicalTranscriptionJobsInput(v *ListMedicalTranscriptionJobsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobNameContains != nil {
ok := object.Key("JobNameContains")
ok.String(*v.JobNameContains)
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if len(v.Status) > 0 {
ok := object.Key("Status")
ok.String(string(v.Status))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListMedicalVocabulariesInput(v *ListMedicalVocabulariesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NameContains != nil {
ok := object.Key("NameContains")
ok.String(*v.NameContains)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if len(v.StateEquals) > 0 {
ok := object.Key("StateEquals")
ok.String(string(v.StateEquals))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTranscriptionJobsInput(v *ListTranscriptionJobsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobNameContains != nil {
ok := object.Key("JobNameContains")
ok.String(*v.JobNameContains)
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if len(v.Status) > 0 {
ok := object.Key("Status")
ok.String(string(v.Status))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListVocabulariesInput(v *ListVocabulariesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NameContains != nil {
ok := object.Key("NameContains")
ok.String(*v.NameContains)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if len(v.StateEquals) > 0 {
ok := object.Key("StateEquals")
ok.String(string(v.StateEquals))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListVocabularyFiltersInput(v *ListVocabularyFiltersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NameContains != nil {
ok := object.Key("NameContains")
ok.String(*v.NameContains)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartCallAnalyticsJobInput(v *StartCallAnalyticsJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CallAnalyticsJobName != nil {
ok := object.Key("CallAnalyticsJobName")
ok.String(*v.CallAnalyticsJobName)
}
if v.ChannelDefinitions != nil {
ok := object.Key("ChannelDefinitions")
if err := awsAwsjson11_serializeDocumentChannelDefinitions(v.ChannelDefinitions, ok); err != nil {
return err
}
}
if v.DataAccessRoleArn != nil {
ok := object.Key("DataAccessRoleArn")
ok.String(*v.DataAccessRoleArn)
}
if v.Media != nil {
ok := object.Key("Media")
if err := awsAwsjson11_serializeDocumentMedia(v.Media, ok); err != nil {
return err
}
}
if v.OutputEncryptionKMSKeyId != nil {
ok := object.Key("OutputEncryptionKMSKeyId")
ok.String(*v.OutputEncryptionKMSKeyId)
}
if v.OutputLocation != nil {
ok := object.Key("OutputLocation")
ok.String(*v.OutputLocation)
}
if v.Settings != nil {
ok := object.Key("Settings")
if err := awsAwsjson11_serializeDocumentCallAnalyticsJobSettings(v.Settings, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartMedicalTranscriptionJobInput(v *StartMedicalTranscriptionJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ContentIdentificationType) > 0 {
ok := object.Key("ContentIdentificationType")
ok.String(string(v.ContentIdentificationType))
}
if v.KMSEncryptionContext != nil {
ok := object.Key("KMSEncryptionContext")
if err := awsAwsjson11_serializeDocumentKMSEncryptionContextMap(v.KMSEncryptionContext, ok); err != nil {
return err
}
}
if len(v.LanguageCode) > 0 {
ok := object.Key("LanguageCode")
ok.String(string(v.LanguageCode))
}
if v.Media != nil {
ok := object.Key("Media")
if err := awsAwsjson11_serializeDocumentMedia(v.Media, ok); err != nil {
return err
}
}
if len(v.MediaFormat) > 0 {
ok := object.Key("MediaFormat")
ok.String(string(v.MediaFormat))
}
if v.MediaSampleRateHertz != nil {
ok := object.Key("MediaSampleRateHertz")
ok.Integer(*v.MediaSampleRateHertz)
}
if v.MedicalTranscriptionJobName != nil {
ok := object.Key("MedicalTranscriptionJobName")
ok.String(*v.MedicalTranscriptionJobName)
}
if v.OutputBucketName != nil {
ok := object.Key("OutputBucketName")
ok.String(*v.OutputBucketName)
}
if v.OutputEncryptionKMSKeyId != nil {
ok := object.Key("OutputEncryptionKMSKeyId")
ok.String(*v.OutputEncryptionKMSKeyId)
}
if v.OutputKey != nil {
ok := object.Key("OutputKey")
ok.String(*v.OutputKey)
}
if v.Settings != nil {
ok := object.Key("Settings")
if err := awsAwsjson11_serializeDocumentMedicalTranscriptionSetting(v.Settings, ok); err != nil {
return err
}
}
if len(v.Specialty) > 0 {
ok := object.Key("Specialty")
ok.String(string(v.Specialty))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartTranscriptionJobInput(v *StartTranscriptionJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContentRedaction != nil {
ok := object.Key("ContentRedaction")
if err := awsAwsjson11_serializeDocumentContentRedaction(v.ContentRedaction, ok); err != nil {
return err
}
}
if v.IdentifyLanguage != nil {
ok := object.Key("IdentifyLanguage")
ok.Boolean(*v.IdentifyLanguage)
}
if v.IdentifyMultipleLanguages != nil {
ok := object.Key("IdentifyMultipleLanguages")
ok.Boolean(*v.IdentifyMultipleLanguages)
}
if v.JobExecutionSettings != nil {
ok := object.Key("JobExecutionSettings")
if err := awsAwsjson11_serializeDocumentJobExecutionSettings(v.JobExecutionSettings, ok); err != nil {
return err
}
}
if v.KMSEncryptionContext != nil {
ok := object.Key("KMSEncryptionContext")
if err := awsAwsjson11_serializeDocumentKMSEncryptionContextMap(v.KMSEncryptionContext, ok); err != nil {
return err
}
}
if len(v.LanguageCode) > 0 {
ok := object.Key("LanguageCode")
ok.String(string(v.LanguageCode))
}
if v.LanguageIdSettings != nil {
ok := object.Key("LanguageIdSettings")
if err := awsAwsjson11_serializeDocumentLanguageIdSettingsMap(v.LanguageIdSettings, ok); err != nil {
return err
}
}
if v.LanguageOptions != nil {
ok := object.Key("LanguageOptions")
if err := awsAwsjson11_serializeDocumentLanguageOptions(v.LanguageOptions, ok); err != nil {
return err
}
}
if v.Media != nil {
ok := object.Key("Media")
if err := awsAwsjson11_serializeDocumentMedia(v.Media, ok); err != nil {
return err
}
}
if len(v.MediaFormat) > 0 {
ok := object.Key("MediaFormat")
ok.String(string(v.MediaFormat))
}
if v.MediaSampleRateHertz != nil {
ok := object.Key("MediaSampleRateHertz")
ok.Integer(*v.MediaSampleRateHertz)
}
if v.ModelSettings != nil {
ok := object.Key("ModelSettings")
if err := awsAwsjson11_serializeDocumentModelSettings(v.ModelSettings, ok); err != nil {
return err
}
}
if v.OutputBucketName != nil {
ok := object.Key("OutputBucketName")
ok.String(*v.OutputBucketName)
}
if v.OutputEncryptionKMSKeyId != nil {
ok := object.Key("OutputEncryptionKMSKeyId")
ok.String(*v.OutputEncryptionKMSKeyId)
}
if v.OutputKey != nil {
ok := object.Key("OutputKey")
ok.String(*v.OutputKey)
}
if v.Settings != nil {
ok := object.Key("Settings")
if err := awsAwsjson11_serializeDocumentSettings(v.Settings, ok); err != nil {
return err
}
}
if v.Subtitles != nil {
ok := object.Key("Subtitles")
if err := awsAwsjson11_serializeDocumentSubtitles(v.Subtitles, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.TranscriptionJobName != nil {
ok := object.Key("TranscriptionJobName")
ok.String(*v.TranscriptionJobName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateCallAnalyticsCategoryInput(v *UpdateCallAnalyticsCategoryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CategoryName != nil {
ok := object.Key("CategoryName")
ok.String(*v.CategoryName)
}
if len(v.InputType) > 0 {
ok := object.Key("InputType")
ok.String(string(v.InputType))
}
if v.Rules != nil {
ok := object.Key("Rules")
if err := awsAwsjson11_serializeDocumentRuleList(v.Rules, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateMedicalVocabularyInput(v *UpdateMedicalVocabularyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.LanguageCode) > 0 {
ok := object.Key("LanguageCode")
ok.String(string(v.LanguageCode))
}
if v.VocabularyFileUri != nil {
ok := object.Key("VocabularyFileUri")
ok.String(*v.VocabularyFileUri)
}
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateVocabularyFilterInput(v *UpdateVocabularyFilterInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DataAccessRoleArn != nil {
ok := object.Key("DataAccessRoleArn")
ok.String(*v.DataAccessRoleArn)
}
if v.VocabularyFilterFileUri != nil {
ok := object.Key("VocabularyFilterFileUri")
ok.String(*v.VocabularyFilterFileUri)
}
if v.VocabularyFilterName != nil {
ok := object.Key("VocabularyFilterName")
ok.String(*v.VocabularyFilterName)
}
if v.Words != nil {
ok := object.Key("Words")
if err := awsAwsjson11_serializeDocumentWords(v.Words, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateVocabularyInput(v *UpdateVocabularyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DataAccessRoleArn != nil {
ok := object.Key("DataAccessRoleArn")
ok.String(*v.DataAccessRoleArn)
}
if len(v.LanguageCode) > 0 {
ok := object.Key("LanguageCode")
ok.String(string(v.LanguageCode))
}
if v.Phrases != nil {
ok := object.Key("Phrases")
if err := awsAwsjson11_serializeDocumentPhrases(v.Phrases, ok); err != nil {
return err
}
}
if v.VocabularyFileUri != nil {
ok := object.Key("VocabularyFileUri")
ok.String(*v.VocabularyFileUri)
}
if v.VocabularyName != nil {
ok := object.Key("VocabularyName")
ok.String(*v.VocabularyName)
}
return nil
}
| 3,831 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribe
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateCallAnalyticsCategory struct {
}
func (*validateOpCreateCallAnalyticsCategory) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateCallAnalyticsCategory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateCallAnalyticsCategoryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateCallAnalyticsCategoryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateLanguageModel struct {
}
func (*validateOpCreateLanguageModel) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateLanguageModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateLanguageModelInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateLanguageModelInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateMedicalVocabulary struct {
}
func (*validateOpCreateMedicalVocabulary) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateMedicalVocabulary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateMedicalVocabularyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateMedicalVocabularyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateVocabularyFilter struct {
}
func (*validateOpCreateVocabularyFilter) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateVocabularyFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateVocabularyFilterInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateVocabularyFilterInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateVocabulary struct {
}
func (*validateOpCreateVocabulary) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateVocabulary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateVocabularyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateVocabularyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteCallAnalyticsCategory struct {
}
func (*validateOpDeleteCallAnalyticsCategory) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteCallAnalyticsCategory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteCallAnalyticsCategoryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteCallAnalyticsCategoryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteCallAnalyticsJob struct {
}
func (*validateOpDeleteCallAnalyticsJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteCallAnalyticsJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteCallAnalyticsJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteCallAnalyticsJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteLanguageModel struct {
}
func (*validateOpDeleteLanguageModel) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteLanguageModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteLanguageModelInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteLanguageModelInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteMedicalTranscriptionJob struct {
}
func (*validateOpDeleteMedicalTranscriptionJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteMedicalTranscriptionJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteMedicalTranscriptionJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteMedicalTranscriptionJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteMedicalVocabulary struct {
}
func (*validateOpDeleteMedicalVocabulary) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteMedicalVocabulary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteMedicalVocabularyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteMedicalVocabularyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteTranscriptionJob struct {
}
func (*validateOpDeleteTranscriptionJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteTranscriptionJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteTranscriptionJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteTranscriptionJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteVocabularyFilter struct {
}
func (*validateOpDeleteVocabularyFilter) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteVocabularyFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteVocabularyFilterInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteVocabularyFilterInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteVocabulary struct {
}
func (*validateOpDeleteVocabulary) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteVocabulary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteVocabularyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteVocabularyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeLanguageModel struct {
}
func (*validateOpDescribeLanguageModel) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeLanguageModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeLanguageModelInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeLanguageModelInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetCallAnalyticsCategory struct {
}
func (*validateOpGetCallAnalyticsCategory) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetCallAnalyticsCategory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetCallAnalyticsCategoryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetCallAnalyticsCategoryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetCallAnalyticsJob struct {
}
func (*validateOpGetCallAnalyticsJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetCallAnalyticsJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetCallAnalyticsJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetCallAnalyticsJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMedicalTranscriptionJob struct {
}
func (*validateOpGetMedicalTranscriptionJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMedicalTranscriptionJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMedicalTranscriptionJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMedicalTranscriptionJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMedicalVocabulary struct {
}
func (*validateOpGetMedicalVocabulary) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMedicalVocabulary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMedicalVocabularyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMedicalVocabularyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetTranscriptionJob struct {
}
func (*validateOpGetTranscriptionJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetTranscriptionJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetTranscriptionJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetTranscriptionJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetVocabularyFilter struct {
}
func (*validateOpGetVocabularyFilter) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetVocabularyFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetVocabularyFilterInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetVocabularyFilterInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetVocabulary struct {
}
func (*validateOpGetVocabulary) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetVocabulary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetVocabularyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetVocabularyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTagsForResource struct {
}
func (*validateOpListTagsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTagsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTagsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartCallAnalyticsJob struct {
}
func (*validateOpStartCallAnalyticsJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartCallAnalyticsJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartCallAnalyticsJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartCallAnalyticsJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartMedicalTranscriptionJob struct {
}
func (*validateOpStartMedicalTranscriptionJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartMedicalTranscriptionJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartMedicalTranscriptionJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartMedicalTranscriptionJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartTranscriptionJob struct {
}
func (*validateOpStartTranscriptionJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartTranscriptionJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartTranscriptionJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartTranscriptionJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagResource struct {
}
func (*validateOpTagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagResource struct {
}
func (*validateOpUntagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateCallAnalyticsCategory struct {
}
func (*validateOpUpdateCallAnalyticsCategory) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateCallAnalyticsCategory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateCallAnalyticsCategoryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateCallAnalyticsCategoryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateMedicalVocabulary struct {
}
func (*validateOpUpdateMedicalVocabulary) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateMedicalVocabulary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateMedicalVocabularyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateMedicalVocabularyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateVocabularyFilter struct {
}
func (*validateOpUpdateVocabularyFilter) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateVocabularyFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateVocabularyFilterInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateVocabularyFilterInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateVocabulary struct {
}
func (*validateOpUpdateVocabulary) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateVocabulary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateVocabularyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateVocabularyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCreateCallAnalyticsCategoryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateCallAnalyticsCategory{}, middleware.After)
}
func addOpCreateLanguageModelValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateLanguageModel{}, middleware.After)
}
func addOpCreateMedicalVocabularyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateMedicalVocabulary{}, middleware.After)
}
func addOpCreateVocabularyFilterValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateVocabularyFilter{}, middleware.After)
}
func addOpCreateVocabularyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateVocabulary{}, middleware.After)
}
func addOpDeleteCallAnalyticsCategoryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteCallAnalyticsCategory{}, middleware.After)
}
func addOpDeleteCallAnalyticsJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteCallAnalyticsJob{}, middleware.After)
}
func addOpDeleteLanguageModelValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteLanguageModel{}, middleware.After)
}
func addOpDeleteMedicalTranscriptionJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteMedicalTranscriptionJob{}, middleware.After)
}
func addOpDeleteMedicalVocabularyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteMedicalVocabulary{}, middleware.After)
}
func addOpDeleteTranscriptionJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteTranscriptionJob{}, middleware.After)
}
func addOpDeleteVocabularyFilterValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteVocabularyFilter{}, middleware.After)
}
func addOpDeleteVocabularyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteVocabulary{}, middleware.After)
}
func addOpDescribeLanguageModelValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeLanguageModel{}, middleware.After)
}
func addOpGetCallAnalyticsCategoryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetCallAnalyticsCategory{}, middleware.After)
}
func addOpGetCallAnalyticsJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetCallAnalyticsJob{}, middleware.After)
}
func addOpGetMedicalTranscriptionJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMedicalTranscriptionJob{}, middleware.After)
}
func addOpGetMedicalVocabularyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMedicalVocabulary{}, middleware.After)
}
func addOpGetTranscriptionJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetTranscriptionJob{}, middleware.After)
}
func addOpGetVocabularyFilterValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetVocabularyFilter{}, middleware.After)
}
func addOpGetVocabularyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetVocabulary{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpStartCallAnalyticsJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartCallAnalyticsJob{}, middleware.After)
}
func addOpStartMedicalTranscriptionJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartMedicalTranscriptionJob{}, middleware.After)
}
func addOpStartTranscriptionJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartTranscriptionJob{}, middleware.After)
}
func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTagResource{}, middleware.After)
}
func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)
}
func addOpUpdateCallAnalyticsCategoryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateCallAnalyticsCategory{}, middleware.After)
}
func addOpUpdateMedicalVocabularyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateMedicalVocabulary{}, middleware.After)
}
func addOpUpdateVocabularyFilterValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateVocabularyFilter{}, middleware.After)
}
func addOpUpdateVocabularyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateVocabulary{}, middleware.After)
}
func validateCallAnalyticsJobSettings(v *types.CallAnalyticsJobSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CallAnalyticsJobSettings"}
if v.ContentRedaction != nil {
if err := validateContentRedaction(v.ContentRedaction); err != nil {
invalidParams.AddNested("ContentRedaction", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateContentRedaction(v *types.ContentRedaction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ContentRedaction"}
if len(v.RedactionType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("RedactionType"))
}
if len(v.RedactionOutput) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("RedactionOutput"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputDataConfig(v *types.InputDataConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputDataConfig"}
if v.S3Uri == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Uri"))
}
if v.DataAccessRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DataAccessRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRule(v types.Rule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Rule"}
switch uv := v.(type) {
case *types.RuleMemberSentimentFilter:
if err := validateSentimentFilter(&uv.Value); err != nil {
invalidParams.AddNested("[SentimentFilter]", err.(smithy.InvalidParamsError))
}
case *types.RuleMemberTranscriptFilter:
if err := validateTranscriptFilter(&uv.Value); err != nil {
invalidParams.AddNested("[TranscriptFilter]", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuleList(v []types.Rule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuleList"}
for i := range v {
if err := validateRule(v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSentimentFilter(v *types.SentimentFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SentimentFilter"}
if v.Sentiments == nil {
invalidParams.Add(smithy.NewErrParamRequired("Sentiments"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTag(v *types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tag"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTagList(v []types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagList"}
for i := range v {
if err := validateTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTranscriptFilter(v *types.TranscriptFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TranscriptFilter"}
if len(v.TranscriptFilterType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("TranscriptFilterType"))
}
if v.Targets == nil {
invalidParams.Add(smithy.NewErrParamRequired("Targets"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateCallAnalyticsCategoryInput(v *CreateCallAnalyticsCategoryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCallAnalyticsCategoryInput"}
if v.CategoryName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CategoryName"))
}
if v.Rules == nil {
invalidParams.Add(smithy.NewErrParamRequired("Rules"))
} else if v.Rules != nil {
if err := validateRuleList(v.Rules); err != nil {
invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateLanguageModelInput(v *CreateLanguageModelInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateLanguageModelInput"}
if len(v.LanguageCode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("LanguageCode"))
}
if len(v.BaseModelName) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("BaseModelName"))
}
if v.ModelName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ModelName"))
}
if v.InputDataConfig == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputDataConfig"))
} else if v.InputDataConfig != nil {
if err := validateInputDataConfig(v.InputDataConfig); err != nil {
invalidParams.AddNested("InputDataConfig", err.(smithy.InvalidParamsError))
}
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateMedicalVocabularyInput(v *CreateMedicalVocabularyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateMedicalVocabularyInput"}
if v.VocabularyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyName"))
}
if len(v.LanguageCode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("LanguageCode"))
}
if v.VocabularyFileUri == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyFileUri"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateVocabularyFilterInput(v *CreateVocabularyFilterInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateVocabularyFilterInput"}
if v.VocabularyFilterName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyFilterName"))
}
if len(v.LanguageCode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("LanguageCode"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateVocabularyInput(v *CreateVocabularyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateVocabularyInput"}
if v.VocabularyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyName"))
}
if len(v.LanguageCode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("LanguageCode"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteCallAnalyticsCategoryInput(v *DeleteCallAnalyticsCategoryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteCallAnalyticsCategoryInput"}
if v.CategoryName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CategoryName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteCallAnalyticsJobInput(v *DeleteCallAnalyticsJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteCallAnalyticsJobInput"}
if v.CallAnalyticsJobName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CallAnalyticsJobName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteLanguageModelInput(v *DeleteLanguageModelInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteLanguageModelInput"}
if v.ModelName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ModelName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteMedicalTranscriptionJobInput(v *DeleteMedicalTranscriptionJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteMedicalTranscriptionJobInput"}
if v.MedicalTranscriptionJobName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MedicalTranscriptionJobName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteMedicalVocabularyInput(v *DeleteMedicalVocabularyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteMedicalVocabularyInput"}
if v.VocabularyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteTranscriptionJobInput(v *DeleteTranscriptionJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteTranscriptionJobInput"}
if v.TranscriptionJobName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TranscriptionJobName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteVocabularyFilterInput(v *DeleteVocabularyFilterInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteVocabularyFilterInput"}
if v.VocabularyFilterName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyFilterName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteVocabularyInput(v *DeleteVocabularyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteVocabularyInput"}
if v.VocabularyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeLanguageModelInput(v *DescribeLanguageModelInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeLanguageModelInput"}
if v.ModelName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ModelName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetCallAnalyticsCategoryInput(v *GetCallAnalyticsCategoryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetCallAnalyticsCategoryInput"}
if v.CategoryName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CategoryName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetCallAnalyticsJobInput(v *GetCallAnalyticsJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetCallAnalyticsJobInput"}
if v.CallAnalyticsJobName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CallAnalyticsJobName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMedicalTranscriptionJobInput(v *GetMedicalTranscriptionJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMedicalTranscriptionJobInput"}
if v.MedicalTranscriptionJobName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MedicalTranscriptionJobName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMedicalVocabularyInput(v *GetMedicalVocabularyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMedicalVocabularyInput"}
if v.VocabularyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetTranscriptionJobInput(v *GetTranscriptionJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetTranscriptionJobInput"}
if v.TranscriptionJobName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TranscriptionJobName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetVocabularyFilterInput(v *GetVocabularyFilterInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetVocabularyFilterInput"}
if v.VocabularyFilterName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyFilterName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetVocabularyInput(v *GetVocabularyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetVocabularyInput"}
if v.VocabularyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartCallAnalyticsJobInput(v *StartCallAnalyticsJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartCallAnalyticsJobInput"}
if v.CallAnalyticsJobName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CallAnalyticsJobName"))
}
if v.Media == nil {
invalidParams.Add(smithy.NewErrParamRequired("Media"))
}
if v.Settings != nil {
if err := validateCallAnalyticsJobSettings(v.Settings); err != nil {
invalidParams.AddNested("Settings", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartMedicalTranscriptionJobInput(v *StartMedicalTranscriptionJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartMedicalTranscriptionJobInput"}
if v.MedicalTranscriptionJobName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MedicalTranscriptionJobName"))
}
if len(v.LanguageCode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("LanguageCode"))
}
if v.Media == nil {
invalidParams.Add(smithy.NewErrParamRequired("Media"))
}
if v.OutputBucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("OutputBucketName"))
}
if len(v.Specialty) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Specialty"))
}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartTranscriptionJobInput(v *StartTranscriptionJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartTranscriptionJobInput"}
if v.TranscriptionJobName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TranscriptionJobName"))
}
if v.Media == nil {
invalidParams.Add(smithy.NewErrParamRequired("Media"))
}
if v.ContentRedaction != nil {
if err := validateContentRedaction(v.ContentRedaction); err != nil {
invalidParams.AddNested("ContentRedaction", err.(smithy.InvalidParamsError))
}
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
} else if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateCallAnalyticsCategoryInput(v *UpdateCallAnalyticsCategoryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateCallAnalyticsCategoryInput"}
if v.CategoryName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CategoryName"))
}
if v.Rules == nil {
invalidParams.Add(smithy.NewErrParamRequired("Rules"))
} else if v.Rules != nil {
if err := validateRuleList(v.Rules); err != nil {
invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateMedicalVocabularyInput(v *UpdateMedicalVocabularyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateMedicalVocabularyInput"}
if v.VocabularyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyName"))
}
if len(v.LanguageCode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("LanguageCode"))
}
if v.VocabularyFileUri == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyFileUri"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateVocabularyFilterInput(v *UpdateVocabularyFilterInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateVocabularyFilterInput"}
if v.VocabularyFilterName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyFilterName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateVocabularyInput(v *UpdateVocabularyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateVocabularyInput"}
if v.VocabularyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VocabularyName"))
}
if len(v.LanguageCode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("LanguageCode"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 1,502 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver Transcribe endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "transcribe.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fips.transcribe.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "transcribe-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribe.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fips.transcribe.ca-central-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "fips-ca-central-1",
}: endpoints.Endpoint{
Hostname: "fips.transcribe.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "fips.transcribe.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-2",
}: endpoints.Endpoint{
Hostname: "fips.transcribe.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-1",
}: endpoints.Endpoint{
Hostname: "fips.transcribe.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-2",
}: endpoints.Endpoint{
Hostname: "fips.transcribe.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fips.transcribe.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fips.transcribe.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fips.transcribe.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fips.transcribe.us-west-2.amazonaws.com",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "transcribe.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribe-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "transcribe-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribe.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{
Hostname: "cn.transcribe.cn-north-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-north-1",
},
},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{
Hostname: "cn.transcribe.cn-northwest-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-northwest-1",
},
},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribe-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribe.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-iso-east-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribe-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribe.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribe-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribe.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribe-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribe.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "transcribe.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fips.transcribe.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "transcribe-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribe.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "fips.transcribe.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "fips.transcribe.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fips.transcribe.us-gov-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fips.transcribe.us-gov-west-1.amazonaws.com",
},
},
},
}
| 492 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type BaseModelName string
// Enum values for BaseModelName
const (
BaseModelNameNarrowBand BaseModelName = "NarrowBand"
BaseModelNameWideBand BaseModelName = "WideBand"
)
// Values returns all known values for BaseModelName. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (BaseModelName) Values() []BaseModelName {
return []BaseModelName{
"NarrowBand",
"WideBand",
}
}
type CallAnalyticsJobStatus string
// Enum values for CallAnalyticsJobStatus
const (
CallAnalyticsJobStatusQueued CallAnalyticsJobStatus = "QUEUED"
CallAnalyticsJobStatusInProgress CallAnalyticsJobStatus = "IN_PROGRESS"
CallAnalyticsJobStatusFailed CallAnalyticsJobStatus = "FAILED"
CallAnalyticsJobStatusCompleted CallAnalyticsJobStatus = "COMPLETED"
)
// Values returns all known values for CallAnalyticsJobStatus. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (CallAnalyticsJobStatus) Values() []CallAnalyticsJobStatus {
return []CallAnalyticsJobStatus{
"QUEUED",
"IN_PROGRESS",
"FAILED",
"COMPLETED",
}
}
type CLMLanguageCode string
// Enum values for CLMLanguageCode
const (
CLMLanguageCodeEnUs CLMLanguageCode = "en-US"
CLMLanguageCodeHiIn CLMLanguageCode = "hi-IN"
CLMLanguageCodeEsUs CLMLanguageCode = "es-US"
CLMLanguageCodeEnGb CLMLanguageCode = "en-GB"
CLMLanguageCodeEnAu CLMLanguageCode = "en-AU"
CLMLanguageCodeDeDe CLMLanguageCode = "de-DE"
CLMLanguageCodeJaJp CLMLanguageCode = "ja-JP"
)
// Values returns all known values for CLMLanguageCode. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (CLMLanguageCode) Values() []CLMLanguageCode {
return []CLMLanguageCode{
"en-US",
"hi-IN",
"es-US",
"en-GB",
"en-AU",
"de-DE",
"ja-JP",
}
}
type InputType string
// Enum values for InputType
const (
InputTypeRealTime InputType = "REAL_TIME"
InputTypePostCall InputType = "POST_CALL"
)
// Values returns all known values for InputType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (InputType) Values() []InputType {
return []InputType{
"REAL_TIME",
"POST_CALL",
}
}
type LanguageCode string
// Enum values for LanguageCode
const (
LanguageCodeAfZa LanguageCode = "af-ZA"
LanguageCodeArAe LanguageCode = "ar-AE"
LanguageCodeArSa LanguageCode = "ar-SA"
LanguageCodeDaDk LanguageCode = "da-DK"
LanguageCodeDeCh LanguageCode = "de-CH"
LanguageCodeDeDe LanguageCode = "de-DE"
LanguageCodeEnAb LanguageCode = "en-AB"
LanguageCodeEnAu LanguageCode = "en-AU"
LanguageCodeEnGb LanguageCode = "en-GB"
LanguageCodeEnIe LanguageCode = "en-IE"
LanguageCodeEnIn LanguageCode = "en-IN"
LanguageCodeEnUs LanguageCode = "en-US"
LanguageCodeEnWl LanguageCode = "en-WL"
LanguageCodeEsEs LanguageCode = "es-ES"
LanguageCodeEsUs LanguageCode = "es-US"
LanguageCodeFaIr LanguageCode = "fa-IR"
LanguageCodeFrCa LanguageCode = "fr-CA"
LanguageCodeFrFr LanguageCode = "fr-FR"
LanguageCodeHeIl LanguageCode = "he-IL"
LanguageCodeHiIn LanguageCode = "hi-IN"
LanguageCodeIdId LanguageCode = "id-ID"
LanguageCodeItIt LanguageCode = "it-IT"
LanguageCodeJaJp LanguageCode = "ja-JP"
LanguageCodeKoKr LanguageCode = "ko-KR"
LanguageCodeMsMy LanguageCode = "ms-MY"
LanguageCodeNlNl LanguageCode = "nl-NL"
LanguageCodePtBr LanguageCode = "pt-BR"
LanguageCodePtPt LanguageCode = "pt-PT"
LanguageCodeRuRu LanguageCode = "ru-RU"
LanguageCodeTaIn LanguageCode = "ta-IN"
LanguageCodeTeIn LanguageCode = "te-IN"
LanguageCodeTrTr LanguageCode = "tr-TR"
LanguageCodeZhCn LanguageCode = "zh-CN"
LanguageCodeZhTw LanguageCode = "zh-TW"
LanguageCodeThTh LanguageCode = "th-TH"
LanguageCodeEnZa LanguageCode = "en-ZA"
LanguageCodeEnNz LanguageCode = "en-NZ"
LanguageCodeViVn LanguageCode = "vi-VN"
LanguageCodeSvSe LanguageCode = "sv-SE"
)
// Values returns all known values for LanguageCode. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (LanguageCode) Values() []LanguageCode {
return []LanguageCode{
"af-ZA",
"ar-AE",
"ar-SA",
"da-DK",
"de-CH",
"de-DE",
"en-AB",
"en-AU",
"en-GB",
"en-IE",
"en-IN",
"en-US",
"en-WL",
"es-ES",
"es-US",
"fa-IR",
"fr-CA",
"fr-FR",
"he-IL",
"hi-IN",
"id-ID",
"it-IT",
"ja-JP",
"ko-KR",
"ms-MY",
"nl-NL",
"pt-BR",
"pt-PT",
"ru-RU",
"ta-IN",
"te-IN",
"tr-TR",
"zh-CN",
"zh-TW",
"th-TH",
"en-ZA",
"en-NZ",
"vi-VN",
"sv-SE",
}
}
type MediaFormat string
// Enum values for MediaFormat
const (
MediaFormatMp3 MediaFormat = "mp3"
MediaFormatMp4 MediaFormat = "mp4"
MediaFormatWav MediaFormat = "wav"
MediaFormatFlac MediaFormat = "flac"
MediaFormatOgg MediaFormat = "ogg"
MediaFormatAmr MediaFormat = "amr"
MediaFormatWebm MediaFormat = "webm"
)
// Values returns all known values for MediaFormat. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (MediaFormat) Values() []MediaFormat {
return []MediaFormat{
"mp3",
"mp4",
"wav",
"flac",
"ogg",
"amr",
"webm",
}
}
type MedicalContentIdentificationType string
// Enum values for MedicalContentIdentificationType
const (
MedicalContentIdentificationTypePhi MedicalContentIdentificationType = "PHI"
)
// Values returns all known values for MedicalContentIdentificationType. Note that
// this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (MedicalContentIdentificationType) Values() []MedicalContentIdentificationType {
return []MedicalContentIdentificationType{
"PHI",
}
}
type ModelStatus string
// Enum values for ModelStatus
const (
ModelStatusInProgress ModelStatus = "IN_PROGRESS"
ModelStatusFailed ModelStatus = "FAILED"
ModelStatusCompleted ModelStatus = "COMPLETED"
)
// Values returns all known values for ModelStatus. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (ModelStatus) Values() []ModelStatus {
return []ModelStatus{
"IN_PROGRESS",
"FAILED",
"COMPLETED",
}
}
type OutputLocationType string
// Enum values for OutputLocationType
const (
OutputLocationTypeCustomerBucket OutputLocationType = "CUSTOMER_BUCKET"
OutputLocationTypeServiceBucket OutputLocationType = "SERVICE_BUCKET"
)
// Values returns all known values for OutputLocationType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (OutputLocationType) Values() []OutputLocationType {
return []OutputLocationType{
"CUSTOMER_BUCKET",
"SERVICE_BUCKET",
}
}
type ParticipantRole string
// Enum values for ParticipantRole
const (
ParticipantRoleAgent ParticipantRole = "AGENT"
ParticipantRoleCustomer ParticipantRole = "CUSTOMER"
)
// Values returns all known values for ParticipantRole. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ParticipantRole) Values() []ParticipantRole {
return []ParticipantRole{
"AGENT",
"CUSTOMER",
}
}
type PiiEntityType string
// Enum values for PiiEntityType
const (
PiiEntityTypeBankAccountNumber PiiEntityType = "BANK_ACCOUNT_NUMBER"
PiiEntityTypeBankRouting PiiEntityType = "BANK_ROUTING"
PiiEntityTypeCreditDebitNumber PiiEntityType = "CREDIT_DEBIT_NUMBER"
PiiEntityTypeCreditDebitCvv PiiEntityType = "CREDIT_DEBIT_CVV"
PiiEntityTypeCreditDebitExpiry PiiEntityType = "CREDIT_DEBIT_EXPIRY"
PiiEntityTypePin PiiEntityType = "PIN"
PiiEntityTypeEmail PiiEntityType = "EMAIL"
PiiEntityTypeAddress PiiEntityType = "ADDRESS"
PiiEntityTypeName PiiEntityType = "NAME"
PiiEntityTypePhone PiiEntityType = "PHONE"
PiiEntityTypeSsn PiiEntityType = "SSN"
PiiEntityTypeAll PiiEntityType = "ALL"
)
// Values returns all known values for PiiEntityType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (PiiEntityType) Values() []PiiEntityType {
return []PiiEntityType{
"BANK_ACCOUNT_NUMBER",
"BANK_ROUTING",
"CREDIT_DEBIT_NUMBER",
"CREDIT_DEBIT_CVV",
"CREDIT_DEBIT_EXPIRY",
"PIN",
"EMAIL",
"ADDRESS",
"NAME",
"PHONE",
"SSN",
"ALL",
}
}
type RedactionOutput string
// Enum values for RedactionOutput
const (
RedactionOutputRedacted RedactionOutput = "redacted"
RedactionOutputRedactedAndUnredacted RedactionOutput = "redacted_and_unredacted"
)
// Values returns all known values for RedactionOutput. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (RedactionOutput) Values() []RedactionOutput {
return []RedactionOutput{
"redacted",
"redacted_and_unredacted",
}
}
type RedactionType string
// Enum values for RedactionType
const (
RedactionTypePii RedactionType = "PII"
)
// Values returns all known values for RedactionType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (RedactionType) Values() []RedactionType {
return []RedactionType{
"PII",
}
}
type SentimentValue string
// Enum values for SentimentValue
const (
SentimentValuePositive SentimentValue = "POSITIVE"
SentimentValueNegative SentimentValue = "NEGATIVE"
SentimentValueNeutral SentimentValue = "NEUTRAL"
SentimentValueMixed SentimentValue = "MIXED"
)
// Values returns all known values for SentimentValue. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SentimentValue) Values() []SentimentValue {
return []SentimentValue{
"POSITIVE",
"NEGATIVE",
"NEUTRAL",
"MIXED",
}
}
type Specialty string
// Enum values for Specialty
const (
SpecialtyPrimarycare Specialty = "PRIMARYCARE"
)
// Values returns all known values for Specialty. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (Specialty) Values() []Specialty {
return []Specialty{
"PRIMARYCARE",
}
}
type SubtitleFormat string
// Enum values for SubtitleFormat
const (
SubtitleFormatVtt SubtitleFormat = "vtt"
SubtitleFormatSrt SubtitleFormat = "srt"
)
// Values returns all known values for SubtitleFormat. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SubtitleFormat) Values() []SubtitleFormat {
return []SubtitleFormat{
"vtt",
"srt",
}
}
type TranscriptFilterType string
// Enum values for TranscriptFilterType
const (
TranscriptFilterTypeExact TranscriptFilterType = "EXACT"
)
// Values returns all known values for TranscriptFilterType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TranscriptFilterType) Values() []TranscriptFilterType {
return []TranscriptFilterType{
"EXACT",
}
}
type TranscriptionJobStatus string
// Enum values for TranscriptionJobStatus
const (
TranscriptionJobStatusQueued TranscriptionJobStatus = "QUEUED"
TranscriptionJobStatusInProgress TranscriptionJobStatus = "IN_PROGRESS"
TranscriptionJobStatusFailed TranscriptionJobStatus = "FAILED"
TranscriptionJobStatusCompleted TranscriptionJobStatus = "COMPLETED"
)
// Values returns all known values for TranscriptionJobStatus. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TranscriptionJobStatus) Values() []TranscriptionJobStatus {
return []TranscriptionJobStatus{
"QUEUED",
"IN_PROGRESS",
"FAILED",
"COMPLETED",
}
}
type Type string
// Enum values for Type
const (
TypeConversation Type = "CONVERSATION"
TypeDictation Type = "DICTATION"
)
// Values returns all known values for Type. Note that this can be expanded in the
// future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (Type) Values() []Type {
return []Type{
"CONVERSATION",
"DICTATION",
}
}
type VocabularyFilterMethod string
// Enum values for VocabularyFilterMethod
const (
VocabularyFilterMethodRemove VocabularyFilterMethod = "remove"
VocabularyFilterMethodMask VocabularyFilterMethod = "mask"
VocabularyFilterMethodTag VocabularyFilterMethod = "tag"
)
// Values returns all known values for VocabularyFilterMethod. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (VocabularyFilterMethod) Values() []VocabularyFilterMethod {
return []VocabularyFilterMethod{
"remove",
"mask",
"tag",
}
}
type VocabularyState string
// Enum values for VocabularyState
const (
VocabularyStatePending VocabularyState = "PENDING"
VocabularyStateReady VocabularyState = "READY"
VocabularyStateFailed VocabularyState = "FAILED"
)
// Values returns all known values for VocabularyState. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (VocabularyState) Values() []VocabularyState {
return []VocabularyState{
"PENDING",
"READY",
"FAILED",
}
}
| 507 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// Your request didn't pass one or more validation tests. This can occur when the
// entity you're trying to delete doesn't exist or if it's in a non-terminal state
// (such as IN PROGRESS ). See the exception message field for more information.
type BadRequestException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *BadRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *BadRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *BadRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "BadRequestException"
}
return *e.ErrorCodeOverride
}
func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// A resource already exists with this name. Resource names must be unique within
// an Amazon Web Services account.
type ConflictException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// There was an internal error. Check the error message, correct the issue, and
// try your request again.
type InternalFailureException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalFailureException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalFailureException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalFailureException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalFailureException"
}
return *e.ErrorCodeOverride
}
func (e *InternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// You've either sent too many requests or your input file is too long. Wait
// before retrying your request, or use a smaller file and try your request again.
type LimitExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *LimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// We can't find the requested resource. Check that the specified name is correct
// and try your request again.
type NotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *NotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *NotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *NotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "NotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 145 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// A time range, in milliseconds, between two points in your media file. You can
// use StartTime and EndTime to search a custom segment. For example, setting
// StartTime to 10000 and EndTime to 50000 only searches for your specified
// criteria in the audio contained between the 10,000 millisecond mark and the
// 50,000 millisecond mark of your media file. You must use StartTime and EndTime
// as a set; that is, if you include one, you must include both. You can use also
// First to search from the start of the audio until the time that you specify, or
// Last to search from the time that you specify until the end of the audio. For
// example, setting First to 50000 only searches for your specified criteria in
// the audio contained between the start of the media file to the 50,000
// millisecond mark. You can use First and Last independently of each other. If
// you prefer to use percentage instead of milliseconds, see .
type AbsoluteTimeRange struct {
// The time, in milliseconds, when Amazon Transcribe stops searching for the
// specified criteria in your audio. If you include EndTime in your request, you
// must also include StartTime .
EndTime *int64
// The time, in milliseconds, from the start of your media file until the
// specified value. Amazon Transcribe searches for your specified criteria in this
// time segment.
First *int64
// The time, in milliseconds, from the specified value until the end of your media
// file. Amazon Transcribe searches for your specified criteria in this time
// segment.
Last *int64
// The time, in milliseconds, when Amazon Transcribe starts searching for the
// specified criteria in your audio. If you include StartTime in your request, you
// must also include EndTime .
StartTime *int64
noSmithyDocumentSerde
}
// Provides detailed information about a Call Analytics job. To view the job's
// status, refer to CallAnalyticsJobStatus . If the status is COMPLETED , the job
// is finished. You can find your completed transcript at the URI specified in
// TranscriptFileUri . If the status is FAILED , FailureReason provides details on
// why your transcription job failed. If you enabled personally identifiable
// information (PII) redaction, the redacted transcript appears at the location
// specified in RedactedTranscriptFileUri . If you chose to redact the audio in
// your media file, you can find your redacted media file at the location specified
// in the RedactedMediaFileUri field of your response.
type CallAnalyticsJob struct {
// The name of the Call Analytics job. Job names are case sensitive and must be
// unique within an Amazon Web Services account.
CallAnalyticsJobName *string
// Provides the status of the specified Call Analytics job. If the status is
// COMPLETED , the job is finished and you can find the results at the location
// specified in TranscriptFileUri (or RedactedTranscriptFileUri , if you requested
// transcript redaction). If the status is FAILED , FailureReason provides details
// on why your transcription job failed.
CallAnalyticsJobStatus CallAnalyticsJobStatus
// Indicates which speaker is on which channel.
ChannelDefinitions []ChannelDefinition
// The date and time the specified Call Analytics job finished processing.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:33:13.922000-07:00 represents a transcription job that started
// processing at 12:33 PM UTC-7 on May 4, 2022.
CompletionTime *time.Time
// The date and time the specified Call Analytics job request was made. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
CreationTime *time.Time
// The Amazon Resource Name (ARN) you included in your request.
DataAccessRoleArn *string
// If CallAnalyticsJobStatus is FAILED , FailureReason contains information about
// why the Call Analytics job request failed. The FailureReason field contains one
// of the following values:
// - Unsupported media format . The media format specified in MediaFormat isn't
// valid. Refer to MediaFormat for a list of supported formats.
// - The media format provided does not match the detected media format . The
// media format specified in MediaFormat doesn't match the format of the input
// file. Check the media format of your media file and correct the specified value.
//
// - Invalid sample rate for audio file . The sample rate specified in
// MediaSampleRateHertz isn't valid. The sample rate must be between 8,000 and
// 48,000 hertz.
// - The sample rate provided does not match the detected sample rate . The
// sample rate specified in MediaSampleRateHertz doesn't match the sample rate
// detected in your input media file. Check the sample rate of your media file and
// correct the specified value.
// - Invalid file size: file size too large . The size of your media file is
// larger than what Amazon Transcribe can process. For more information, refer to
// Guidelines and quotas (https://docs.aws.amazon.com/transcribe/latest/dg/limits-guidelines.html#limits)
// .
// - Invalid number of channels: number of channels too large . Your audio
// contains more channels than Amazon Transcribe is able to process. For more
// information, refer to Guidelines and quotas (https://docs.aws.amazon.com/transcribe/latest/dg/limits-guidelines.html#limits)
// .
FailureReason *string
// The confidence score associated with the language identified in your media
// file. Confidence scores are values between 0 and 1; a larger value indicates a
// higher probability that the identified language correctly matches the language
// spoken in your media.
IdentifiedLanguageScore *float32
// The language code used to create your Call Analytics job. For a list of
// supported languages and their associated language codes, refer to the Supported
// languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table. If you don't know the language spoken in your media file, you can omit
// this field and let Amazon Transcribe automatically identify the language of your
// media. To improve the accuracy of language identification, you can include
// several language codes and Amazon Transcribe chooses the closest match for your
// transcription.
LanguageCode LanguageCode
// Provides the Amazon S3 location of the media file you used in your Call
// Analytics request.
Media *Media
// The format of the input media file.
MediaFormat MediaFormat
// The sample rate, in hertz, of the audio track in your input media file.
MediaSampleRateHertz *int32
// Provides information on any additional settings that were included in your
// request. Additional settings include content redaction and language
// identification settings.
Settings *CallAnalyticsJobSettings
// The date and time the specified Call Analytics job began processing. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.789000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
StartTime *time.Time
// Provides you with the Amazon S3 URI you can use to access your transcript.
Transcript *Transcript
noSmithyDocumentSerde
}
// Provides additional optional settings for your request, including content
// redaction, automatic language identification; allows you to apply custom
// language models, custom vocabulary filters, and custom vocabularies.
type CallAnalyticsJobSettings struct {
// Makes it possible to redact or flag specified personally identifiable
// information (PII) in your transcript. If you use ContentRedaction , you must
// also include the sub-parameters: PiiEntityTypes , RedactionOutput , and
// RedactionType .
ContentRedaction *ContentRedaction
// If using automatic language identification in your request and you want to
// apply a custom language model, a custom vocabulary, or a custom vocabulary
// filter, include LanguageIdSettings with the relevant sub-parameters (
// VocabularyName , LanguageModelName , and VocabularyFilterName ).
// LanguageIdSettings supports two to five language codes. Each language code you
// include can have an associated custom language model, custom vocabulary, and
// custom vocabulary filter. The language codes that you specify must match the
// languages of the associated custom language models, custom vocabularies, and
// custom vocabulary filters. It's recommended that you include LanguageOptions
// when using LanguageIdSettings to ensure that the correct language dialect is
// identified. For example, if you specify a custom vocabulary that is in en-US
// but Amazon Transcribe determines that the language spoken in your media is en-AU
// , your custom vocabulary is not applied to your transcription. If you include
// LanguageOptions and include en-US as the only English language dialect, your
// custom vocabulary is applied to your transcription. If you want to include a
// custom language model, custom vocabulary, or custom vocabulary filter with your
// request but do not want to use automatic language identification, use instead
// the parameter with the LanguageModelName , VocabularyName , or
// VocabularyFilterName sub-parameters. For a list of languages supported with Call
// Analytics, refer to Supported languages and language-specific features (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// .
LanguageIdSettings map[string]LanguageIdSettings
// The name of the custom language model you want to use when processing your Call
// Analytics job. Note that custom language model names are case sensitive. The
// language of the specified custom language model must match the language code
// that you specify in your transcription request. If the languages don't match,
// the custom language model isn't applied. There are no errors or warnings
// associated with a language mismatch.
LanguageModelName *string
// You can specify two or more language codes that represent the languages you
// think may be present in your media. Including more than five is not recommended.
// If you're unsure what languages are present, do not include this parameter.
// Including language options can improve the accuracy of language identification.
// For a list of languages supported with Call Analytics, refer to the Supported
// languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table. To transcribe speech in Modern Standard Arabic ( ar-SA ), your media file
// must be encoded at a sample rate of 16,000 Hz or higher.
LanguageOptions []LanguageCode
// Specify how you want your custom vocabulary filter applied to your transcript.
// To replace words with *** , choose mask . To delete words, choose remove . To
// flag words without changing them, choose tag .
VocabularyFilterMethod VocabularyFilterMethod
// The name of the custom vocabulary filter you want to include in your Call
// Analytics transcription request. Custom vocabulary filter names are case
// sensitive. Note that if you include VocabularyFilterName in your request, you
// must also include VocabularyFilterMethod .
VocabularyFilterName *string
// The name of the custom vocabulary you want to include in your Call Analytics
// transcription request. Custom vocabulary names are case sensitive.
VocabularyName *string
noSmithyDocumentSerde
}
// Provides detailed information about a specific Call Analytics job.
type CallAnalyticsJobSummary struct {
// The name of the Call Analytics job. Job names are case sensitive and must be
// unique within an Amazon Web Services account.
CallAnalyticsJobName *string
// Provides the status of your Call Analytics job. If the status is COMPLETED , the
// job is finished and you can find the results at the location specified in
// TranscriptFileUri (or RedactedTranscriptFileUri , if you requested transcript
// redaction). If the status is FAILED , FailureReason provides details on why
// your transcription job failed.
CallAnalyticsJobStatus CallAnalyticsJobStatus
// The date and time the specified Call Analytics job finished processing.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:33:13.922000-07:00 represents a transcription job that started
// processing at 12:33 PM UTC-7 on May 4, 2022.
CompletionTime *time.Time
// The date and time the specified Call Analytics job request was made. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
CreationTime *time.Time
// If CallAnalyticsJobStatus is FAILED , FailureReason contains information about
// why the Call Analytics job failed. See also: Common Errors (https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonErrors.html)
// .
FailureReason *string
// The language code used to create your Call Analytics transcription.
LanguageCode LanguageCode
// The date and time your Call Analytics job began processing. Timestamps are in
// the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.789000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
StartTime *time.Time
noSmithyDocumentSerde
}
// Provides you with the properties of the Call Analytics category you specified
// in your request. This includes the list of rules that define the specified
// category.
type CategoryProperties struct {
// The name of the Call Analytics category. Category names are case sensitive and
// must be unique within an Amazon Web Services account.
CategoryName *string
// The date and time the specified Call Analytics category was created. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
CreateTime *time.Time
// The input type associated with the specified category. POST_CALL refers to a
// category that is applied to batch transcriptions; REAL_TIME refers to a
// category that is applied to streaming transcriptions.
InputType InputType
// The date and time the specified Call Analytics category was last updated.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-05T12:45:32.691000-07:00 represents 12:45 PM UTC-7 on May 5, 2022.
LastUpdateTime *time.Time
// The rules used to define a Call Analytics category. Each category can have
// between 1 and 20 rules.
Rules []Rule
noSmithyDocumentSerde
}
// Makes it possible to specify which speaker is on which channel. For example, if
// your agent is the first participant to speak, you would set ChannelId to 0 (to
// indicate the first channel) and ParticipantRole to AGENT (to indicate that it's
// the agent speaking).
type ChannelDefinition struct {
// Specify the audio channel you want to define.
ChannelId int32
// Specify the speaker you want to define. Omitting this parameter is equivalent
// to specifying both participants.
ParticipantRole ParticipantRole
noSmithyDocumentSerde
}
// Makes it possible to redact or flag specified personally identifiable
// information (PII) in your transcript. If you use ContentRedaction , you must
// also include the sub-parameters: PiiEntityTypes , RedactionOutput , and
// RedactionType .
type ContentRedaction struct {
// Specify if you want only a redacted transcript, or if you want a redacted and
// an unredacted transcript. When you choose redacted Amazon Transcribe creates
// only a redacted transcript. When you choose redacted_and_unredacted Amazon
// Transcribe creates a redacted and an unredacted transcript (as two separate
// files).
//
// This member is required.
RedactionOutput RedactionOutput
// Specify the category of information you want to redact; PII (personally
// identifiable information) is the only valid value. You can use PiiEntityTypes
// to choose which types of PII you want to redact.
//
// This member is required.
RedactionType RedactionType
// Specify which types of personally identifiable information (PII) you want to
// redact in your transcript. You can include as many types as you'd like, or you
// can select ALL .
PiiEntityTypes []PiiEntityType
noSmithyDocumentSerde
}
// Contains the Amazon S3 location of the training data you want to use to create
// a new custom language model, and permissions to access this location. When using
// InputDataConfig , you must include these sub-parameters: S3Uri and
// DataAccessRoleArn . You can optionally include TuningDataS3Uri .
type InputDataConfig struct {
// The Amazon Resource Name (ARN) of an IAM role that has permissions to access
// the Amazon S3 bucket that contains your input files. If the role that you
// specify doesn’t have the appropriate permissions to access the specified Amazon
// S3 location, your request fails. IAM role ARNs have the format
// arn:partition:iam::account:role/role-name-with-path . For example:
// arn:aws:iam::111122223333:role/Admin . For more information, see IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns)
// .
//
// This member is required.
DataAccessRoleArn *string
// The Amazon S3 location (URI) of the text files you want to use to train your
// custom language model. Here's an example URI path:
// s3://DOC-EXAMPLE-BUCKET/my-model-training-data/
//
// This member is required.
S3Uri *string
// The Amazon S3 location (URI) of the text files you want to use to tune your
// custom language model. Here's an example URI path:
// s3://DOC-EXAMPLE-BUCKET/my-model-tuning-data/
TuningDataS3Uri *string
noSmithyDocumentSerde
}
// Flag the presence or absence of interruptions in your Call Analytics
// transcription output. Rules using InterruptionFilter are designed to match:
// - Instances where an agent interrupts a customer
// - Instances where a customer interrupts an agent
// - Either participant interrupting the other
// - A lack of interruptions
//
// See Rule criteria for post-call categories (https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-batch.html#tca-rules-batch)
// for usage examples.
type InterruptionFilter struct {
// Makes it possible to specify a time range (in milliseconds) in your audio,
// during which you want to search for an interruption. See for more detail.
AbsoluteTimeRange *AbsoluteTimeRange
// Set to TRUE to flag speech that does not contain interruptions. Set to FALSE to
// flag speech that contains interruptions.
Negate *bool
// Specify the interrupter that you want to flag. Omitting this parameter is
// equivalent to specifying both participants.
ParticipantRole ParticipantRole
// Makes it possible to specify a time range (in percentage) in your media file,
// during which you want to search for an interruption. See for more detail.
RelativeTimeRange *RelativeTimeRange
// Specify the duration of the interruptions in milliseconds. For example, you can
// flag speech that contains more than 10,000 milliseconds of interruptions.
Threshold *int64
noSmithyDocumentSerde
}
// Makes it possible to control how your transcription job is processed.
// Currently, the only JobExecutionSettings modification you can choose is
// enabling job queueing using the AllowDeferredExecution sub-parameter. If you
// include JobExecutionSettings in your request, you must also include the
// sub-parameters: AllowDeferredExecution and DataAccessRoleArn .
type JobExecutionSettings struct {
// Makes it possible to enable job queuing when your concurrent request limit is
// exceeded. When AllowDeferredExecution is set to true , transcription job
// requests are placed in a queue until the number of jobs falls below the
// concurrent request limit. If AllowDeferredExecution is set to false and the
// number of transcription job requests exceed the concurrent request limit, you
// get a LimitExceededException error. If you include AllowDeferredExecution in
// your request, you must also include DataAccessRoleArn .
AllowDeferredExecution *bool
// The Amazon Resource Name (ARN) of an IAM role that has permissions to access
// the Amazon S3 bucket that contains your input files. If the role that you
// specify doesn’t have the appropriate permissions to access the specified Amazon
// S3 location, your request fails. IAM role ARNs have the format
// arn:partition:iam::account:role/role-name-with-path . For example:
// arn:aws:iam::111122223333:role/Admin . For more information, see IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns)
// . Note that if you include DataAccessRoleArn in your request, you must also
// include AllowDeferredExecution .
DataAccessRoleArn *string
noSmithyDocumentSerde
}
// Provides information on the speech contained in a discreet utterance when
// multi-language identification is enabled in your request. This utterance
// represents a block of speech consisting of one language, preceded or followed by
// a block of speech in a different language.
type LanguageCodeItem struct {
// Provides the total time, in seconds, each identified language is spoken in your
// media.
DurationInSeconds *float32
// Provides the language code for each language identified in your media.
LanguageCode LanguageCode
noSmithyDocumentSerde
}
// If using automatic language identification in your request and you want to
// apply a custom language model, a custom vocabulary, or a custom vocabulary
// filter, include LanguageIdSettings with the relevant sub-parameters (
// VocabularyName , LanguageModelName , and VocabularyFilterName ). Note that
// multi-language identification ( IdentifyMultipleLanguages ) doesn't support
// custom language models. LanguageIdSettings supports two to five language codes.
// Each language code you include can have an associated custom language model,
// custom vocabulary, and custom vocabulary filter. The language codes that you
// specify must match the languages of the associated custom language models,
// custom vocabularies, and custom vocabulary filters. It's recommended that you
// include LanguageOptions when using LanguageIdSettings to ensure that the
// correct language dialect is identified. For example, if you specify a custom
// vocabulary that is in en-US but Amazon Transcribe determines that the language
// spoken in your media is en-AU , your custom vocabulary is not applied to your
// transcription. If you include LanguageOptions and include en-US as the only
// English language dialect, your custom vocabulary is applied to your
// transcription. If you want to include a custom language model with your request
// but do not want to use automatic language identification, use instead the
// parameter with the LanguageModelName sub-parameter. If you want to include a
// custom vocabulary or a custom vocabulary filter (or both) with your request but
// do not want to use automatic language identification, use instead the parameter
// with the VocabularyName or VocabularyFilterName (or both) sub-parameter.
type LanguageIdSettings struct {
// The name of the custom language model you want to use when processing your
// transcription job. Note that custom language model names are case sensitive. The
// language of the specified custom language model must match the language code
// that you specify in your transcription request. If the languages don't match,
// the custom language model isn't applied. There are no errors or warnings
// associated with a language mismatch.
LanguageModelName *string
// The name of the custom vocabulary filter you want to use when processing your
// transcription job. Custom vocabulary filter names are case sensitive. The
// language of the specified custom vocabulary filter must match the language code
// that you specify in your transcription request. If the languages don't match,
// the custom vocabulary filter isn't applied. There are no errors or warnings
// associated with a language mismatch. Note that if you include
// VocabularyFilterName in your request, you must also include
// VocabularyFilterMethod .
VocabularyFilterName *string
// The name of the custom vocabulary you want to use when processing your
// transcription job. Custom vocabulary names are case sensitive. The language of
// the specified custom vocabulary must match the language code that you specify in
// your transcription request. If the languages don't match, the custom vocabulary
// isn't applied. There are no errors or warnings associated with a language
// mismatch.
VocabularyName *string
noSmithyDocumentSerde
}
// Provides information about a custom language model, including:
// - The base model name
// - When the model was created
// - The location of the files used to train the model
// - When the model was last modified
// - The name you chose for the model
// - The model's language
// - The model's processing state
// - Any available upgrades for the base model
type LanguageModel struct {
// The Amazon Transcribe standard language model, or base model, used to create
// your custom language model.
BaseModelName BaseModelName
// The date and time the specified custom language model was created. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
CreateTime *time.Time
// If ModelStatus is FAILED , FailureReason contains information about why the
// custom language model request failed. See also: Common Errors (https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonErrors.html)
// .
FailureReason *string
// The Amazon S3 location of the input files used to train and tune your custom
// language model, in addition to the data access role ARN (Amazon Resource Name)
// that has permissions to access these data.
InputDataConfig *InputDataConfig
// The language code used to create your custom language model. Each custom
// language model must contain terms in only one language, and the language you
// select for your custom language model must match the language of your training
// and tuning data. For a list of supported languages and their associated language
// codes, refer to the Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table. Note that U.S. English ( en-US ) is the only language supported with
// Amazon Transcribe Medical.
LanguageCode CLMLanguageCode
// The date and time the specified custom language model was last modified.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// A unique name, chosen by you, for your custom language model. This name is case
// sensitive, cannot contain spaces, and must be unique within an Amazon Web
// Services account.
ModelName *string
// The status of the specified custom language model. When the status displays as
// COMPLETED the model is ready for use.
ModelStatus ModelStatus
// Shows if a more current base model is available for use with the specified
// custom language model. If false , your custom language model is using the most
// up-to-date base model. If true , there is a newer base model available than the
// one your language model is using. Note that to update a base model, you must
// recreate the custom language model using the new base model. Base model upgrades
// for existing custom language models are not supported.
UpgradeAvailability *bool
noSmithyDocumentSerde
}
// Describes the Amazon S3 location of the media file you want to use in your
// request. For information on supported media formats, refer to the MediaFormat (https://docs.aws.amazon.com/APIReference/API_StartTranscriptionJob.html#transcribe-StartTranscriptionJob-request-MediaFormat)
// parameter or the Media formats (https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio)
// section in the Amazon S3 Developer Guide.
type Media struct {
// The Amazon S3 location of the media file you want to transcribe. For example:
// - s3://DOC-EXAMPLE-BUCKET/my-media-file.flac
// - s3://DOC-EXAMPLE-BUCKET/media-files/my-media-file.flac
// Note that the Amazon S3 bucket that contains your input media must be located
// in the same Amazon Web Services Region where you're making your transcription
// request.
MediaFileUri *string
// The Amazon S3 location of the media file you want to redact. For example:
// - s3://DOC-EXAMPLE-BUCKET/my-media-file.flac
// - s3://DOC-EXAMPLE-BUCKET/media-files/my-media-file.flac
// Note that the Amazon S3 bucket that contains your input media must be located
// in the same Amazon Web Services Region where you're making your transcription
// request. RedactedMediaFileUri produces a redacted audio file in addition to a
// redacted transcript. It is only supported for Call Analytics (
// StartCallAnalyticsJob ) transcription requests.
RedactedMediaFileUri *string
noSmithyDocumentSerde
}
// Provides you with the Amazon S3 URI you can use to access your transcript.
type MedicalTranscript struct {
// The Amazon S3 location of your transcript. You can use this URI to access or
// download your transcript. Note that this is the Amazon S3 location you specified
// in your request using the OutputBucketName parameter.
TranscriptFileUri *string
noSmithyDocumentSerde
}
// Provides detailed information about a medical transcription job. To view the
// status of the specified medical transcription job, check the
// TranscriptionJobStatus field. If the status is COMPLETED , the job is finished
// and you can find the results at the location specified in TranscriptFileUri . If
// the status is FAILED , FailureReason provides details on why your transcription
// job failed.
type MedicalTranscriptionJob struct {
// The date and time the specified medical transcription job finished processing.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:33:13.922000-07:00 represents a transcription job that started
// processing at 12:33 PM UTC-7 on May 4, 2022.
CompletionTime *time.Time
// Indicates whether content identification was enabled for your transcription
// request.
ContentIdentificationType MedicalContentIdentificationType
// The date and time the specified medical transcription job request was made.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
CreationTime *time.Time
// If TranscriptionJobStatus is FAILED , FailureReason contains information about
// why the transcription job request failed. The FailureReason field contains one
// of the following values:
// - Unsupported media format . The media format specified in MediaFormat isn't
// valid. Refer to MediaFormat for a list of supported formats.
// - The media format provided does not match the detected media format . The
// media format specified in MediaFormat doesn't match the format of the input
// file. Check the media format of your media file and correct the specified value.
//
// - Invalid sample rate for audio file . The sample rate specified in
// MediaSampleRateHertz isn't valid. The sample rate must be between 16,000 and
// 48,000 hertz.
// - The sample rate provided does not match the detected sample rate . The
// sample rate specified in MediaSampleRateHertz doesn't match the sample rate
// detected in your input media file. Check the sample rate of your media file and
// correct the specified value.
// - Invalid file size: file size too large . The size of your media file is
// larger than what Amazon Transcribe can process. For more information, refer to
// Guidelines and quotas (https://docs.aws.amazon.com/transcribe/latest/dg/limits-guidelines.html#limits)
// .
// - Invalid number of channels: number of channels too large . Your audio
// contains more channels than Amazon Transcribe is able to process. For more
// information, refer to Guidelines and quotas (https://docs.aws.amazon.com/transcribe/latest/dg/limits-guidelines.html#limits)
// .
FailureReason *string
// The language code used to create your medical transcription job. US English (
// en-US ) is the only supported language for medical transcriptions.
LanguageCode LanguageCode
// Describes the Amazon S3 location of the media file you want to use in your
// request. For information on supported media formats, refer to the MediaFormat (https://docs.aws.amazon.com/APIReference/API_StartTranscriptionJob.html#transcribe-StartTranscriptionJob-request-MediaFormat)
// parameter or the Media formats (https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio)
// section in the Amazon S3 Developer Guide.
Media *Media
// The format of the input media file.
MediaFormat MediaFormat
// The sample rate, in hertz, of the audio track in your input media file.
MediaSampleRateHertz *int32
// The name of the medical transcription job. Job names are case sensitive and
// must be unique within an Amazon Web Services account.
MedicalTranscriptionJobName *string
// Provides information on any additional settings that were included in your
// request. Additional settings include channel identification, alternative
// transcriptions, speaker partitioning, custom vocabularies, and custom vocabulary
// filters.
Settings *MedicalTranscriptionSetting
// Describes the medical specialty represented in your media.
Specialty Specialty
// The date and time the specified medical transcription job began processing.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.789000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
StartTime *time.Time
// The tags, each in the form of a key:value pair, assigned to the specified
// medical transcription job.
Tags []Tag
// Provides you with the Amazon S3 URI you can use to access your transcript.
Transcript *MedicalTranscript
// Provides the status of the specified medical transcription job. If the status
// is COMPLETED , the job is finished and you can find the results at the location
// specified in TranscriptFileUri . If the status is FAILED , FailureReason
// provides details on why your transcription job failed.
TranscriptionJobStatus TranscriptionJobStatus
// Indicates whether the input media is a dictation or a conversation, as
// specified in the StartMedicalTranscriptionJob request.
Type Type
noSmithyDocumentSerde
}
// Provides detailed information about a specific medical transcription job.
type MedicalTranscriptionJobSummary struct {
// The date and time the specified medical transcription job finished processing.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:33:13.922000-07:00 represents a transcription job that started
// processing at 12:33 PM UTC-7 on May 4, 2022.
CompletionTime *time.Time
// Labels all personal health information (PHI) identified in your transcript. For
// more information, see Identifying personal health information (PHI) in a
// transcription (https://docs.aws.amazon.com/transcribe/latest/dg/phi-id.html) .
ContentIdentificationType MedicalContentIdentificationType
// The date and time the specified medical transcription job request was made.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
CreationTime *time.Time
// If TranscriptionJobStatus is FAILED , FailureReason contains information about
// why the transcription job failed. See also: Common Errors (https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonErrors.html)
// .
FailureReason *string
// The language code used to create your medical transcription. US English ( en-US
// ) is the only supported language for medical transcriptions.
LanguageCode LanguageCode
// The name of the medical transcription job. Job names are case sensitive and
// must be unique within an Amazon Web Services account.
MedicalTranscriptionJobName *string
// Indicates where the specified medical transcription output is stored. If the
// value is CUSTOMER_BUCKET , the location is the Amazon S3 bucket you specified
// using the OutputBucketName parameter in your request. If you also included
// OutputKey in your request, your output is located in the path you specified in
// your request. If the value is SERVICE_BUCKET , the location is a service-managed
// Amazon S3 bucket. To access a transcript stored in a service-managed bucket, use
// the URI shown in the TranscriptFileUri field.
OutputLocationType OutputLocationType
// Provides the medical specialty represented in your media.
Specialty Specialty
// The date and time your medical transcription job began processing. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.789000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
StartTime *time.Time
// Provides the status of your medical transcription job. If the status is
// COMPLETED , the job is finished and you can find the results at the location
// specified in TranscriptFileUri . If the status is FAILED , FailureReason
// provides details on why your transcription job failed.
TranscriptionJobStatus TranscriptionJobStatus
// Indicates whether the input media is a dictation or a conversation, as
// specified in the StartMedicalTranscriptionJob request.
Type Type
noSmithyDocumentSerde
}
// Allows additional optional settings in your request, including channel
// identification, alternative transcriptions, and speaker partitioning. You can
// use that to apply custom vocabularies to your medical transcription job.
type MedicalTranscriptionSetting struct {
// Enables channel identification in multi-channel audio. Channel identification
// transcribes the audio on each channel independently, then appends the output for
// each channel into one transcript. If you have multi-channel audio and do not
// enable channel identification, your audio is transcribed in a continuous manner
// and your transcript does not separate the speech by channel. You can't include
// both ShowSpeakerLabels and ChannelIdentification in the same request. Including
// both parameters returns a BadRequestException . For more information, see
// Transcribing multi-channel audio (https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html)
// .
ChannelIdentification *bool
// Indicate the maximum number of alternative transcriptions you want Amazon
// Transcribe Medical to include in your transcript. If you select a number greater
// than the number of alternative transcriptions generated by Amazon Transcribe
// Medical, only the actual number of alternative transcriptions are included. If
// you include MaxAlternatives in your request, you must also include
// ShowAlternatives with a value of true . For more information, see Alternative
// transcriptions (https://docs.aws.amazon.com/transcribe/latest/dg/how-alternatives.html)
// .
MaxAlternatives *int32
// Specify the maximum number of speakers you want to partition in your media.
// Note that if your media contains more speakers than the specified number,
// multiple speakers are treated as a single speaker. If you specify the
// MaxSpeakerLabels field, you must set the ShowSpeakerLabels field to true.
MaxSpeakerLabels *int32
// To include alternative transcriptions within your transcription output, include
// ShowAlternatives in your transcription request. If you include ShowAlternatives
// , you must also include MaxAlternatives , which is the maximum number of
// alternative transcriptions you want Amazon Transcribe Medical to generate. For
// more information, see Alternative transcriptions (https://docs.aws.amazon.com/transcribe/latest/dg/how-alternatives.html)
// .
ShowAlternatives *bool
// Enables speaker partitioning (diarization) in your transcription output.
// Speaker partitioning labels the speech from individual speakers in your media
// file. If you enable ShowSpeakerLabels in your request, you must also include
// MaxSpeakerLabels . You can't include ShowSpeakerLabels and ChannelIdentification
// in the same request. Including both parameters returns a BadRequestException .
// For more information, see Partitioning speakers (diarization) (https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html)
// .
ShowSpeakerLabels *bool
// The name of the custom vocabulary you want to use when processing your medical
// transcription job. Custom vocabulary names are case sensitive. The language of
// the specified custom vocabulary must match the language code that you specify in
// your transcription request. If the languages don't match, the custom vocabulary
// isn't applied. There are no errors or warnings associated with a language
// mismatch. US English ( en-US ) is the only valid language for Amazon Transcribe
// Medical.
VocabularyName *string
noSmithyDocumentSerde
}
// Provides the name of the custom language model that was included in the
// specified transcription job. Only use ModelSettings with the LanguageModelName
// sub-parameter if you're not using automatic language identification ( ). If
// using LanguageIdSettings in your request, this parameter contains a
// LanguageModelName sub-parameter.
type ModelSettings struct {
// The name of the custom language model you want to use when processing your
// transcription job. Note that custom language model names are case sensitive. The
// language of the specified custom language model must match the language code
// that you specify in your transcription request. If the languages don't match,
// the custom language model isn't applied. There are no errors or warnings
// associated with a language mismatch.
LanguageModelName *string
noSmithyDocumentSerde
}
// Flag the presence or absence of periods of silence in your Call Analytics
// transcription output. Rules using NonTalkTimeFilter are designed to match:
// - The presence of silence at specified periods throughout the call
// - The presence of speech at specified periods throughout the call
//
// See Rule criteria for post-call categories (https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-batch.html#tca-rules-batch)
// for usage examples.
type NonTalkTimeFilter struct {
// Makes it possible to specify a time range (in milliseconds) in your audio,
// during which you want to search for a period of silence. See for more detail.
AbsoluteTimeRange *AbsoluteTimeRange
// Set to TRUE to flag periods of speech. Set to FALSE to flag periods of silence
Negate *bool
// Makes it possible to specify a time range (in percentage) in your media file,
// during which you want to search for a period of silence. See for more detail.
RelativeTimeRange *RelativeTimeRange
// Specify the duration, in milliseconds, of the period of silence that you want
// to flag. For example, you can flag a silent period that lasts 30,000
// milliseconds.
Threshold *int64
noSmithyDocumentSerde
}
// A time range, in percentage, between two points in your media file. You can use
// StartPercentage and EndPercentage to search a custom segment. For example,
// setting StartPercentage to 10 and EndPercentage to 50 only searches for your
// specified criteria in the audio contained between the 10 percent mark and the 50
// percent mark of your media file. You can use also First to search from the
// start of the media file until the time that you specify. Or use Last to search
// from the time that you specify until the end of the media file. For example,
// setting First to 10 only searches for your specified criteria in the audio
// contained in the first 10 percent of the media file. If you prefer to use
// milliseconds instead of percentage, see .
type RelativeTimeRange struct {
// The time, in percentage, when Amazon Transcribe stops searching for the
// specified criteria in your media file. If you include EndPercentage in your
// request, you must also include StartPercentage .
EndPercentage *int32
// The time, in percentage, from the start of your media file until the specified
// value. Amazon Transcribe searches for your specified criteria in this time
// segment.
First *int32
// The time, in percentage, from the specified value until the end of your media
// file. Amazon Transcribe searches for your specified criteria in this time
// segment.
Last *int32
// The time, in percentage, when Amazon Transcribe starts searching for the
// specified criteria in your media file. If you include StartPercentage in your
// request, you must also include EndPercentage .
StartPercentage *int32
noSmithyDocumentSerde
}
// A rule is a set of criteria that you can specify to flag an attribute in your
// Call Analytics output. Rules define a Call Analytics category. Rules can include
// these parameters: , , , and . To learn more about Call Analytics rules and
// categories, see Creating categories for post-call transcriptions (https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-batch.html)
// and Creating categories for real-time transcriptions (https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-stream.html)
// . To learn more about Call Analytics, see Analyzing call center audio with Call
// Analytics (https://docs.aws.amazon.com/transcribe/latest/dg/call-analytics.html)
// .
//
// The following types satisfy this interface:
//
// RuleMemberInterruptionFilter
// RuleMemberNonTalkTimeFilter
// RuleMemberSentimentFilter
// RuleMemberTranscriptFilter
type Rule interface {
isRule()
}
// Flag the presence or absence of interruptions in your Call Analytics
// transcription output. Refer to for more detail.
type RuleMemberInterruptionFilter struct {
Value InterruptionFilter
noSmithyDocumentSerde
}
func (*RuleMemberInterruptionFilter) isRule() {}
// Flag the presence or absence of periods of silence in your Call Analytics
// transcription output. Refer to for more detail.
type RuleMemberNonTalkTimeFilter struct {
Value NonTalkTimeFilter
noSmithyDocumentSerde
}
func (*RuleMemberNonTalkTimeFilter) isRule() {}
// Flag the presence or absence of specific sentiments in your Call Analytics
// transcription output. Refer to for more detail.
type RuleMemberSentimentFilter struct {
Value SentimentFilter
noSmithyDocumentSerde
}
func (*RuleMemberSentimentFilter) isRule() {}
// Flag the presence or absence of specific words or phrases in your Call
// Analytics transcription output. Refer to for more detail.
type RuleMemberTranscriptFilter struct {
Value TranscriptFilter
noSmithyDocumentSerde
}
func (*RuleMemberTranscriptFilter) isRule() {}
// Flag the presence or absence of specific sentiments detected in your Call
// Analytics transcription output. Rules using SentimentFilter are designed to
// match:
// - The presence or absence of a positive sentiment felt by the customer,
// agent, or both at specified points in the call
// - The presence or absence of a negative sentiment felt by the customer,
// agent, or both at specified points in the call
// - The presence or absence of a neutral sentiment felt by the customer, agent,
// or both at specified points in the call
// - The presence or absence of a mixed sentiment felt by the customer, the
// agent, or both at specified points in the call
//
// See Rule criteria for post-call categories (https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-batch.html#tca-rules-batch)
// for usage examples.
type SentimentFilter struct {
// Specify the sentiments that you want to flag.
//
// This member is required.
Sentiments []SentimentValue
// Makes it possible to specify a time range (in milliseconds) in your audio,
// during which you want to search for the specified sentiments. See for more
// detail.
AbsoluteTimeRange *AbsoluteTimeRange
// Set to TRUE to flag the sentiments that you didn't include in your request. Set
// to FALSE to flag the sentiments that you specified in your request.
Negate *bool
// Specify the participant that you want to flag. Omitting this parameter is
// equivalent to specifying both participants.
ParticipantRole ParticipantRole
// Makes it possible to specify a time range (in percentage) in your media file,
// during which you want to search for the specified sentiments. See for more
// detail.
RelativeTimeRange *RelativeTimeRange
noSmithyDocumentSerde
}
// Allows additional optional settings in your request, including channel
// identification, alternative transcriptions, and speaker partitioning. You can
// use that to apply custom vocabularies to your transcription job.
type Settings struct {
// Enables channel identification in multi-channel audio. Channel identification
// transcribes the audio on each channel independently, then appends the output for
// each channel into one transcript. You can't include both ShowSpeakerLabels and
// ChannelIdentification in the same request. Including both parameters returns a
// BadRequestException . For more information, see Transcribing multi-channel audio (https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html)
// .
ChannelIdentification *bool
// Indicate the maximum number of alternative transcriptions you want Amazon
// Transcribe to include in your transcript. If you select a number greater than
// the number of alternative transcriptions generated by Amazon Transcribe, only
// the actual number of alternative transcriptions are included. If you include
// MaxAlternatives in your request, you must also include ShowAlternatives with a
// value of true . For more information, see Alternative transcriptions (https://docs.aws.amazon.com/transcribe/latest/dg/how-alternatives.html)
// .
MaxAlternatives *int32
// Specify the maximum number of speakers you want to partition in your media.
// Note that if your media contains more speakers than the specified number,
// multiple speakers are treated as a single speaker. If you specify the
// MaxSpeakerLabels field, you must set the ShowSpeakerLabels field to true.
MaxSpeakerLabels *int32
// To include alternative transcriptions within your transcription output, include
// ShowAlternatives in your transcription request. If you have multi-channel audio
// and do not enable channel identification, your audio is transcribed in a
// continuous manner and your transcript does not separate the speech by channel.
// If you include ShowAlternatives , you must also include MaxAlternatives , which
// is the maximum number of alternative transcriptions you want Amazon Transcribe
// to generate. For more information, see Alternative transcriptions (https://docs.aws.amazon.com/transcribe/latest/dg/how-alternatives.html)
// .
ShowAlternatives *bool
// Enables speaker partitioning (diarization) in your transcription output.
// Speaker partitioning labels the speech from individual speakers in your media
// file. If you enable ShowSpeakerLabels in your request, you must also include
// MaxSpeakerLabels . You can't include both ShowSpeakerLabels and
// ChannelIdentification in the same request. Including both parameters returns a
// BadRequestException . For more information, see Partitioning speakers
// (diarization) (https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html)
// .
ShowSpeakerLabels *bool
// Specify how you want your custom vocabulary filter applied to your transcript.
// To replace words with *** , choose mask . To delete words, choose remove . To
// flag words without changing them, choose tag .
VocabularyFilterMethod VocabularyFilterMethod
// The name of the custom vocabulary filter you want to use in your transcription
// job request. This name is case sensitive, cannot contain spaces, and must be
// unique within an Amazon Web Services account. Note that if you include
// VocabularyFilterName in your request, you must also include
// VocabularyFilterMethod .
VocabularyFilterName *string
// The name of the custom vocabulary you want to use in your transcription job
// request. This name is case sensitive, cannot contain spaces, and must be unique
// within an Amazon Web Services account.
VocabularyName *string
noSmithyDocumentSerde
}
// Generate subtitles for your media file with your transcription request. You can
// choose a start index of 0 or 1, and you can specify either WebVTT or SubRip (or
// both) as your output format. Note that your subtitle files are placed in the
// same location as your transcription output.
type Subtitles struct {
// Specify the output format for your subtitle file; if you select both WebVTT ( vtt
// ) and SubRip ( srt ) formats, two output files are generated.
Formats []SubtitleFormat
// Specify the starting value that is assigned to the first subtitle segment. The
// default start index for Amazon Transcribe is 0 , which differs from the more
// widely used standard of 1 . If you're uncertain which value to use, we recommend
// choosing 1 , as this may improve compatibility with other services.
OutputStartIndex *int32
noSmithyDocumentSerde
}
// Provides information about your subtitle file, including format, start index,
// and Amazon S3 location.
type SubtitlesOutput struct {
// Provides the format of your subtitle files. If your request included both
// WebVTT ( vtt ) and SubRip ( srt ) formats, both formats are shown.
Formats []SubtitleFormat
// Provides the start index value for your subtitle files. If you did not specify
// a value in your request, the default value of 0 is used.
OutputStartIndex *int32
// The Amazon S3 location of your transcript. You can use this URI to access or
// download your subtitle file. Your subtitle file is stored in the same location
// as your transcript. If you specified both WebVTT and SubRip subtitle formats,
// two URIs are provided. If you included OutputBucketName in your transcription
// job request, this is the URI of that bucket. If you also included OutputKey in
// your request, your output is located in the path you specified in your request.
// If you didn't include OutputBucketName in your transcription job request, your
// subtitle file is stored in a service-managed bucket, and TranscriptFileUri
// provides you with a temporary URI you can use for secure access to your subtitle
// file. Temporary URIs for service-managed Amazon S3 buckets are only valid for 15
// minutes. If you get an AccesDenied error, you can get a new temporary URI by
// running a GetTranscriptionJob or ListTranscriptionJob request.
SubtitleFileUris []string
noSmithyDocumentSerde
}
// Adds metadata, in the form of a key:value pair, to the specified resource. For
// example, you could add the tag Department:Sales to a resource to indicate that
// it pertains to your organization's sales department. You can also use tags for
// tag-based access control. To learn more about tagging, see Tagging resources (https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html)
// .
type Tag struct {
// The first part of a key:value pair that forms a tag associated with a given
// resource. For example, in the tag Department:Sales , the key is 'Department'.
//
// This member is required.
Key *string
// The second part of a key:value pair that forms a tag associated with a given
// resource. For example, in the tag Department:Sales , the value is 'Sales'. Note
// that you can set the value of a tag to an empty string, but you can't set the
// value of a tag to null. Omitting the tag value is the same as using an empty
// string.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// Provides you with the Amazon S3 URI you can use to access your transcript.
type Transcript struct {
// The Amazon S3 location of your redacted transcript. You can use this URI to
// access or download your transcript. If you included OutputBucketName in your
// transcription job request, this is the URI of that bucket. If you also included
// OutputKey in your request, your output is located in the path you specified in
// your request. If you didn't include OutputBucketName in your transcription job
// request, your transcript is stored in a service-managed bucket, and
// RedactedTranscriptFileUri provides you with a temporary URI you can use for
// secure access to your transcript. Temporary URIs for service-managed Amazon S3
// buckets are only valid for 15 minutes. If you get an AccesDenied error, you can
// get a new temporary URI by running a GetTranscriptionJob or ListTranscriptionJob
// request.
RedactedTranscriptFileUri *string
// The Amazon S3 location of your transcript. You can use this URI to access or
// download your transcript. If you included OutputBucketName in your
// transcription job request, this is the URI of that bucket. If you also included
// OutputKey in your request, your output is located in the path you specified in
// your request. If you didn't include OutputBucketName in your transcription job
// request, your transcript is stored in a service-managed bucket, and
// TranscriptFileUri provides you with a temporary URI you can use for secure
// access to your transcript. Temporary URIs for service-managed Amazon S3 buckets
// are only valid for 15 minutes. If you get an AccesDenied error, you can get a
// new temporary URI by running a GetTranscriptionJob or ListTranscriptionJob
// request.
TranscriptFileUri *string
noSmithyDocumentSerde
}
// Flag the presence or absence of specific words or phrases detected in your Call
// Analytics transcription output. Rules using TranscriptFilter are designed to
// match:
// - Custom words or phrases spoken by the agent, the customer, or both
// - Custom words or phrases not spoken by the agent, the customer, or either
// - Custom words or phrases that occur at a specific time frame
//
// See Rule criteria for post-call categories (https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-batch.html#tca-rules-batch)
// and Rule criteria for streaming categories (https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-stream.html#tca-rules-stream)
// for usage examples.
type TranscriptFilter struct {
// Specify the phrases that you want to flag.
//
// This member is required.
Targets []string
// Flag the presence or absence of an exact match to the phrases that you specify.
// For example, if you specify the phrase "speak to a manager" as your Targets
// value, only that exact phrase is flagged. Note that semantic matching is not
// supported. For example, if your customer says "speak to the manager", instead of
// "speak to a manager", your content is not flagged.
//
// This member is required.
TranscriptFilterType TranscriptFilterType
// Makes it possible to specify a time range (in milliseconds) in your audio,
// during which you want to search for the specified key words or phrases. See for
// more detail.
AbsoluteTimeRange *AbsoluteTimeRange
// Set to TRUE to flag the absence of the phrase that you specified in your
// request. Set to FALSE to flag the presence of the phrase that you specified in
// your request.
Negate *bool
// Specify the participant that you want to flag. Omitting this parameter is
// equivalent to specifying both participants.
ParticipantRole ParticipantRole
// Makes it possible to specify a time range (in percentage) in your media file,
// during which you want to search for the specified key words or phrases. See for
// more detail.
RelativeTimeRange *RelativeTimeRange
noSmithyDocumentSerde
}
// Provides detailed information about a transcription job. To view the status of
// the specified transcription job, check the TranscriptionJobStatus field. If the
// status is COMPLETED , the job is finished and you can find the results at the
// location specified in TranscriptFileUri . If the status is FAILED ,
// FailureReason provides details on why your transcription job failed. If you
// enabled content redaction, the redacted transcript can be found at the location
// specified in RedactedTranscriptFileUri .
type TranscriptionJob struct {
// The date and time the specified transcription job finished processing.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:33:13.922000-07:00 represents a transcription job that started
// processing at 12:33 PM UTC-7 on May 4, 2022.
CompletionTime *time.Time
// Indicates whether redaction was enabled in your transcript.
ContentRedaction *ContentRedaction
// The date and time the specified transcription job request was made. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
CreationTime *time.Time
// If TranscriptionJobStatus is FAILED , FailureReason contains information about
// why the transcription job request failed. The FailureReason field contains one
// of the following values:
// - Unsupported media format . The media format specified in MediaFormat isn't
// valid. Refer to MediaFormat for a list of supported formats.
// - The media format provided does not match the detected media format . The
// media format specified in MediaFormat doesn't match the format of the input
// file. Check the media format of your media file and correct the specified value.
//
// - Invalid sample rate for audio file . The sample rate specified in
// MediaSampleRateHertz isn't valid. The sample rate must be between 8,000 and
// 48,000 hertz.
// - The sample rate provided does not match the detected sample rate . The
// sample rate specified in MediaSampleRateHertz doesn't match the sample rate
// detected in your input media file. Check the sample rate of your media file and
// correct the specified value.
// - Invalid file size: file size too large . The size of your media file is
// larger than what Amazon Transcribe can process. For more information, refer to
// Guidelines and quotas (https://docs.aws.amazon.com/transcribe/latest/dg/limits-guidelines.html#limits)
// .
// - Invalid number of channels: number of channels too large . Your audio
// contains more channels than Amazon Transcribe is able to process. For more
// information, refer to Guidelines and quotas (https://docs.aws.amazon.com/transcribe/latest/dg/limits-guidelines.html#limits)
// .
FailureReason *string
// The confidence score associated with the language identified in your media
// file. Confidence scores are values between 0 and 1; a larger value indicates a
// higher probability that the identified language correctly matches the language
// spoken in your media.
IdentifiedLanguageScore *float32
// Indicates whether automatic language identification was enabled ( TRUE ) for the
// specified transcription job.
IdentifyLanguage *bool
// Indicates whether automatic multi-language identification was enabled ( TRUE )
// for the specified transcription job.
IdentifyMultipleLanguages *bool
// Provides information about how your transcription job was processed. This
// parameter shows if your request was queued and what data access role was used.
JobExecutionSettings *JobExecutionSettings
// The language code used to create your transcription job. This parameter is used
// with single-language identification. For multi-language identification requests,
// refer to the plural version of this parameter, LanguageCodes .
LanguageCode LanguageCode
// The language codes used to create your transcription job. This parameter is
// used with multi-language identification. For single-language identification
// requests, refer to the singular version of this parameter, LanguageCode .
LanguageCodes []LanguageCodeItem
// Provides the name and language of all custom language models, custom
// vocabularies, and custom vocabulary filters that you included in your request.
LanguageIdSettings map[string]LanguageIdSettings
// Provides the language codes you specified in your request.
LanguageOptions []LanguageCode
// Provides the Amazon S3 location of the media file you used in your request.
Media *Media
// The format of the input media file.
MediaFormat MediaFormat
// The sample rate, in hertz, of the audio track in your input media file.
MediaSampleRateHertz *int32
// Provides information on the custom language model you included in your request.
ModelSettings *ModelSettings
// Provides information on any additional settings that were included in your
// request. Additional settings include channel identification, alternative
// transcriptions, speaker partitioning, custom vocabularies, and custom vocabulary
// filters.
Settings *Settings
// The date and time the specified transcription job began processing. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.789000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
StartTime *time.Time
// Indicates whether subtitles were generated with your transcription.
Subtitles *SubtitlesOutput
// The tags, each in the form of a key:value pair, assigned to the specified
// transcription job.
Tags []Tag
// Provides you with the Amazon S3 URI you can use to access your transcript.
Transcript *Transcript
// The name of the transcription job. Job names are case sensitive and must be
// unique within an Amazon Web Services account.
TranscriptionJobName *string
// Provides the status of the specified transcription job. If the status is
// COMPLETED , the job is finished and you can find the results at the location
// specified in TranscriptFileUri (or RedactedTranscriptFileUri , if you requested
// transcript redaction). If the status is FAILED , FailureReason provides details
// on why your transcription job failed.
TranscriptionJobStatus TranscriptionJobStatus
noSmithyDocumentSerde
}
// Provides detailed information about a specific transcription job.
type TranscriptionJobSummary struct {
// The date and time the specified transcription job finished processing.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:33:13.922000-07:00 represents a transcription job that started
// processing at 12:33 PM UTC-7 on May 4, 2022.
CompletionTime *time.Time
// The content redaction settings of the transcription job.
ContentRedaction *ContentRedaction
// The date and time the specified transcription job request was made. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
CreationTime *time.Time
// If TranscriptionJobStatus is FAILED , FailureReason contains information about
// why the transcription job failed. See also: Common Errors (https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonErrors.html)
// .
FailureReason *string
// The confidence score associated with the language identified in your media
// file. Confidence scores are values between 0 and 1; a larger value indicates a
// higher probability that the identified language correctly matches the language
// spoken in your media.
IdentifiedLanguageScore *float32
// Indicates whether automatic language identification was enabled ( TRUE ) for the
// specified transcription job.
IdentifyLanguage *bool
// Indicates whether automatic multi-language identification was enabled ( TRUE )
// for the specified transcription job.
IdentifyMultipleLanguages *bool
// The language code used to create your transcription.
LanguageCode LanguageCode
// The language codes used to create your transcription job. This parameter is
// used with multi-language identification. For single-language identification, the
// singular version of this parameter, LanguageCode , is present.
LanguageCodes []LanguageCodeItem
// Provides the name of the custom language model that was included in the
// specified transcription job. Only use ModelSettings with the LanguageModelName
// sub-parameter if you're not using automatic language identification ( ). If
// using LanguageIdSettings in your request, this parameter contains a
// LanguageModelName sub-parameter.
ModelSettings *ModelSettings
// Indicates where the specified transcription output is stored. If the value is
// CUSTOMER_BUCKET , the location is the Amazon S3 bucket you specified using the
// OutputBucketName parameter in your request. If you also included OutputKey in
// your request, your output is located in the path you specified in your request.
// If the value is SERVICE_BUCKET , the location is a service-managed Amazon S3
// bucket. To access a transcript stored in a service-managed bucket, use the URI
// shown in the TranscriptFileUri or RedactedTranscriptFileUri field.
OutputLocationType OutputLocationType
// The date and time your transcription job began processing. Timestamps are in
// the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.789000-07:00 represents a transcription job that started
// processing at 12:32 PM UTC-7 on May 4, 2022.
StartTime *time.Time
// The name of the transcription job. Job names are case sensitive and must be
// unique within an Amazon Web Services account.
TranscriptionJobName *string
// Provides the status of your transcription job. If the status is COMPLETED , the
// job is finished and you can find the results at the location specified in
// TranscriptFileUri (or RedactedTranscriptFileUri , if you requested transcript
// redaction). If the status is FAILED , FailureReason provides details on why
// your transcription job failed.
TranscriptionJobStatus TranscriptionJobStatus
noSmithyDocumentSerde
}
// Provides information about a custom vocabulary filter, including the language
// of the filter, when it was last modified, and its name.
type VocabularyFilterInfo struct {
// The language code that represents the language of the entries in your
// vocabulary filter. Each custom vocabulary filter must contain terms in only one
// language. A custom vocabulary filter can only be used to transcribe files in the
// same language as the filter. For example, if you create a custom vocabulary
// filter using US English ( en-US ), you can only apply this filter to files that
// contain English audio. For a list of supported languages and their associated
// language codes, refer to the Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table.
LanguageCode LanguageCode
// The date and time the specified custom vocabulary filter was last modified.
// Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// A unique name, chosen by you, for your custom vocabulary filter. This name is
// case sensitive, cannot contain spaces, and must be unique within an Amazon Web
// Services account.
VocabularyFilterName *string
noSmithyDocumentSerde
}
// Provides information about a custom vocabulary, including the language of the
// custom vocabulary, when it was last modified, its name, and the processing
// state.
type VocabularyInfo struct {
// The language code used to create your custom vocabulary. Each custom vocabulary
// must contain terms in only one language. A custom vocabulary can only be used to
// transcribe files in the same language as the custom vocabulary. For example, if
// you create a custom vocabulary using US English ( en-US ), you can only apply
// this custom vocabulary to files that contain English audio.
LanguageCode LanguageCode
// The date and time the specified custom vocabulary was last modified. Timestamps
// are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC . For example,
// 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022.
LastModifiedTime *time.Time
// A unique name, chosen by you, for your custom vocabulary. This name is case
// sensitive, cannot contain spaces, and must be unique within an Amazon Web
// Services account.
VocabularyName *string
// The processing state of your custom vocabulary. If the state is READY , you can
// use the custom vocabulary in a StartTranscriptionJob request.
VocabularyState VocabularyState
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
// UnknownUnionMember is returned when a union member is returned over the wire,
// but has an unknown tag.
type UnknownUnionMember struct {
Tag string
Value []byte
noSmithyDocumentSerde
}
func (*UnknownUnionMember) isRule() {}
| 1,527 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types_test
import (
"fmt"
"github.com/aws/aws-sdk-go-v2/service/transcribe/types"
)
func ExampleRule_outputUsage() {
var union types.Rule
// type switches can be used to check the union value
switch v := union.(type) {
case *types.RuleMemberInterruptionFilter:
_ = v.Value // Value is types.InterruptionFilter
case *types.RuleMemberNonTalkTimeFilter:
_ = v.Value // Value is types.NonTalkTimeFilter
case *types.RuleMemberSentimentFilter:
_ = v.Value // Value is types.SentimentFilter
case *types.RuleMemberTranscriptFilter:
_ = v.Value // Value is types.TranscriptFilter
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.NonTalkTimeFilter
var _ *types.SentimentFilter
var _ *types.TranscriptFilter
var _ *types.InterruptionFilter
| 39 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribestreaming
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "Transcribe Streaming"
const ServiceAPIVersion = "2017-10-26"
// Client provides the API client to make operations call for Amazon Transcribe
// Streaming Service.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
setSafeEventStreamClientLogMode(&options, opID)
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "transcribestreaming", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 437 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribestreaming
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribestreaming
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribestreaming/types"
"github.com/aws/smithy-go/middleware"
smithysync "github.com/aws/smithy-go/sync"
smithyhttp "github.com/aws/smithy-go/transport/http"
"sync"
"time"
)
// Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed to
// Amazon Transcribe and the transcription results are streamed to your
// application. Use this operation for Call Analytics (https://docs.aws.amazon.com/transcribe/latest/dg/call-analytics.html)
// transcriptions. The following parameters are required:
// - language-code
// - media-encoding
// - sample-rate
//
// For more information on streaming with Amazon Transcribe, see Transcribing
// streaming audio (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html)
// .
func (c *Client) StartCallAnalyticsStreamTranscription(ctx context.Context, params *StartCallAnalyticsStreamTranscriptionInput, optFns ...func(*Options)) (*StartCallAnalyticsStreamTranscriptionOutput, error) {
if params == nil {
params = &StartCallAnalyticsStreamTranscriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartCallAnalyticsStreamTranscription", params, optFns, c.addOperationStartCallAnalyticsStreamTranscriptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartCallAnalyticsStreamTranscriptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartCallAnalyticsStreamTranscriptionInput struct {
// Specify the language code that represents the language spoken in your audio. If
// you're unsure of the language spoken in your audio, consider using
// IdentifyLanguage to enable automatic language identification. For a list of
// languages supported with streaming Call Analytics, refer to the Supported
// languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table.
//
// This member is required.
LanguageCode types.CallAnalyticsLanguageCode
// Specify the encoding of your input audio. Supported formats are:
// - FLAC
// - OPUS-encoded audio in an Ogg container
// - PCM (only signed 16-bit little-endian audio formats, which does not include
// WAV)
// For more information, see Media formats (https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio)
// .
//
// This member is required.
MediaEncoding types.MediaEncoding
// The sample rate of the input audio (in hertz). Low-quality audio, such as
// telephone audio, is typically around 8,000 Hz. High-quality audio typically
// ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate you specify must
// match that of your audio.
//
// This member is required.
MediaSampleRateHertz *int32
// Labels all personally identifiable information (PII) identified in your
// transcript. Content identification is performed at the segment level; PII
// specified in PiiEntityTypes is flagged upon complete transcription of an audio
// segment. You can’t set ContentIdentificationType and ContentRedactionType in
// the same request. If you set both, your request returns a BadRequestException .
// For more information, see Redacting or identifying personally identifiable
// information (https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html)
// .
ContentIdentificationType types.ContentIdentificationType
// Redacts all personally identifiable information (PII) identified in your
// transcript. Content redaction is performed at the segment level; PII specified
// in PiiEntityTypes is redacted upon complete transcription of an audio segment.
// You can’t set ContentRedactionType and ContentIdentificationType in the same
// request. If you set both, your request returns a BadRequestException . For more
// information, see Redacting or identifying personally identifiable information (https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html)
// .
ContentRedactionType types.ContentRedactionType
// Enables partial result stabilization for your transcription. Partial result
// stabilization can reduce latency in your output, but may impact accuracy. For
// more information, see Partial-result stabilization (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization)
// .
EnablePartialResultsStabilization bool
// Specify the name of the custom language model that you want to use when
// processing your transcription. Note that language model names are case
// sensitive. The language of the specified language model must match the language
// code you specify in your transcription request. If the languages don't match,
// the custom language model isn't applied. There are no errors or warnings
// associated with a language mismatch. For more information, see Custom language
// models (https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html)
// .
LanguageModelName *string
// Specify the level of stability to use when you enable partial results
// stabilization ( EnablePartialResultsStabilization ). Low stability provides the
// highest accuracy. High stability transcribes faster, but with slightly lower
// accuracy. For more information, see Partial-result stabilization (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization)
// .
PartialResultsStability types.PartialResultsStability
// Specify which types of personally identifiable information (PII) you want to
// redact in your transcript. You can include as many types as you'd like, or you
// can select ALL . To include PiiEntityTypes in your Call Analytics request, you
// must also include either ContentIdentificationType or ContentRedactionType .
// Values must be comma-separated and can include: BANK_ACCOUNT_NUMBER ,
// BANK_ROUTING , CREDIT_DEBIT_NUMBER , CREDIT_DEBIT_CVV , CREDIT_DEBIT_EXPIRY ,
// PIN , EMAIL , ADDRESS , NAME , PHONE , SSN , or ALL .
PiiEntityTypes *string
// Specify a name for your Call Analytics transcription session. If you don't
// include this parameter in your request, Amazon Transcribe generates an ID and
// returns it in the response. You can use a session ID to retry a streaming
// session.
SessionId *string
// Specify how you want your vocabulary filter applied to your transcript. To
// replace words with *** , choose mask . To delete words, choose remove . To flag
// words without changing them, choose tag .
VocabularyFilterMethod types.VocabularyFilterMethod
// Specify the name of the custom vocabulary filter that you want to use when
// processing your transcription. Note that vocabulary filter names are case
// sensitive. If the language of the specified custom vocabulary filter doesn't
// match the language identified in your media, the vocabulary filter is not
// applied to your transcription. For more information, see Using vocabulary
// filtering with unwanted words (https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html)
// .
VocabularyFilterName *string
// Specify the name of the custom vocabulary that you want to use when processing
// your transcription. Note that vocabulary names are case sensitive. If the
// language of the specified custom vocabulary doesn't match the language
// identified in your media, the custom vocabulary is not applied to your
// transcription. For more information, see Custom vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html)
// .
VocabularyName *string
noSmithyDocumentSerde
}
type StartCallAnalyticsStreamTranscriptionOutput struct {
// Shows whether content identification was enabled for your Call Analytics
// transcription.
ContentIdentificationType types.ContentIdentificationType
// Shows whether content redaction was enabled for your Call Analytics
// transcription.
ContentRedactionType types.ContentRedactionType
// Shows whether partial results stabilization was enabled for your Call Analytics
// transcription.
EnablePartialResultsStabilization bool
// Provides the language code that you specified in your Call Analytics request.
LanguageCode types.CallAnalyticsLanguageCode
// Provides the name of the custom language model that you specified in your Call
// Analytics request.
LanguageModelName *string
// Provides the media encoding you specified in your Call Analytics request.
MediaEncoding types.MediaEncoding
// Provides the sample rate that you specified in your Call Analytics request.
MediaSampleRateHertz *int32
// Provides the stabilization level used for your transcription.
PartialResultsStability types.PartialResultsStability
// Lists the PII entity types you specified in your Call Analytics request.
PiiEntityTypes *string
// Provides the identifier for your Call Analytics streaming request.
RequestId *string
// Provides the identifier for your Call Analytics transcription session.
SessionId *string
// Provides the vocabulary filtering method used in your Call Analytics
// transcription.
VocabularyFilterMethod types.VocabularyFilterMethod
// Provides the name of the custom vocabulary filter that you specified in your
// Call Analytics request.
VocabularyFilterName *string
// Provides the name of the custom vocabulary that you specified in your Call
// Analytics request.
VocabularyName *string
eventStream *StartCallAnalyticsStreamTranscriptionEventStream
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
// GetStream returns the type to interact with the event stream.
func (o *StartCallAnalyticsStreamTranscriptionOutput) GetStream() *StartCallAnalyticsStreamTranscriptionEventStream {
return o.eventStream
}
func (c *Client) addOperationStartCallAnalyticsStreamTranscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartCallAnalyticsStreamTranscription{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartCallAnalyticsStreamTranscription{}, middleware.After)
if err != nil {
return err
}
if err = addEventStreamStartCallAnalyticsStreamTranscriptionMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddRequireMinimumProtocol(stack, 2, 0); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddStreamingEventsPayload(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = eventstreamapi.AddInitializeStreamWriter(stack); err != nil {
return err
}
if err = addOpStartCallAnalyticsStreamTranscriptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartCallAnalyticsStreamTranscription(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartCallAnalyticsStreamTranscription(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "StartCallAnalyticsStreamTranscription",
}
}
// StartCallAnalyticsStreamTranscriptionEventStream provides the event stream handling for the StartCallAnalyticsStreamTranscription operation.
//
// For testing and mocking the event stream this type should be initialized via
// the NewStartCallAnalyticsStreamTranscriptionEventStream constructor function. Using the functional options
// to pass in nested mock behavior.
type StartCallAnalyticsStreamTranscriptionEventStream struct {
// AudioStreamWriter is the EventStream writer for the AudioStream events. This
// value is automatically set by the SDK when the API call is made Use this member
// when unit testing your code with the SDK to mock out the EventStream Writer.
//
// Must not be nil.
Writer AudioStreamWriter
// CallAnalyticsTranscriptResultStreamReader is the EventStream reader for the
// CallAnalyticsTranscriptResultStream events. This value is automatically set by
// the SDK when the API call is made Use this member when unit testing your code
// with the SDK to mock out the EventStream Reader.
//
// Must not be nil.
Reader CallAnalyticsTranscriptResultStreamReader
done chan struct{}
closeOnce sync.Once
err *smithysync.OnceErr
}
// NewStartCallAnalyticsStreamTranscriptionEventStream initializes an StartCallAnalyticsStreamTranscriptionEventStream.
// This function should only be used for testing and mocking the StartCallAnalyticsStreamTranscriptionEventStream
// stream within your application.
//
// The Writer member must be set before writing events to the stream.
//
// The Reader member must be set before reading events from the stream.
func NewStartCallAnalyticsStreamTranscriptionEventStream(optFns ...func(*StartCallAnalyticsStreamTranscriptionEventStream)) *StartCallAnalyticsStreamTranscriptionEventStream {
es := &StartCallAnalyticsStreamTranscriptionEventStream{
done: make(chan struct{}),
err: smithysync.NewOnceErr(),
}
for _, fn := range optFns {
fn(es)
}
return es
}
// Send writes the event to the stream blocking until the event is written.
// Returns an error if the event was not written.
func (es *StartCallAnalyticsStreamTranscriptionEventStream) Send(ctx context.Context, event types.AudioStream) error {
return es.Writer.Send(ctx, event)
}
// Events returns a channel to read events from.
func (es *StartCallAnalyticsStreamTranscriptionEventStream) Events() <-chan types.CallAnalyticsTranscriptResultStream {
return es.Reader.Events()
}
// Close closes the stream. This will also cause the stream to be closed.
// Close must be called when done using the stream API. Not calling Close
// may result in resource leaks.
//
// Will close the underlying EventStream writer and reader, and no more events can be
// sent or received.
func (es *StartCallAnalyticsStreamTranscriptionEventStream) Close() error {
es.closeOnce.Do(es.safeClose)
return es.Err()
}
func (es *StartCallAnalyticsStreamTranscriptionEventStream) safeClose() {
close(es.done)
t := time.NewTicker(time.Second)
defer t.Stop()
writeCloseDone := make(chan error)
go func() {
if err := es.Writer.Close(); err != nil {
es.err.SetError(err)
}
close(writeCloseDone)
}()
select {
case <-t.C:
case <-writeCloseDone:
}
es.Reader.Close()
}
// Err returns any error that occurred while reading or writing EventStream Events
// from the service API's response. Returns nil if there were no errors.
func (es *StartCallAnalyticsStreamTranscriptionEventStream) Err() error {
if err := es.err.Err(); err != nil {
return err
}
if err := es.Writer.Err(); err != nil {
return err
}
if err := es.Reader.Err(); err != nil {
return err
}
return nil
}
func (es *StartCallAnalyticsStreamTranscriptionEventStream) waitStreamClose() {
type errorSet interface {
ErrorSet() <-chan struct{}
}
var inputErrCh <-chan struct{}
if v, ok := es.Writer.(errorSet); ok {
inputErrCh = v.ErrorSet()
}
var outputErrCh <-chan struct{}
if v, ok := es.Reader.(errorSet); ok {
outputErrCh = v.ErrorSet()
}
var outputClosedCh <-chan struct{}
if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok {
outputClosedCh = v.Closed()
}
select {
case <-es.done:
case <-inputErrCh:
es.err.SetError(es.Writer.Err())
es.Close()
case <-outputErrCh:
es.err.SetError(es.Reader.Err())
es.Close()
case <-outputClosedCh:
if err := es.Reader.Err(); err != nil {
es.err.SetError(es.Reader.Err())
}
es.Close()
}
}
| 440 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribestreaming
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribestreaming/types"
"github.com/aws/smithy-go/middleware"
smithysync "github.com/aws/smithy-go/sync"
smithyhttp "github.com/aws/smithy-go/transport/http"
"sync"
"time"
)
// Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed to
// Amazon Transcribe Medical and the transcription results are streamed to your
// application. The following parameters are required:
// - language-code
// - media-encoding
// - sample-rate
//
// For more information on streaming with Amazon Transcribe Medical, see
// Transcribing streaming audio (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html)
// .
func (c *Client) StartMedicalStreamTranscription(ctx context.Context, params *StartMedicalStreamTranscriptionInput, optFns ...func(*Options)) (*StartMedicalStreamTranscriptionOutput, error) {
if params == nil {
params = &StartMedicalStreamTranscriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartMedicalStreamTranscription", params, optFns, c.addOperationStartMedicalStreamTranscriptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartMedicalStreamTranscriptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartMedicalStreamTranscriptionInput struct {
// Specify the language code that represents the language spoken in your audio.
// Amazon Transcribe Medical only supports US English ( en-US ).
//
// This member is required.
LanguageCode types.LanguageCode
// Specify the encoding used for the input audio. Supported formats are:
// - FLAC
// - OPUS-encoded audio in an Ogg container
// - PCM (only signed 16-bit little-endian audio formats, which does not include
// WAV)
// For more information, see Media formats (https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio)
// .
//
// This member is required.
MediaEncoding types.MediaEncoding
// The sample rate of the input audio (in hertz). Amazon Transcribe Medical
// supports a range from 16,000 Hz to 48,000 Hz. Note that the sample rate you
// specify must match that of your audio.
//
// This member is required.
MediaSampleRateHertz *int32
// Specify the medical specialty contained in your audio.
//
// This member is required.
Specialty types.Specialty
// Specify the type of input audio. For example, choose DICTATION for a provider
// dictating patient notes and CONVERSATION for a dialogue between a patient and a
// medical professional.
//
// This member is required.
Type types.Type
// Labels all personal health information (PHI) identified in your transcript.
// Content identification is performed at the segment level; PHI is flagged upon
// complete transcription of an audio segment. For more information, see
// Identifying personal health information (PHI) in a transcription (https://docs.aws.amazon.com/transcribe/latest/dg/phi-id.html)
// .
ContentIdentificationType types.MedicalContentIdentificationType
// Enables channel identification in multi-channel audio. Channel identification
// transcribes the audio on each channel independently, then appends the output for
// each channel into one transcript. If you have multi-channel audio and do not
// enable channel identification, your audio is transcribed in a continuous manner
// and your transcript is not separated by channel. For more information, see
// Transcribing multi-channel audio (https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html)
// .
EnableChannelIdentification bool
// Specify the number of channels in your audio stream. Up to two channels are
// supported.
NumberOfChannels *int32
// Specify a name for your transcription session. If you don't include this
// parameter in your request, Amazon Transcribe Medical generates an ID and returns
// it in the response. You can use a session ID to retry a streaming session.
SessionId *string
// Enables speaker partitioning (diarization) in your transcription output.
// Speaker partitioning labels the speech from individual speakers in your media
// file. For more information, see Partitioning speakers (diarization) (https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html)
// .
ShowSpeakerLabel bool
// Specify the name of the custom vocabulary that you want to use when processing
// your transcription. Note that vocabulary names are case sensitive.
VocabularyName *string
noSmithyDocumentSerde
}
type StartMedicalStreamTranscriptionOutput struct {
// Shows whether content identification was enabled for your transcription.
ContentIdentificationType types.MedicalContentIdentificationType
// Shows whether channel identification was enabled for your transcription.
EnableChannelIdentification bool
// Provides the language code that you specified in your request. This must be
// en-US .
LanguageCode types.LanguageCode
// Provides the media encoding you specified in your request.
MediaEncoding types.MediaEncoding
// Provides the sample rate that you specified in your request.
MediaSampleRateHertz *int32
// Provides the number of channels that you specified in your request.
NumberOfChannels *int32
// Provides the identifier for your streaming request.
RequestId *string
// Provides the identifier for your transcription session.
SessionId *string
// Shows whether speaker partitioning was enabled for your transcription.
ShowSpeakerLabel bool
// Provides the medical specialty that you specified in your request.
Specialty types.Specialty
// Provides the type of audio you specified in your request.
Type types.Type
// Provides the name of the custom vocabulary that you specified in your request.
VocabularyName *string
eventStream *StartMedicalStreamTranscriptionEventStream
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
// GetStream returns the type to interact with the event stream.
func (o *StartMedicalStreamTranscriptionOutput) GetStream() *StartMedicalStreamTranscriptionEventStream {
return o.eventStream
}
func (c *Client) addOperationStartMedicalStreamTranscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartMedicalStreamTranscription{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartMedicalStreamTranscription{}, middleware.After)
if err != nil {
return err
}
if err = addEventStreamStartMedicalStreamTranscriptionMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddRequireMinimumProtocol(stack, 2, 0); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddStreamingEventsPayload(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = eventstreamapi.AddInitializeStreamWriter(stack); err != nil {
return err
}
if err = addOpStartMedicalStreamTranscriptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartMedicalStreamTranscription(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartMedicalStreamTranscription(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "StartMedicalStreamTranscription",
}
}
// StartMedicalStreamTranscriptionEventStream provides the event stream handling for the StartMedicalStreamTranscription operation.
//
// For testing and mocking the event stream this type should be initialized via
// the NewStartMedicalStreamTranscriptionEventStream constructor function. Using the functional options
// to pass in nested mock behavior.
type StartMedicalStreamTranscriptionEventStream struct {
// AudioStreamWriter is the EventStream writer for the AudioStream events. This
// value is automatically set by the SDK when the API call is made Use this member
// when unit testing your code with the SDK to mock out the EventStream Writer.
//
// Must not be nil.
Writer AudioStreamWriter
// MedicalTranscriptResultStreamReader is the EventStream reader for the
// MedicalTranscriptResultStream events. This value is automatically set by the SDK
// when the API call is made Use this member when unit testing your code with the
// SDK to mock out the EventStream Reader.
//
// Must not be nil.
Reader MedicalTranscriptResultStreamReader
done chan struct{}
closeOnce sync.Once
err *smithysync.OnceErr
}
// NewStartMedicalStreamTranscriptionEventStream initializes an StartMedicalStreamTranscriptionEventStream.
// This function should only be used for testing and mocking the StartMedicalStreamTranscriptionEventStream
// stream within your application.
//
// The Writer member must be set before writing events to the stream.
//
// The Reader member must be set before reading events from the stream.
func NewStartMedicalStreamTranscriptionEventStream(optFns ...func(*StartMedicalStreamTranscriptionEventStream)) *StartMedicalStreamTranscriptionEventStream {
es := &StartMedicalStreamTranscriptionEventStream{
done: make(chan struct{}),
err: smithysync.NewOnceErr(),
}
for _, fn := range optFns {
fn(es)
}
return es
}
// Send writes the event to the stream blocking until the event is written.
// Returns an error if the event was not written.
func (es *StartMedicalStreamTranscriptionEventStream) Send(ctx context.Context, event types.AudioStream) error {
return es.Writer.Send(ctx, event)
}
// Events returns a channel to read events from.
func (es *StartMedicalStreamTranscriptionEventStream) Events() <-chan types.MedicalTranscriptResultStream {
return es.Reader.Events()
}
// Close closes the stream. This will also cause the stream to be closed.
// Close must be called when done using the stream API. Not calling Close
// may result in resource leaks.
//
// Will close the underlying EventStream writer and reader, and no more events can be
// sent or received.
func (es *StartMedicalStreamTranscriptionEventStream) Close() error {
es.closeOnce.Do(es.safeClose)
return es.Err()
}
func (es *StartMedicalStreamTranscriptionEventStream) safeClose() {
close(es.done)
t := time.NewTicker(time.Second)
defer t.Stop()
writeCloseDone := make(chan error)
go func() {
if err := es.Writer.Close(); err != nil {
es.err.SetError(err)
}
close(writeCloseDone)
}()
select {
case <-t.C:
case <-writeCloseDone:
}
es.Reader.Close()
}
// Err returns any error that occurred while reading or writing EventStream Events
// from the service API's response. Returns nil if there were no errors.
func (es *StartMedicalStreamTranscriptionEventStream) Err() error {
if err := es.err.Err(); err != nil {
return err
}
if err := es.Writer.Err(); err != nil {
return err
}
if err := es.Reader.Err(); err != nil {
return err
}
return nil
}
func (es *StartMedicalStreamTranscriptionEventStream) waitStreamClose() {
type errorSet interface {
ErrorSet() <-chan struct{}
}
var inputErrCh <-chan struct{}
if v, ok := es.Writer.(errorSet); ok {
inputErrCh = v.ErrorSet()
}
var outputErrCh <-chan struct{}
if v, ok := es.Reader.(errorSet); ok {
outputErrCh = v.ErrorSet()
}
var outputClosedCh <-chan struct{}
if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok {
outputClosedCh = v.Closed()
}
select {
case <-es.done:
case <-inputErrCh:
es.err.SetError(es.Writer.Err())
es.Close()
case <-outputErrCh:
es.err.SetError(es.Reader.Err())
es.Close()
case <-outputClosedCh:
if err := es.Reader.Err(); err != nil {
es.err.SetError(es.Reader.Err())
}
es.Close()
}
}
| 390 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribestreaming
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribestreaming/types"
"github.com/aws/smithy-go/middleware"
smithysync "github.com/aws/smithy-go/sync"
smithyhttp "github.com/aws/smithy-go/transport/http"
"sync"
"time"
)
// Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed to
// Amazon Transcribe and the transcription results are streamed to your
// application. The following parameters are required:
// - language-code or identify-language
// - media-encoding
// - sample-rate
//
// For more information on streaming with Amazon Transcribe, see Transcribing
// streaming audio (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html)
// .
func (c *Client) StartStreamTranscription(ctx context.Context, params *StartStreamTranscriptionInput, optFns ...func(*Options)) (*StartStreamTranscriptionOutput, error) {
if params == nil {
params = &StartStreamTranscriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartStreamTranscription", params, optFns, c.addOperationStartStreamTranscriptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartStreamTranscriptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartStreamTranscriptionInput struct {
// Specify the encoding of your input audio. Supported formats are:
// - FLAC
// - OPUS-encoded audio in an Ogg container
// - PCM (only signed 16-bit little-endian audio formats, which does not include
// WAV)
// For more information, see Media formats (https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio)
// .
//
// This member is required.
MediaEncoding types.MediaEncoding
// The sample rate of the input audio (in hertz). Low-quality audio, such as
// telephone audio, is typically around 8,000 Hz. High-quality audio typically
// ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate you specify must
// match that of your audio.
//
// This member is required.
MediaSampleRateHertz *int32
// Labels all personally identifiable information (PII) identified in your
// transcript. Content identification is performed at the segment level; PII
// specified in PiiEntityTypes is flagged upon complete transcription of an audio
// segment. You can’t set ContentIdentificationType and ContentRedactionType in
// the same request. If you set both, your request returns a BadRequestException .
// For more information, see Redacting or identifying personally identifiable
// information (https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html)
// .
ContentIdentificationType types.ContentIdentificationType
// Redacts all personally identifiable information (PII) identified in your
// transcript. Content redaction is performed at the segment level; PII specified
// in PiiEntityTypes is redacted upon complete transcription of an audio segment.
// You can’t set ContentRedactionType and ContentIdentificationType in the same
// request. If you set both, your request returns a BadRequestException . For more
// information, see Redacting or identifying personally identifiable information (https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html)
// .
ContentRedactionType types.ContentRedactionType
// Enables channel identification in multi-channel audio. Channel identification
// transcribes the audio on each channel independently, then appends the output for
// each channel into one transcript. If you have multi-channel audio and do not
// enable channel identification, your audio is transcribed in a continuous manner
// and your transcript is not separated by channel. For more information, see
// Transcribing multi-channel audio (https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html)
// .
EnableChannelIdentification bool
// Enables partial result stabilization for your transcription. Partial result
// stabilization can reduce latency in your output, but may impact accuracy. For
// more information, see Partial-result stabilization (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization)
// .
EnablePartialResultsStabilization bool
// Enables automatic language identification for your transcription. If you
// include IdentifyLanguage , you can optionally include a list of language codes,
// using LanguageOptions , that you think may be present in your audio stream.
// Including language options can improve transcription accuracy. You can also
// include a preferred language using PreferredLanguage . Adding a preferred
// language can help Amazon Transcribe identify the language faster than if you
// omit this parameter. If you have multi-channel audio that contains different
// languages on each channel, and you've enabled channel identification, automatic
// language identification identifies the dominant language on each audio channel.
// Note that you must include either LanguageCode or IdentifyLanguage in your
// request. If you include both parameters, your request fails. Streaming language
// identification can't be combined with custom language models or redaction.
IdentifyLanguage bool
// Specify the language code that represents the language spoken in your audio. If
// you're unsure of the language spoken in your audio, consider using
// IdentifyLanguage to enable automatic language identification. For a list of
// languages supported with Amazon Transcribe streaming, refer to the Supported
// languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table.
LanguageCode types.LanguageCode
// Specify the name of the custom language model that you want to use when
// processing your transcription. Note that language model names are case
// sensitive. The language of the specified language model must match the language
// code you specify in your transcription request. If the languages don't match,
// the custom language model isn't applied. There are no errors or warnings
// associated with a language mismatch. For more information, see Custom language
// models (https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html)
// .
LanguageModelName *string
// Specify two or more language codes that represent the languages you think may
// be present in your media; including more than five is not recommended. If you're
// unsure what languages are present, do not include this parameter. Including
// language options can improve the accuracy of language identification. If you
// include LanguageOptions in your request, you must also include IdentifyLanguage
// . For a list of languages supported with Amazon Transcribe streaming, refer to
// the Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
// table. You can only include one language dialect per language per stream. For
// example, you cannot include en-US and en-AU in the same request.
LanguageOptions *string
// Specify the number of channels in your audio stream. Up to two channels are
// supported.
NumberOfChannels *int32
// Specify the level of stability to use when you enable partial results
// stabilization ( EnablePartialResultsStabilization ). Low stability provides the
// highest accuracy. High stability transcribes faster, but with slightly lower
// accuracy. For more information, see Partial-result stabilization (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization)
// .
PartialResultsStability types.PartialResultsStability
// Specify which types of personally identifiable information (PII) you want to
// redact in your transcript. You can include as many types as you'd like, or you
// can select ALL . To include PiiEntityTypes in your request, you must also
// include either ContentIdentificationType or ContentRedactionType . Values must
// be comma-separated and can include: BANK_ACCOUNT_NUMBER , BANK_ROUTING ,
// CREDIT_DEBIT_NUMBER , CREDIT_DEBIT_CVV , CREDIT_DEBIT_EXPIRY , PIN , EMAIL ,
// ADDRESS , NAME , PHONE , SSN , or ALL .
PiiEntityTypes *string
// Specify a preferred language from the subset of languages codes you specified
// in LanguageOptions . You can only use this parameter if you've included
// IdentifyLanguage and LanguageOptions in your request.
PreferredLanguage types.LanguageCode
// Specify a name for your transcription session. If you don't include this
// parameter in your request, Amazon Transcribe generates an ID and returns it in
// the response. You can use a session ID to retry a streaming session.
SessionId *string
// Enables speaker partitioning (diarization) in your transcription output.
// Speaker partitioning labels the speech from individual speakers in your media
// file. For more information, see Partitioning speakers (diarization) (https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html)
// .
ShowSpeakerLabel bool
// Specify how you want your vocabulary filter applied to your transcript. To
// replace words with *** , choose mask . To delete words, choose remove . To flag
// words without changing them, choose tag .
VocabularyFilterMethod types.VocabularyFilterMethod
// Specify the name of the custom vocabulary filter that you want to use when
// processing your transcription. Note that vocabulary filter names are case
// sensitive. If the language of the specified custom vocabulary filter doesn't
// match the language identified in your media, the vocabulary filter is not
// applied to your transcription. This parameter is not intended for use with the
// IdentifyLanguage parameter. If you're including IdentifyLanguage in your
// request and want to use one or more vocabulary filters with your transcription,
// use the VocabularyFilterNames parameter instead. For more information, see
// Using vocabulary filtering with unwanted words (https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html)
// .
VocabularyFilterName *string
// Specify the names of the custom vocabulary filters that you want to use when
// processing your transcription. Note that vocabulary filter names are case
// sensitive. If none of the languages of the specified custom vocabulary filters
// match the language identified in your media, your job fails. This parameter is
// only intended for use with the IdentifyLanguage parameter. If you're not
// including IdentifyLanguage in your request and want to use a custom vocabulary
// filter with your transcription, use the VocabularyFilterName parameter instead.
// For more information, see Using vocabulary filtering with unwanted words (https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html)
// .
VocabularyFilterNames *string
// Specify the name of the custom vocabulary that you want to use when processing
// your transcription. Note that vocabulary names are case sensitive. If the
// language of the specified custom vocabulary doesn't match the language
// identified in your media, the custom vocabulary is not applied to your
// transcription. This parameter is not intended for use with the IdentifyLanguage
// parameter. If you're including IdentifyLanguage in your request and want to use
// one or more custom vocabularies with your transcription, use the VocabularyNames
// parameter instead. For more information, see Custom vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html)
// .
VocabularyName *string
// Specify the names of the custom vocabularies that you want to use when
// processing your transcription. Note that vocabulary names are case sensitive. If
// none of the languages of the specified custom vocabularies match the language
// identified in your media, your job fails. This parameter is only intended for
// use with the IdentifyLanguage parameter. If you're not including
// IdentifyLanguage in your request and want to use a custom vocabulary with your
// transcription, use the VocabularyName parameter instead. For more information,
// see Custom vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html)
// .
VocabularyNames *string
noSmithyDocumentSerde
}
type StartStreamTranscriptionOutput struct {
// Shows whether content identification was enabled for your transcription.
ContentIdentificationType types.ContentIdentificationType
// Shows whether content redaction was enabled for your transcription.
ContentRedactionType types.ContentRedactionType
// Shows whether channel identification was enabled for your transcription.
EnableChannelIdentification bool
// Shows whether partial results stabilization was enabled for your transcription.
EnablePartialResultsStabilization bool
// Shows whether automatic language identification was enabled for your
// transcription.
IdentifyLanguage bool
// Provides the language code that you specified in your request.
LanguageCode types.LanguageCode
// Provides the name of the custom language model that you specified in your
// request.
LanguageModelName *string
// Provides the language codes that you specified in your request.
LanguageOptions *string
// Provides the media encoding you specified in your request.
MediaEncoding types.MediaEncoding
// Provides the sample rate that you specified in your request.
MediaSampleRateHertz *int32
// Provides the number of channels that you specified in your request.
NumberOfChannels *int32
// Provides the stabilization level used for your transcription.
PartialResultsStability types.PartialResultsStability
// Lists the PII entity types you specified in your request.
PiiEntityTypes *string
// Provides the preferred language that you specified in your request.
PreferredLanguage types.LanguageCode
// Provides the identifier for your streaming request.
RequestId *string
// Provides the identifier for your transcription session.
SessionId *string
// Shows whether speaker partitioning was enabled for your transcription.
ShowSpeakerLabel bool
// Provides the vocabulary filtering method used in your transcription.
VocabularyFilterMethod types.VocabularyFilterMethod
// Provides the name of the custom vocabulary filter that you specified in your
// request.
VocabularyFilterName *string
// Provides the names of the custom vocabulary filters that you specified in your
// request.
VocabularyFilterNames *string
// Provides the name of the custom vocabulary that you specified in your request.
VocabularyName *string
// Provides the names of the custom vocabularies that you specified in your
// request.
VocabularyNames *string
eventStream *StartStreamTranscriptionEventStream
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
// GetStream returns the type to interact with the event stream.
func (o *StartStreamTranscriptionOutput) GetStream() *StartStreamTranscriptionEventStream {
return o.eventStream
}
func (c *Client) addOperationStartStreamTranscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartStreamTranscription{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartStreamTranscription{}, middleware.After)
if err != nil {
return err
}
if err = addEventStreamStartStreamTranscriptionMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddRequireMinimumProtocol(stack, 2, 0); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddStreamingEventsPayload(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = eventstreamapi.AddInitializeStreamWriter(stack); err != nil {
return err
}
if err = addOpStartStreamTranscriptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartStreamTranscription(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartStreamTranscription(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transcribe",
OperationName: "StartStreamTranscription",
}
}
// StartStreamTranscriptionEventStream provides the event stream handling for the StartStreamTranscription operation.
//
// For testing and mocking the event stream this type should be initialized via
// the NewStartStreamTranscriptionEventStream constructor function. Using the functional options
// to pass in nested mock behavior.
type StartStreamTranscriptionEventStream struct {
// AudioStreamWriter is the EventStream writer for the AudioStream events. This
// value is automatically set by the SDK when the API call is made Use this member
// when unit testing your code with the SDK to mock out the EventStream Writer.
//
// Must not be nil.
Writer AudioStreamWriter
// TranscriptResultStreamReader is the EventStream reader for the
// TranscriptResultStream events. This value is automatically set by the SDK when
// the API call is made Use this member when unit testing your code with the SDK to
// mock out the EventStream Reader.
//
// Must not be nil.
Reader TranscriptResultStreamReader
done chan struct{}
closeOnce sync.Once
err *smithysync.OnceErr
}
// NewStartStreamTranscriptionEventStream initializes an StartStreamTranscriptionEventStream.
// This function should only be used for testing and mocking the StartStreamTranscriptionEventStream
// stream within your application.
//
// The Writer member must be set before writing events to the stream.
//
// The Reader member must be set before reading events from the stream.
func NewStartStreamTranscriptionEventStream(optFns ...func(*StartStreamTranscriptionEventStream)) *StartStreamTranscriptionEventStream {
es := &StartStreamTranscriptionEventStream{
done: make(chan struct{}),
err: smithysync.NewOnceErr(),
}
for _, fn := range optFns {
fn(es)
}
return es
}
// Send writes the event to the stream blocking until the event is written.
// Returns an error if the event was not written.
func (es *StartStreamTranscriptionEventStream) Send(ctx context.Context, event types.AudioStream) error {
return es.Writer.Send(ctx, event)
}
// Events returns a channel to read events from.
func (es *StartStreamTranscriptionEventStream) Events() <-chan types.TranscriptResultStream {
return es.Reader.Events()
}
// Close closes the stream. This will also cause the stream to be closed.
// Close must be called when done using the stream API. Not calling Close
// may result in resource leaks.
//
// Will close the underlying EventStream writer and reader, and no more events can be
// sent or received.
func (es *StartStreamTranscriptionEventStream) Close() error {
es.closeOnce.Do(es.safeClose)
return es.Err()
}
func (es *StartStreamTranscriptionEventStream) safeClose() {
close(es.done)
t := time.NewTicker(time.Second)
defer t.Stop()
writeCloseDone := make(chan error)
go func() {
if err := es.Writer.Close(); err != nil {
es.err.SetError(err)
}
close(writeCloseDone)
}()
select {
case <-t.C:
case <-writeCloseDone:
}
es.Reader.Close()
}
// Err returns any error that occurred while reading or writing EventStream Events
// from the service API's response. Returns nil if there were no errors.
func (es *StartStreamTranscriptionEventStream) Err() error {
if err := es.err.Err(); err != nil {
return err
}
if err := es.Writer.Err(); err != nil {
return err
}
if err := es.Reader.Err(); err != nil {
return err
}
return nil
}
func (es *StartStreamTranscriptionEventStream) waitStreamClose() {
type errorSet interface {
ErrorSet() <-chan struct{}
}
var inputErrCh <-chan struct{}
if v, ok := es.Writer.(errorSet); ok {
inputErrCh = v.ErrorSet()
}
var outputErrCh <-chan struct{}
if v, ok := es.Reader.(errorSet); ok {
outputErrCh = v.ErrorSet()
}
var outputClosedCh <-chan struct{}
if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok {
outputClosedCh = v.Closed()
}
select {
case <-es.done:
case <-inputErrCh:
es.err.SetError(es.Writer.Err())
es.Close()
case <-outputErrCh:
es.err.SetError(es.Reader.Err())
es.Close()
case <-outputClosedCh:
if err := es.Reader.Err(); err != nil {
es.err.SetError(es.Reader.Err())
}
es.Close()
}
}
| 535 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribestreaming
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/transcribestreaming/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"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"math"
"strconv"
"strings"
)
type awsRestjson1_deserializeOpStartCallAnalyticsStreamTranscription struct {
}
func (*awsRestjson1_deserializeOpStartCallAnalyticsStreamTranscription) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStartCallAnalyticsStreamTranscription) 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_deserializeOpErrorStartCallAnalyticsStreamTranscription(response, &metadata)
}
output := &StartCallAnalyticsStreamTranscriptionOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsStartCallAnalyticsStreamTranscriptionOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorStartCallAnalyticsStreamTranscription(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsStartCallAnalyticsStreamTranscriptionOutput(v *StartCallAnalyticsStreamTranscriptionOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("x-amzn-transcribe-content-identification-type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentIdentificationType = types.ContentIdentificationType(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-content-redaction-type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentRedactionType = types.ContentRedactionType(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-enable-partial-results-stabilization"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseBool(headerValues[0])
if err != nil {
return err
}
v.EnablePartialResultsStabilization = vv
}
if headerValues := response.Header.Values("x-amzn-transcribe-language-code"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.LanguageCode = types.CallAnalyticsLanguageCode(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-language-model-name"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.LanguageModelName = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-media-encoding"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.MediaEncoding = types.MediaEncoding(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-sample-rate"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseInt(headerValues[0], 0, 32)
if err != nil {
return err
}
v.MediaSampleRateHertz = ptr.Int32(int32(vv))
}
if headerValues := response.Header.Values("x-amzn-transcribe-partial-results-stability"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.PartialResultsStability = types.PartialResultsStability(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-pii-entity-types"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.PiiEntityTypes = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-request-id"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.RequestId = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-session-id"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SessionId = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-vocabulary-filter-method"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.VocabularyFilterMethod = types.VocabularyFilterMethod(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-vocabulary-filter-name"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.VocabularyFilterName = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-vocabulary-name"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.VocabularyName = ptr.String(headerValues[0])
}
return nil
}
type awsRestjson1_deserializeOpStartMedicalStreamTranscription struct {
}
func (*awsRestjson1_deserializeOpStartMedicalStreamTranscription) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStartMedicalStreamTranscription) 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_deserializeOpErrorStartMedicalStreamTranscription(response, &metadata)
}
output := &StartMedicalStreamTranscriptionOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsStartMedicalStreamTranscriptionOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorStartMedicalStreamTranscription(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsStartMedicalStreamTranscriptionOutput(v *StartMedicalStreamTranscriptionOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("x-amzn-transcribe-content-identification-type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentIdentificationType = types.MedicalContentIdentificationType(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-enable-channel-identification"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseBool(headerValues[0])
if err != nil {
return err
}
v.EnableChannelIdentification = vv
}
if headerValues := response.Header.Values("x-amzn-transcribe-language-code"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.LanguageCode = types.LanguageCode(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-media-encoding"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.MediaEncoding = types.MediaEncoding(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-sample-rate"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseInt(headerValues[0], 0, 32)
if err != nil {
return err
}
v.MediaSampleRateHertz = ptr.Int32(int32(vv))
}
if headerValues := response.Header.Values("x-amzn-transcribe-number-of-channels"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseInt(headerValues[0], 0, 32)
if err != nil {
return err
}
v.NumberOfChannels = ptr.Int32(int32(vv))
}
if headerValues := response.Header.Values("x-amzn-request-id"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.RequestId = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-session-id"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SessionId = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-show-speaker-label"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseBool(headerValues[0])
if err != nil {
return err
}
v.ShowSpeakerLabel = vv
}
if headerValues := response.Header.Values("x-amzn-transcribe-specialty"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.Specialty = types.Specialty(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.Type = types.Type(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-vocabulary-name"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.VocabularyName = ptr.String(headerValues[0])
}
return nil
}
type awsRestjson1_deserializeOpStartStreamTranscription struct {
}
func (*awsRestjson1_deserializeOpStartStreamTranscription) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStartStreamTranscription) 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_deserializeOpErrorStartStreamTranscription(response, &metadata)
}
output := &StartStreamTranscriptionOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsStartStreamTranscriptionOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorStartStreamTranscription(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsStartStreamTranscriptionOutput(v *StartStreamTranscriptionOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("x-amzn-transcribe-content-identification-type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentIdentificationType = types.ContentIdentificationType(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-content-redaction-type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentRedactionType = types.ContentRedactionType(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-enable-channel-identification"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseBool(headerValues[0])
if err != nil {
return err
}
v.EnableChannelIdentification = vv
}
if headerValues := response.Header.Values("x-amzn-transcribe-enable-partial-results-stabilization"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseBool(headerValues[0])
if err != nil {
return err
}
v.EnablePartialResultsStabilization = vv
}
if headerValues := response.Header.Values("x-amzn-transcribe-identify-language"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseBool(headerValues[0])
if err != nil {
return err
}
v.IdentifyLanguage = vv
}
if headerValues := response.Header.Values("x-amzn-transcribe-language-code"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.LanguageCode = types.LanguageCode(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-language-model-name"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.LanguageModelName = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-language-options"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.LanguageOptions = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-media-encoding"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.MediaEncoding = types.MediaEncoding(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-sample-rate"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseInt(headerValues[0], 0, 32)
if err != nil {
return err
}
v.MediaSampleRateHertz = ptr.Int32(int32(vv))
}
if headerValues := response.Header.Values("x-amzn-transcribe-number-of-channels"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseInt(headerValues[0], 0, 32)
if err != nil {
return err
}
v.NumberOfChannels = ptr.Int32(int32(vv))
}
if headerValues := response.Header.Values("x-amzn-transcribe-partial-results-stability"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.PartialResultsStability = types.PartialResultsStability(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-pii-entity-types"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.PiiEntityTypes = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-preferred-language"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.PreferredLanguage = types.LanguageCode(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-request-id"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.RequestId = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-session-id"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SessionId = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-show-speaker-label"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseBool(headerValues[0])
if err != nil {
return err
}
v.ShowSpeakerLabel = vv
}
if headerValues := response.Header.Values("x-amzn-transcribe-vocabulary-filter-method"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.VocabularyFilterMethod = types.VocabularyFilterMethod(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-vocabulary-filter-name"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.VocabularyFilterName = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-vocabulary-filter-names"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.VocabularyFilterNames = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-vocabulary-name"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.VocabularyName = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amzn-transcribe-vocabulary-names"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.VocabularyNames = ptr.String(headerValues[0])
}
return nil
}
func awsRestjson1_deserializeEventStreamCallAnalyticsTranscriptResultStream(v *types.CallAnalyticsTranscriptResultStream, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
eventType := msg.Headers.Get(eventstreamapi.EventTypeHeader)
if eventType == nil {
return fmt.Errorf("%s event header not present", eventstreamapi.EventTypeHeader)
}
switch {
case strings.EqualFold("CategoryEvent", eventType.String()):
vv := &types.CallAnalyticsTranscriptResultStreamMemberCategoryEvent{}
if err := awsRestjson1_deserializeEventMessageCategoryEvent(&vv.Value, msg); err != nil {
return err
}
*v = vv
return nil
case strings.EqualFold("UtteranceEvent", eventType.String()):
vv := &types.CallAnalyticsTranscriptResultStreamMemberUtteranceEvent{}
if err := awsRestjson1_deserializeEventMessageUtteranceEvent(&vv.Value, msg); err != nil {
return err
}
*v = vv
return nil
default:
buffer := bytes.NewBuffer(nil)
eventstream.NewEncoder().Encode(buffer, *msg)
*v = &types.UnknownUnionMember{
Tag: eventType.String(),
Value: buffer.Bytes(),
}
return nil
}
}
func awsRestjson1_deserializeEventStreamExceptionCallAnalyticsTranscriptResultStream(msg *eventstream.Message) error {
exceptionType := msg.Headers.Get(eventstreamapi.ExceptionTypeHeader)
if exceptionType == nil {
return fmt.Errorf("%s event header not present", eventstreamapi.ExceptionTypeHeader)
}
switch {
case strings.EqualFold("BadRequestException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionBadRequestException(msg)
case strings.EqualFold("ConflictException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionConflictException(msg)
case strings.EqualFold("InternalFailureException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionInternalFailureException(msg)
case strings.EqualFold("LimitExceededException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionLimitExceededException(msg)
case strings.EqualFold("ServiceUnavailableException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionServiceUnavailableException(msg)
default:
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
code, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
return err
}
errorCode := "UnknownError"
errorMessage := errorCode
if ev := exceptionType.String(); len(ev) > 0 {
errorCode = ev
} else if ev := code; len(ev) > 0 {
errorCode = ev
}
if ev := message; len(ev) > 0 {
errorMessage = ev
}
return &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
}
}
func awsRestjson1_deserializeEventMessageUtteranceEvent(v *types.UtteranceEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, 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
}
if err := awsRestjson1_deserializeDocumentUtteranceEvent(&v, shape); err != nil {
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
}
}
return nil
}
func awsRestjson1_deserializeEventMessageCategoryEvent(v *types.CategoryEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, 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
}
if err := awsRestjson1_deserializeDocumentCategoryEvent(&v, shape); err != nil {
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
}
}
return nil
}
func awsRestjson1_deserializeEventMessageExceptionBadRequestException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, 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
}
v := &types.BadRequestException{}
if err := awsRestjson1_deserializeDocumentBadRequestException(&v, shape); err != nil {
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
}
}
return v
}
func awsRestjson1_deserializeEventMessageExceptionLimitExceededException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, 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
}
v := &types.LimitExceededException{}
if err := awsRestjson1_deserializeDocumentLimitExceededException(&v, shape); err != nil {
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
}
}
return v
}
func awsRestjson1_deserializeEventMessageExceptionInternalFailureException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, 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
}
v := &types.InternalFailureException{}
if err := awsRestjson1_deserializeDocumentInternalFailureException(&v, shape); err != nil {
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
}
}
return v
}
func awsRestjson1_deserializeEventMessageExceptionConflictException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, 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
}
v := &types.ConflictException{}
if err := awsRestjson1_deserializeDocumentConflictException(&v, shape); err != nil {
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
}
}
return v
}
func awsRestjson1_deserializeEventMessageExceptionServiceUnavailableException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, 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
}
v := &types.ServiceUnavailableException{}
if err := awsRestjson1_deserializeDocumentServiceUnavailableException(&v, shape); err != nil {
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
}
}
return v
}
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 "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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCallAnalyticsEntity(v **types.CallAnalyticsEntity, 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.CallAnalyticsEntity
if *v == nil {
sv = &types.CallAnalyticsEntity{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BeginOffsetMillis":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.BeginOffsetMillis = ptr.Int64(i64)
}
case "Category":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Category = ptr.String(jtv)
}
case "Confidence":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Confidence = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Confidence = ptr.Float64(f64)
default:
return fmt.Errorf("expected Confidence to be a JSON Number, got %T instead", value)
}
}
case "Content":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Content = ptr.String(jtv)
}
case "EndOffsetMillis":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.EndOffsetMillis = ptr.Int64(i64)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Type = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCallAnalyticsEntityList(v *[]types.CallAnalyticsEntity, 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.CallAnalyticsEntity
if *v == nil {
cv = []types.CallAnalyticsEntity{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CallAnalyticsEntity
destAddr := &col
if err := awsRestjson1_deserializeDocumentCallAnalyticsEntity(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentCallAnalyticsItem(v **types.CallAnalyticsItem, 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.CallAnalyticsItem
if *v == nil {
sv = &types.CallAnalyticsItem{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BeginOffsetMillis":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.BeginOffsetMillis = ptr.Int64(i64)
}
case "Confidence":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Confidence = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Confidence = ptr.Float64(f64)
default:
return fmt.Errorf("expected Confidence to be a JSON Number, got %T instead", value)
}
}
case "Content":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Content = ptr.String(jtv)
}
case "EndOffsetMillis":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.EndOffsetMillis = ptr.Int64(i64)
}
case "Stable":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Stable to be of type *bool, got %T instead", value)
}
sv.Stable = ptr.Bool(jtv)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ItemType to be of type string, got %T instead", value)
}
sv.Type = types.ItemType(jtv)
}
case "VocabularyFilterMatch":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.VocabularyFilterMatch = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCallAnalyticsItemList(v *[]types.CallAnalyticsItem, 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.CallAnalyticsItem
if *v == nil {
cv = []types.CallAnalyticsItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CallAnalyticsItem
destAddr := &col
if err := awsRestjson1_deserializeDocumentCallAnalyticsItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentCategoryEvent(v **types.CategoryEvent, 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.CategoryEvent
if *v == nil {
sv = &types.CategoryEvent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MatchedCategories":
if err := awsRestjson1_deserializeDocumentStringList(&sv.MatchedCategories, value); err != nil {
return err
}
case "MatchedDetails":
if err := awsRestjson1_deserializeDocumentMatchedCategoryDetails(&sv.MatchedDetails, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCharacterOffsets(v **types.CharacterOffsets, 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.CharacterOffsets
if *v == nil {
sv = &types.CharacterOffsets{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Begin":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Begin = ptr.Int32(int32(i64))
}
case "End":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.End = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
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 "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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, 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.InternalFailureException
if *v == nil {
sv = &types.InternalFailureException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIssueDetected(v **types.IssueDetected, 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.IssueDetected
if *v == nil {
sv = &types.IssueDetected{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CharacterOffsets":
if err := awsRestjson1_deserializeDocumentCharacterOffsets(&sv.CharacterOffsets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIssuesDetected(v *[]types.IssueDetected, 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.IssueDetected
if *v == nil {
cv = []types.IssueDetected{}
} else {
cv = *v
}
for _, value := range shape {
var col types.IssueDetected
destAddr := &col
if err := awsRestjson1_deserializeDocumentIssueDetected(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LimitExceededException
if *v == nil {
sv = &types.LimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMatchedCategoryDetails(v *map[string]types.PointsOfInterest, 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]types.PointsOfInterest
if *v == nil {
mv = map[string]types.PointsOfInterest{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.PointsOfInterest
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentPointsOfInterest(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentPointsOfInterest(v **types.PointsOfInterest, 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.PointsOfInterest
if *v == nil {
sv = &types.PointsOfInterest{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "TimestampRanges":
if err := awsRestjson1_deserializeDocumentTimestampRanges(&sv.TimestampRanges, value); err != nil {
return err
}
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 "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)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentStringList(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 String to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
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 "BeginOffsetMillis":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.BeginOffsetMillis = ptr.Int64(i64)
}
case "EndOffsetMillis":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.EndOffsetMillis = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTimestampRanges(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.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.TimestampRange
if *v == nil {
cv = []types.TimestampRange{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TimestampRange
destAddr := &col
if err := awsRestjson1_deserializeDocumentTimestampRange(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentUtteranceEvent(v **types.UtteranceEvent, 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.UtteranceEvent
if *v == nil {
sv = &types.UtteranceEvent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BeginOffsetMillis":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.BeginOffsetMillis = ptr.Int64(i64)
}
case "EndOffsetMillis":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.EndOffsetMillis = ptr.Int64(i64)
}
case "Entities":
if err := awsRestjson1_deserializeDocumentCallAnalyticsEntityList(&sv.Entities, value); err != nil {
return err
}
case "IsPartial":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.IsPartial = jtv
}
case "IssuesDetected":
if err := awsRestjson1_deserializeDocumentIssuesDetected(&sv.IssuesDetected, value); err != nil {
return err
}
case "Items":
if err := awsRestjson1_deserializeDocumentCallAnalyticsItemList(&sv.Items, value); err != nil {
return err
}
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)
}
case "Sentiment":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Sentiment to be of type string, got %T instead", value)
}
sv.Sentiment = types.Sentiment(jtv)
}
case "Transcript":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Transcript = ptr.String(jtv)
}
case "UtteranceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.UtteranceId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeEventStreamMedicalTranscriptResultStream(v *types.MedicalTranscriptResultStream, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
eventType := msg.Headers.Get(eventstreamapi.EventTypeHeader)
if eventType == nil {
return fmt.Errorf("%s event header not present", eventstreamapi.EventTypeHeader)
}
switch {
case strings.EqualFold("TranscriptEvent", eventType.String()):
vv := &types.MedicalTranscriptResultStreamMemberTranscriptEvent{}
if err := awsRestjson1_deserializeEventMessageMedicalTranscriptEvent(&vv.Value, msg); err != nil {
return err
}
*v = vv
return nil
default:
buffer := bytes.NewBuffer(nil)
eventstream.NewEncoder().Encode(buffer, *msg)
*v = &types.UnknownUnionMember{
Tag: eventType.String(),
Value: buffer.Bytes(),
}
return nil
}
}
func awsRestjson1_deserializeEventStreamExceptionMedicalTranscriptResultStream(msg *eventstream.Message) error {
exceptionType := msg.Headers.Get(eventstreamapi.ExceptionTypeHeader)
if exceptionType == nil {
return fmt.Errorf("%s event header not present", eventstreamapi.ExceptionTypeHeader)
}
switch {
case strings.EqualFold("BadRequestException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionBadRequestException(msg)
case strings.EqualFold("ConflictException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionConflictException(msg)
case strings.EqualFold("InternalFailureException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionInternalFailureException(msg)
case strings.EqualFold("LimitExceededException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionLimitExceededException(msg)
case strings.EqualFold("ServiceUnavailableException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionServiceUnavailableException(msg)
default:
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
code, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
return err
}
errorCode := "UnknownError"
errorMessage := errorCode
if ev := exceptionType.String(); len(ev) > 0 {
errorCode = ev
} else if ev := code; len(ev) > 0 {
errorCode = ev
}
if ev := message; len(ev) > 0 {
errorMessage = ev
}
return &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
}
}
func awsRestjson1_deserializeEventMessageMedicalTranscriptEvent(v *types.MedicalTranscriptEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, 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
}
if err := awsRestjson1_deserializeDocumentMedicalTranscriptEvent(&v, shape); err != nil {
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
}
}
return nil
}
func awsRestjson1_deserializeDocumentMedicalAlternative(v **types.MedicalAlternative, 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.MedicalAlternative
if *v == nil {
sv = &types.MedicalAlternative{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Entities":
if err := awsRestjson1_deserializeDocumentMedicalEntityList(&sv.Entities, value); err != nil {
return err
}
case "Items":
if err := awsRestjson1_deserializeDocumentMedicalItemList(&sv.Items, value); err != nil {
return err
}
case "Transcript":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Transcript = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMedicalAlternativeList(v *[]types.MedicalAlternative, 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.MedicalAlternative
if *v == nil {
cv = []types.MedicalAlternative{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MedicalAlternative
destAddr := &col
if err := awsRestjson1_deserializeDocumentMedicalAlternative(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMedicalEntity(v **types.MedicalEntity, 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.MedicalEntity
if *v == nil {
sv = &types.MedicalEntity{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Category":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Category = ptr.String(jtv)
}
case "Confidence":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Confidence = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Confidence = ptr.Float64(f64)
default:
return fmt.Errorf("expected Confidence to be a JSON Number, got %T instead", value)
}
}
case "Content":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Content = ptr.String(jtv)
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.EndTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.StartTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMedicalEntityList(v *[]types.MedicalEntity, 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.MedicalEntity
if *v == nil {
cv = []types.MedicalEntity{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MedicalEntity
destAddr := &col
if err := awsRestjson1_deserializeDocumentMedicalEntity(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMedicalItem(v **types.MedicalItem, 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.MedicalItem
if *v == nil {
sv = &types.MedicalItem{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Confidence":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Confidence = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Confidence = ptr.Float64(f64)
default:
return fmt.Errorf("expected Confidence to be a JSON Number, got %T instead", value)
}
}
case "Content":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Content = ptr.String(jtv)
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.EndTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "Speaker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Speaker = ptr.String(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.StartTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ItemType to be of type string, got %T instead", value)
}
sv.Type = types.ItemType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMedicalItemList(v *[]types.MedicalItem, 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.MedicalItem
if *v == nil {
cv = []types.MedicalItem{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MedicalItem
destAddr := &col
if err := awsRestjson1_deserializeDocumentMedicalItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMedicalResult(v **types.MedicalResult, 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.MedicalResult
if *v == nil {
sv = &types.MedicalResult{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Alternatives":
if err := awsRestjson1_deserializeDocumentMedicalAlternativeList(&sv.Alternatives, value); err != nil {
return err
}
case "ChannelId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ChannelId = ptr.String(jtv)
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.EndTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "IsPartial":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.IsPartial = jtv
}
case "ResultId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResultId = ptr.String(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.StartTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMedicalResultList(v *[]types.MedicalResult, 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.MedicalResult
if *v == nil {
cv = []types.MedicalResult{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MedicalResult
destAddr := &col
if err := awsRestjson1_deserializeDocumentMedicalResult(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMedicalTranscript(v **types.MedicalTranscript, 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.MedicalTranscript
if *v == nil {
sv = &types.MedicalTranscript{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Results":
if err := awsRestjson1_deserializeDocumentMedicalResultList(&sv.Results, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMedicalTranscriptEvent(v **types.MedicalTranscriptEvent, 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.MedicalTranscriptEvent
if *v == nil {
sv = &types.MedicalTranscriptEvent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Transcript":
if err := awsRestjson1_deserializeDocumentMedicalTranscript(&sv.Transcript, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeEventStreamTranscriptResultStream(v *types.TranscriptResultStream, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
eventType := msg.Headers.Get(eventstreamapi.EventTypeHeader)
if eventType == nil {
return fmt.Errorf("%s event header not present", eventstreamapi.EventTypeHeader)
}
switch {
case strings.EqualFold("TranscriptEvent", eventType.String()):
vv := &types.TranscriptResultStreamMemberTranscriptEvent{}
if err := awsRestjson1_deserializeEventMessageTranscriptEvent(&vv.Value, msg); err != nil {
return err
}
*v = vv
return nil
default:
buffer := bytes.NewBuffer(nil)
eventstream.NewEncoder().Encode(buffer, *msg)
*v = &types.UnknownUnionMember{
Tag: eventType.String(),
Value: buffer.Bytes(),
}
return nil
}
}
func awsRestjson1_deserializeEventStreamExceptionTranscriptResultStream(msg *eventstream.Message) error {
exceptionType := msg.Headers.Get(eventstreamapi.ExceptionTypeHeader)
if exceptionType == nil {
return fmt.Errorf("%s event header not present", eventstreamapi.ExceptionTypeHeader)
}
switch {
case strings.EqualFold("BadRequestException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionBadRequestException(msg)
case strings.EqualFold("ConflictException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionConflictException(msg)
case strings.EqualFold("InternalFailureException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionInternalFailureException(msg)
case strings.EqualFold("LimitExceededException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionLimitExceededException(msg)
case strings.EqualFold("ServiceUnavailableException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionServiceUnavailableException(msg)
default:
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
code, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
return err
}
errorCode := "UnknownError"
errorMessage := errorCode
if ev := exceptionType.String(); len(ev) > 0 {
errorCode = ev
} else if ev := code; len(ev) > 0 {
errorCode = ev
}
if ev := message; len(ev) > 0 {
errorMessage = ev
}
return &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
}
}
func awsRestjson1_deserializeEventMessageTranscriptEvent(v *types.TranscriptEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, 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
}
if err := awsRestjson1_deserializeDocumentTranscriptEvent(&v, shape); err != nil {
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
}
}
return nil
}
func awsRestjson1_deserializeDocumentAlternative(v **types.Alternative, 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.Alternative
if *v == nil {
sv = &types.Alternative{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Entities":
if err := awsRestjson1_deserializeDocumentEntityList(&sv.Entities, value); err != nil {
return err
}
case "Items":
if err := awsRestjson1_deserializeDocumentItemList(&sv.Items, value); err != nil {
return err
}
case "Transcript":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Transcript = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAlternativeList(v *[]types.Alternative, 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.Alternative
if *v == nil {
cv = []types.Alternative{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Alternative
destAddr := &col
if err := awsRestjson1_deserializeDocumentAlternative(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentEntity(v **types.Entity, 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.Entity
if *v == nil {
sv = &types.Entity{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Category":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Category = ptr.String(jtv)
}
case "Confidence":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Confidence = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Confidence = ptr.Float64(f64)
default:
return fmt.Errorf("expected Confidence to be a JSON Number, got %T instead", value)
}
}
case "Content":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Content = ptr.String(jtv)
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.EndTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.StartTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Type = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEntityList(v *[]types.Entity, 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.Entity
if *v == nil {
cv = []types.Entity{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Entity
destAddr := &col
if err := awsRestjson1_deserializeDocumentEntity(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentItem(v **types.Item, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Item
if *v == nil {
sv = &types.Item{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Confidence":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Confidence = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Confidence = ptr.Float64(f64)
default:
return fmt.Errorf("expected Confidence to be a JSON Number, got %T instead", value)
}
}
case "Content":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Content = ptr.String(jtv)
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.EndTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "Speaker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Speaker = ptr.String(jtv)
}
case "Stable":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Stable to be of type *bool, got %T instead", value)
}
sv.Stable = ptr.Bool(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.StartTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ItemType to be of type string, got %T instead", value)
}
sv.Type = types.ItemType(jtv)
}
case "VocabularyFilterMatch":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.VocabularyFilterMatch = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentItemList(v *[]types.Item, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Item
if *v == nil {
cv = []types.Item{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Item
destAddr := &col
if err := awsRestjson1_deserializeDocumentItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLanguageIdentification(v *[]types.LanguageWithScore, 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.LanguageWithScore
if *v == nil {
cv = []types.LanguageWithScore{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LanguageWithScore
destAddr := &col
if err := awsRestjson1_deserializeDocumentLanguageWithScore(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLanguageWithScore(v **types.LanguageWithScore, 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.LanguageWithScore
if *v == nil {
sv = &types.LanguageWithScore{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "Score":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Score = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Score = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResult(v **types.Result, 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.Result
if *v == nil {
sv = &types.Result{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Alternatives":
if err := awsRestjson1_deserializeDocumentAlternativeList(&sv.Alternatives, value); err != nil {
return err
}
case "ChannelId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ChannelId = ptr.String(jtv)
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.EndTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "IsPartial":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.IsPartial = jtv
}
case "LanguageCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value)
}
sv.LanguageCode = types.LanguageCode(jtv)
}
case "LanguageIdentification":
if err := awsRestjson1_deserializeDocumentLanguageIdentification(&sv.LanguageIdentification, value); err != nil {
return err
}
case "ResultId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResultId = ptr.String(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.StartTime = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResultList(v *[]types.Result, 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.Result
if *v == nil {
cv = []types.Result{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Result
destAddr := &col
if err := awsRestjson1_deserializeDocumentResult(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentTranscript(v **types.Transcript, 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.Transcript
if *v == nil {
sv = &types.Transcript{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Results":
if err := awsRestjson1_deserializeDocumentResultList(&sv.Results, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTranscriptEvent(v **types.TranscriptEvent, 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.TranscriptEvent
if *v == nil {
sv = &types.TranscriptEvent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Transcript":
if err := awsRestjson1_deserializeDocumentTranscript(&sv.Transcript, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
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_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalFailureException{}
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_deserializeDocumentInternalFailureException(&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_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.LimitExceededException{}
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_deserializeDocumentLimitExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func 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
}
| 3,944 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package transcribestreaming provides the API client, operations, and parameter
// types for Amazon Transcribe Streaming Service.
//
// Amazon Transcribe streaming offers three main types of real-time transcription:
// Standard, Medical, and Call Analytics.
// - Standard transcriptions are the most common option. Refer to for details.
// - Medical transcriptions are tailored to medical professionals and
// incorporate medical terms. A common use case for this service is transcribing
// doctor-patient dialogue in real time, so doctors can focus on their patient
// instead of taking notes. Refer to for details.
// - Call Analytics transcriptions are designed for use with call center audio
// on two different channels; if you're looking for insight into customer service
// calls, use this option. Refer to for details.
package transcribestreaming
| 17 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribestreaming
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/transcribestreaming/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "transcribe"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
return next.HandleSerialize(ctx, in)
}
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribestreaming
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transcribestreaming/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithysync "github.com/aws/smithy-go/sync"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"io/ioutil"
"sync"
"time"
)
// AudioStreamWriter provides the interface for writing events to a stream.
//
// The writer's Close method must allow multiple concurrent calls.
type AudioStreamWriter interface {
Send(context.Context, types.AudioStream) error
Close() error
Err() error
}
// CallAnalyticsTranscriptResultStreamReader provides the interface for reading
// events from a stream.
//
// The writer's Close method must allow multiple concurrent calls.
type CallAnalyticsTranscriptResultStreamReader interface {
Events() <-chan types.CallAnalyticsTranscriptResultStream
Close() error
Err() error
}
// MedicalTranscriptResultStreamReader provides the interface for reading events
// from a stream.
//
// The writer's Close method must allow multiple concurrent calls.
type MedicalTranscriptResultStreamReader interface {
Events() <-chan types.MedicalTranscriptResultStream
Close() error
Err() error
}
// TranscriptResultStreamReader provides the interface for reading events from a
// stream.
//
// The writer's Close method must allow multiple concurrent calls.
type TranscriptResultStreamReader interface {
Events() <-chan types.TranscriptResultStream
Close() error
Err() error
}
type eventStreamSigner interface {
GetSignature(ctx context.Context, headers, payload []byte, signingTime time.Time, optFns ...func(*v4.StreamSignerOptions)) ([]byte, error)
}
type asyncAudioStream struct {
Event types.AudioStream
Result chan<- error
}
func (e asyncAudioStream) ReportResult(cancel <-chan struct{}, err error) bool {
select {
case e.Result <- err:
return true
case <-cancel:
return false
}
}
type audioStreamWriter struct {
encoder *eventstream.Encoder
signer eventStreamSigner
stream chan asyncAudioStream
serializationBuffer *bytes.Buffer
signingBuffer *bytes.Buffer
eventStream io.WriteCloser
done chan struct{}
closeOnce sync.Once
err *smithysync.OnceErr
}
func newAudioStreamWriter(stream io.WriteCloser, encoder *eventstream.Encoder, signer eventStreamSigner) *audioStreamWriter {
w := &audioStreamWriter{
encoder: encoder,
signer: signer,
stream: make(chan asyncAudioStream),
eventStream: stream,
done: make(chan struct{}),
err: smithysync.NewOnceErr(),
serializationBuffer: bytes.NewBuffer(nil),
signingBuffer: bytes.NewBuffer(nil),
}
go w.writeStream()
return w
}
func (w *audioStreamWriter) Send(ctx context.Context, event types.AudioStream) error {
return w.send(ctx, event)
}
func (w *audioStreamWriter) send(ctx context.Context, event types.AudioStream) error {
if err := w.err.Err(); err != nil {
return err
}
resultCh := make(chan error)
wrapped := asyncAudioStream{
Event: event,
Result: resultCh,
}
select {
case w.stream <- wrapped:
case <-ctx.Done():
return ctx.Err()
case <-w.done:
return fmt.Errorf("stream closed, unable to send event")
}
select {
case err := <-resultCh:
return err
case <-ctx.Done():
return ctx.Err()
case <-w.done:
return fmt.Errorf("stream closed, unable to send event")
}
}
func (w *audioStreamWriter) writeStream() {
defer w.Close()
for {
select {
case wrapper := <-w.stream:
err := w.writeEvent(wrapper.Event)
wrapper.ReportResult(w.done, err)
if err != nil {
w.err.SetError(err)
return
}
case <-w.done:
if err := w.closeStream(); err != nil {
w.err.SetError(err)
}
return
}
}
}
func (w *audioStreamWriter) writeEvent(event types.AudioStream) error {
// serializedEvent returned bytes refers to an underlying byte buffer and must not
// escape this writeEvent scope without first copying. Any previous bytes stored in
// the buffer are cleared by this call.
serializedEvent, err := w.serializeEvent(event)
if err != nil {
return err
}
// signedEvent returned bytes refers to an underlying byte buffer and must not
// escape this writeEvent scope without first copying. Any previous bytes stored in
// the buffer are cleared by this call.
signedEvent, err := w.signEvent(serializedEvent)
if err != nil {
return err
}
// bytes are now copied to the underlying stream writer
_, err = io.Copy(w.eventStream, bytes.NewReader(signedEvent))
return err
}
func (w *audioStreamWriter) serializeEvent(event types.AudioStream) ([]byte, error) {
w.serializationBuffer.Reset()
eventMessage := eventstream.Message{}
if err := awsRestjson1_serializeEventStreamAudioStream(event, &eventMessage); err != nil {
return nil, err
}
if err := w.encoder.Encode(w.serializationBuffer, eventMessage); err != nil {
return nil, err
}
return w.serializationBuffer.Bytes(), nil
}
func (w *audioStreamWriter) signEvent(payload []byte) ([]byte, error) {
w.signingBuffer.Reset()
date := time.Now().UTC()
var msg eventstream.Message
msg.Headers.Set(eventstreamapi.DateHeader, eventstream.TimestampValue(date))
msg.Payload = payload
var headers bytes.Buffer
if err := eventstream.EncodeHeaders(&headers, msg.Headers); err != nil {
return nil, err
}
sig, err := w.signer.GetSignature(context.Background(), headers.Bytes(), msg.Payload, date)
if err != nil {
return nil, err
}
msg.Headers.Set(eventstreamapi.ChunkSignatureHeader, eventstream.BytesValue(sig))
if err := w.encoder.Encode(w.signingBuffer, msg); err != nil {
return nil, err
}
return w.signingBuffer.Bytes(), nil
}
func (w *audioStreamWriter) closeStream() (err error) {
defer func() {
if cErr := w.eventStream.Close(); cErr != nil && err == nil {
err = cErr
}
}()
// Per the protocol, a signed empty message is used to indicate the end of the stream,
// and that no subsequent events will be sent.
signedEvent, err := w.signEvent([]byte{})
if err != nil {
return err
}
_, err = io.Copy(w.eventStream, bytes.NewReader(signedEvent))
return err
}
func (w *audioStreamWriter) ErrorSet() <-chan struct{} {
return w.err.ErrorSet()
}
func (w *audioStreamWriter) Close() error {
w.closeOnce.Do(w.safeClose)
return w.Err()
}
func (w *audioStreamWriter) safeClose() {
close(w.done)
}
func (w *audioStreamWriter) Err() error {
return w.err.Err()
}
type callAnalyticsTranscriptResultStreamReader struct {
stream chan types.CallAnalyticsTranscriptResultStream
decoder *eventstream.Decoder
eventStream io.ReadCloser
err *smithysync.OnceErr
payloadBuf []byte
done chan struct{}
closeOnce sync.Once
}
func newCallAnalyticsTranscriptResultStreamReader(readCloser io.ReadCloser, decoder *eventstream.Decoder) *callAnalyticsTranscriptResultStreamReader {
w := &callAnalyticsTranscriptResultStreamReader{
stream: make(chan types.CallAnalyticsTranscriptResultStream),
decoder: decoder,
eventStream: readCloser,
err: smithysync.NewOnceErr(),
done: make(chan struct{}),
payloadBuf: make([]byte, 10*1024),
}
go w.readEventStream()
return w
}
func (r *callAnalyticsTranscriptResultStreamReader) Events() <-chan types.CallAnalyticsTranscriptResultStream {
return r.stream
}
func (r *callAnalyticsTranscriptResultStreamReader) readEventStream() {
defer r.Close()
defer close(r.stream)
for {
r.payloadBuf = r.payloadBuf[0:0]
decodedMessage, err := r.decoder.Decode(r.eventStream, r.payloadBuf)
if err != nil {
if err == io.EOF {
return
}
select {
case <-r.done:
return
default:
r.err.SetError(err)
return
}
}
event, err := r.deserializeEventMessage(&decodedMessage)
if err != nil {
r.err.SetError(err)
return
}
select {
case r.stream <- event:
case <-r.done:
return
}
}
}
func (r *callAnalyticsTranscriptResultStreamReader) deserializeEventMessage(msg *eventstream.Message) (types.CallAnalyticsTranscriptResultStream, error) {
messageType := msg.Headers.Get(eventstreamapi.MessageTypeHeader)
if messageType == nil {
return nil, fmt.Errorf("%s event header not present", eventstreamapi.MessageTypeHeader)
}
switch messageType.String() {
case eventstreamapi.EventMessageType:
var v types.CallAnalyticsTranscriptResultStream
if err := awsRestjson1_deserializeEventStreamCallAnalyticsTranscriptResultStream(&v, msg); err != nil {
return nil, err
}
return v, nil
case eventstreamapi.ExceptionMessageType:
return nil, awsRestjson1_deserializeEventStreamExceptionCallAnalyticsTranscriptResultStream(msg)
case eventstreamapi.ErrorMessageType:
errorCode := "UnknownError"
errorMessage := errorCode
if header := msg.Headers.Get(eventstreamapi.ErrorCodeHeader); header != nil {
errorCode = header.String()
}
if header := msg.Headers.Get(eventstreamapi.ErrorMessageHeader); header != nil {
errorMessage = header.String()
}
return nil, &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
default:
mc := msg.Clone()
return nil, &UnknownEventMessageError{
Type: messageType.String(),
Message: &mc,
}
}
}
func (r *callAnalyticsTranscriptResultStreamReader) ErrorSet() <-chan struct{} {
return r.err.ErrorSet()
}
func (r *callAnalyticsTranscriptResultStreamReader) Close() error {
r.closeOnce.Do(r.safeClose)
return r.Err()
}
func (r *callAnalyticsTranscriptResultStreamReader) safeClose() {
close(r.done)
r.eventStream.Close()
}
func (r *callAnalyticsTranscriptResultStreamReader) Err() error {
return r.err.Err()
}
func (r *callAnalyticsTranscriptResultStreamReader) Closed() <-chan struct{} {
return r.done
}
type medicalTranscriptResultStreamReader struct {
stream chan types.MedicalTranscriptResultStream
decoder *eventstream.Decoder
eventStream io.ReadCloser
err *smithysync.OnceErr
payloadBuf []byte
done chan struct{}
closeOnce sync.Once
}
func newMedicalTranscriptResultStreamReader(readCloser io.ReadCloser, decoder *eventstream.Decoder) *medicalTranscriptResultStreamReader {
w := &medicalTranscriptResultStreamReader{
stream: make(chan types.MedicalTranscriptResultStream),
decoder: decoder,
eventStream: readCloser,
err: smithysync.NewOnceErr(),
done: make(chan struct{}),
payloadBuf: make([]byte, 10*1024),
}
go w.readEventStream()
return w
}
func (r *medicalTranscriptResultStreamReader) Events() <-chan types.MedicalTranscriptResultStream {
return r.stream
}
func (r *medicalTranscriptResultStreamReader) readEventStream() {
defer r.Close()
defer close(r.stream)
for {
r.payloadBuf = r.payloadBuf[0:0]
decodedMessage, err := r.decoder.Decode(r.eventStream, r.payloadBuf)
if err != nil {
if err == io.EOF {
return
}
select {
case <-r.done:
return
default:
r.err.SetError(err)
return
}
}
event, err := r.deserializeEventMessage(&decodedMessage)
if err != nil {
r.err.SetError(err)
return
}
select {
case r.stream <- event:
case <-r.done:
return
}
}
}
func (r *medicalTranscriptResultStreamReader) deserializeEventMessage(msg *eventstream.Message) (types.MedicalTranscriptResultStream, error) {
messageType := msg.Headers.Get(eventstreamapi.MessageTypeHeader)
if messageType == nil {
return nil, fmt.Errorf("%s event header not present", eventstreamapi.MessageTypeHeader)
}
switch messageType.String() {
case eventstreamapi.EventMessageType:
var v types.MedicalTranscriptResultStream
if err := awsRestjson1_deserializeEventStreamMedicalTranscriptResultStream(&v, msg); err != nil {
return nil, err
}
return v, nil
case eventstreamapi.ExceptionMessageType:
return nil, awsRestjson1_deserializeEventStreamExceptionMedicalTranscriptResultStream(msg)
case eventstreamapi.ErrorMessageType:
errorCode := "UnknownError"
errorMessage := errorCode
if header := msg.Headers.Get(eventstreamapi.ErrorCodeHeader); header != nil {
errorCode = header.String()
}
if header := msg.Headers.Get(eventstreamapi.ErrorMessageHeader); header != nil {
errorMessage = header.String()
}
return nil, &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
default:
mc := msg.Clone()
return nil, &UnknownEventMessageError{
Type: messageType.String(),
Message: &mc,
}
}
}
func (r *medicalTranscriptResultStreamReader) ErrorSet() <-chan struct{} {
return r.err.ErrorSet()
}
func (r *medicalTranscriptResultStreamReader) Close() error {
r.closeOnce.Do(r.safeClose)
return r.Err()
}
func (r *medicalTranscriptResultStreamReader) safeClose() {
close(r.done)
r.eventStream.Close()
}
func (r *medicalTranscriptResultStreamReader) Err() error {
return r.err.Err()
}
func (r *medicalTranscriptResultStreamReader) Closed() <-chan struct{} {
return r.done
}
type transcriptResultStreamReader struct {
stream chan types.TranscriptResultStream
decoder *eventstream.Decoder
eventStream io.ReadCloser
err *smithysync.OnceErr
payloadBuf []byte
done chan struct{}
closeOnce sync.Once
}
func newTranscriptResultStreamReader(readCloser io.ReadCloser, decoder *eventstream.Decoder) *transcriptResultStreamReader {
w := &transcriptResultStreamReader{
stream: make(chan types.TranscriptResultStream),
decoder: decoder,
eventStream: readCloser,
err: smithysync.NewOnceErr(),
done: make(chan struct{}),
payloadBuf: make([]byte, 10*1024),
}
go w.readEventStream()
return w
}
func (r *transcriptResultStreamReader) Events() <-chan types.TranscriptResultStream {
return r.stream
}
func (r *transcriptResultStreamReader) readEventStream() {
defer r.Close()
defer close(r.stream)
for {
r.payloadBuf = r.payloadBuf[0:0]
decodedMessage, err := r.decoder.Decode(r.eventStream, r.payloadBuf)
if err != nil {
if err == io.EOF {
return
}
select {
case <-r.done:
return
default:
r.err.SetError(err)
return
}
}
event, err := r.deserializeEventMessage(&decodedMessage)
if err != nil {
r.err.SetError(err)
return
}
select {
case r.stream <- event:
case <-r.done:
return
}
}
}
func (r *transcriptResultStreamReader) deserializeEventMessage(msg *eventstream.Message) (types.TranscriptResultStream, error) {
messageType := msg.Headers.Get(eventstreamapi.MessageTypeHeader)
if messageType == nil {
return nil, fmt.Errorf("%s event header not present", eventstreamapi.MessageTypeHeader)
}
switch messageType.String() {
case eventstreamapi.EventMessageType:
var v types.TranscriptResultStream
if err := awsRestjson1_deserializeEventStreamTranscriptResultStream(&v, msg); err != nil {
return nil, err
}
return v, nil
case eventstreamapi.ExceptionMessageType:
return nil, awsRestjson1_deserializeEventStreamExceptionTranscriptResultStream(msg)
case eventstreamapi.ErrorMessageType:
errorCode := "UnknownError"
errorMessage := errorCode
if header := msg.Headers.Get(eventstreamapi.ErrorCodeHeader); header != nil {
errorCode = header.String()
}
if header := msg.Headers.Get(eventstreamapi.ErrorMessageHeader); header != nil {
errorMessage = header.String()
}
return nil, &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
default:
mc := msg.Clone()
return nil, &UnknownEventMessageError{
Type: messageType.String(),
Message: &mc,
}
}
}
func (r *transcriptResultStreamReader) ErrorSet() <-chan struct{} {
return r.err.ErrorSet()
}
func (r *transcriptResultStreamReader) Close() error {
r.closeOnce.Do(r.safeClose)
return r.Err()
}
func (r *transcriptResultStreamReader) safeClose() {
close(r.done)
r.eventStream.Close()
}
func (r *transcriptResultStreamReader) Err() error {
return r.err.Err()
}
func (r *transcriptResultStreamReader) Closed() <-chan struct{} {
return r.done
}
type awsRestjson1_deserializeOpEventStreamStartCallAnalyticsStreamTranscription struct {
LogEventStreamWrites bool
LogEventStreamReads bool
}
func (*awsRestjson1_deserializeOpEventStreamStartCallAnalyticsStreamTranscription) ID() string {
return "OperationEventStreamDeserializer"
}
func (m *awsRestjson1_deserializeOpEventStreamStartCallAnalyticsStreamTranscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
defer func() {
if err == nil {
return
}
m.closeResponseBody(out)
}()
logger := middleware.GetLogger(ctx)
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", in.Request)
}
_ = request
if err := eventstreamapi.ApplyHTTPTransportFixes(request); err != nil {
return out, metadata, err
}
requestSignature, err := v4.GetSignedRequestSignature(request.Request)
if err != nil {
return out, metadata, fmt.Errorf("failed to get event stream seed signature: %v", err)
}
signer := v4.NewStreamSigner(
awsmiddleware.GetSigningCredentials(ctx),
awsmiddleware.GetSigningName(ctx),
awsmiddleware.GetSigningRegion(ctx),
requestSignature,
)
eventWriter := newAudioStreamWriter(
eventstreamapi.GetInputStreamWriter(ctx),
eventstream.NewEncoder(func(options *eventstream.EncoderOptions) {
options.Logger = logger
options.LogMessages = m.LogEventStreamWrites
}),
signer,
)
defer func() {
if err == nil {
return
}
_ = eventWriter.Close()
}()
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
deserializeOutput, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", out.RawResponse)
}
_ = deserializeOutput
output, ok := out.Result.(*StartCallAnalyticsStreamTranscriptionOutput)
if out.Result != nil && !ok {
return out, metadata, fmt.Errorf("unexpected output result type: %T", out.Result)
} else if out.Result == nil {
output = &StartCallAnalyticsStreamTranscriptionOutput{}
out.Result = output
}
eventReader := newCallAnalyticsTranscriptResultStreamReader(
deserializeOutput.Body,
eventstream.NewDecoder(func(options *eventstream.DecoderOptions) {
options.Logger = logger
options.LogMessages = m.LogEventStreamReads
}),
)
defer func() {
if err == nil {
return
}
_ = eventReader.Close()
}()
output.eventStream = NewStartCallAnalyticsStreamTranscriptionEventStream(func(stream *StartCallAnalyticsStreamTranscriptionEventStream) {
stream.Writer = eventWriter
stream.Reader = eventReader
})
go output.eventStream.waitStreamClose()
return out, metadata, nil
}
func (*awsRestjson1_deserializeOpEventStreamStartCallAnalyticsStreamTranscription) closeResponseBody(out middleware.DeserializeOutput) {
if resp, ok := out.RawResponse.(*smithyhttp.Response); ok && resp != nil && resp.Body != nil {
_, _ = io.Copy(ioutil.Discard, resp.Body)
_ = resp.Body.Close()
}
}
func addEventStreamStartCallAnalyticsStreamTranscriptionMiddleware(stack *middleware.Stack, options Options) error {
if err := stack.Deserialize.Insert(&awsRestjson1_deserializeOpEventStreamStartCallAnalyticsStreamTranscription{
LogEventStreamWrites: options.ClientLogMode.IsRequestEventMessage(),
LogEventStreamReads: options.ClientLogMode.IsResponseEventMessage(),
}, "OperationDeserializer", middleware.Before); err != nil {
return err
}
return nil
}
type awsRestjson1_deserializeOpEventStreamStartMedicalStreamTranscription struct {
LogEventStreamWrites bool
LogEventStreamReads bool
}
func (*awsRestjson1_deserializeOpEventStreamStartMedicalStreamTranscription) ID() string {
return "OperationEventStreamDeserializer"
}
func (m *awsRestjson1_deserializeOpEventStreamStartMedicalStreamTranscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
defer func() {
if err == nil {
return
}
m.closeResponseBody(out)
}()
logger := middleware.GetLogger(ctx)
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", in.Request)
}
_ = request
if err := eventstreamapi.ApplyHTTPTransportFixes(request); err != nil {
return out, metadata, err
}
requestSignature, err := v4.GetSignedRequestSignature(request.Request)
if err != nil {
return out, metadata, fmt.Errorf("failed to get event stream seed signature: %v", err)
}
signer := v4.NewStreamSigner(
awsmiddleware.GetSigningCredentials(ctx),
awsmiddleware.GetSigningName(ctx),
awsmiddleware.GetSigningRegion(ctx),
requestSignature,
)
eventWriter := newAudioStreamWriter(
eventstreamapi.GetInputStreamWriter(ctx),
eventstream.NewEncoder(func(options *eventstream.EncoderOptions) {
options.Logger = logger
options.LogMessages = m.LogEventStreamWrites
}),
signer,
)
defer func() {
if err == nil {
return
}
_ = eventWriter.Close()
}()
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
deserializeOutput, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", out.RawResponse)
}
_ = deserializeOutput
output, ok := out.Result.(*StartMedicalStreamTranscriptionOutput)
if out.Result != nil && !ok {
return out, metadata, fmt.Errorf("unexpected output result type: %T", out.Result)
} else if out.Result == nil {
output = &StartMedicalStreamTranscriptionOutput{}
out.Result = output
}
eventReader := newMedicalTranscriptResultStreamReader(
deserializeOutput.Body,
eventstream.NewDecoder(func(options *eventstream.DecoderOptions) {
options.Logger = logger
options.LogMessages = m.LogEventStreamReads
}),
)
defer func() {
if err == nil {
return
}
_ = eventReader.Close()
}()
output.eventStream = NewStartMedicalStreamTranscriptionEventStream(func(stream *StartMedicalStreamTranscriptionEventStream) {
stream.Writer = eventWriter
stream.Reader = eventReader
})
go output.eventStream.waitStreamClose()
return out, metadata, nil
}
func (*awsRestjson1_deserializeOpEventStreamStartMedicalStreamTranscription) closeResponseBody(out middleware.DeserializeOutput) {
if resp, ok := out.RawResponse.(*smithyhttp.Response); ok && resp != nil && resp.Body != nil {
_, _ = io.Copy(ioutil.Discard, resp.Body)
_ = resp.Body.Close()
}
}
func addEventStreamStartMedicalStreamTranscriptionMiddleware(stack *middleware.Stack, options Options) error {
if err := stack.Deserialize.Insert(&awsRestjson1_deserializeOpEventStreamStartMedicalStreamTranscription{
LogEventStreamWrites: options.ClientLogMode.IsRequestEventMessage(),
LogEventStreamReads: options.ClientLogMode.IsResponseEventMessage(),
}, "OperationDeserializer", middleware.Before); err != nil {
return err
}
return nil
}
type awsRestjson1_deserializeOpEventStreamStartStreamTranscription struct {
LogEventStreamWrites bool
LogEventStreamReads bool
}
func (*awsRestjson1_deserializeOpEventStreamStartStreamTranscription) ID() string {
return "OperationEventStreamDeserializer"
}
func (m *awsRestjson1_deserializeOpEventStreamStartStreamTranscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
defer func() {
if err == nil {
return
}
m.closeResponseBody(out)
}()
logger := middleware.GetLogger(ctx)
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", in.Request)
}
_ = request
if err := eventstreamapi.ApplyHTTPTransportFixes(request); err != nil {
return out, metadata, err
}
requestSignature, err := v4.GetSignedRequestSignature(request.Request)
if err != nil {
return out, metadata, fmt.Errorf("failed to get event stream seed signature: %v", err)
}
signer := v4.NewStreamSigner(
awsmiddleware.GetSigningCredentials(ctx),
awsmiddleware.GetSigningName(ctx),
awsmiddleware.GetSigningRegion(ctx),
requestSignature,
)
eventWriter := newAudioStreamWriter(
eventstreamapi.GetInputStreamWriter(ctx),
eventstream.NewEncoder(func(options *eventstream.EncoderOptions) {
options.Logger = logger
options.LogMessages = m.LogEventStreamWrites
}),
signer,
)
defer func() {
if err == nil {
return
}
_ = eventWriter.Close()
}()
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
deserializeOutput, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", out.RawResponse)
}
_ = deserializeOutput
output, ok := out.Result.(*StartStreamTranscriptionOutput)
if out.Result != nil && !ok {
return out, metadata, fmt.Errorf("unexpected output result type: %T", out.Result)
} else if out.Result == nil {
output = &StartStreamTranscriptionOutput{}
out.Result = output
}
eventReader := newTranscriptResultStreamReader(
deserializeOutput.Body,
eventstream.NewDecoder(func(options *eventstream.DecoderOptions) {
options.Logger = logger
options.LogMessages = m.LogEventStreamReads
}),
)
defer func() {
if err == nil {
return
}
_ = eventReader.Close()
}()
output.eventStream = NewStartStreamTranscriptionEventStream(func(stream *StartStreamTranscriptionEventStream) {
stream.Writer = eventWriter
stream.Reader = eventReader
})
go output.eventStream.waitStreamClose()
return out, metadata, nil
}
func (*awsRestjson1_deserializeOpEventStreamStartStreamTranscription) closeResponseBody(out middleware.DeserializeOutput) {
if resp, ok := out.RawResponse.(*smithyhttp.Response); ok && resp != nil && resp.Body != nil {
_, _ = io.Copy(ioutil.Discard, resp.Body)
_ = resp.Body.Close()
}
}
func addEventStreamStartStreamTranscriptionMiddleware(stack *middleware.Stack, options Options) error {
if err := stack.Deserialize.Insert(&awsRestjson1_deserializeOpEventStreamStartStreamTranscription{
LogEventStreamWrites: options.ClientLogMode.IsRequestEventMessage(),
LogEventStreamReads: options.ClientLogMode.IsResponseEventMessage(),
}, "OperationDeserializer", middleware.Before); err != nil {
return err
}
return nil
}
// UnknownEventMessageError provides an error when a message is received from the stream,
// but the reader is unable to determine what kind of message it is.
type UnknownEventMessageError struct {
Type string
Message *eventstream.Message
}
// Error retruns the error message string.
func (e *UnknownEventMessageError) Error() string {
return "unknown event stream message type, " + e.Type
}
func setSafeEventStreamClientLogMode(o *Options, operation string) {
switch operation {
case "StartCallAnalyticsStreamTranscription":
toggleEventStreamClientLogMode(o, true, true)
return
case "StartMedicalStreamTranscription":
toggleEventStreamClientLogMode(o, true, true)
return
case "StartStreamTranscription":
toggleEventStreamClientLogMode(o, true, true)
return
default:
return
}
}
func toggleEventStreamClientLogMode(o *Options, request, response bool) {
mode := o.ClientLogMode
if request && mode.IsRequestWithBody() {
mode.ClearRequestWithBody()
mode |= aws.LogRequest
}
if response && mode.IsResponseWithBody() {
mode.ClearResponseWithBody()
mode |= aws.LogResponse
}
o.ClientLogMode = mode
}
| 1,069 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package transcribestreaming
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.9.13"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribestreaming
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribestreaming
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/service/transcribestreaming/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpStartCallAnalyticsStreamTranscription struct {
}
func (*awsRestjson1_serializeOpStartCallAnalyticsStreamTranscription) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartCallAnalyticsStreamTranscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartCallAnalyticsStreamTranscriptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/call-analytics-stream-transcription")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsStartCallAnalyticsStreamTranscriptionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/vnd.amazon.eventstream")
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStartCallAnalyticsStreamTranscriptionInput(v *StartCallAnalyticsStreamTranscriptionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.ContentIdentificationType) > 0 {
locationName := "X-Amzn-Transcribe-Content-Identification-Type"
encoder.SetHeader(locationName).String(string(v.ContentIdentificationType))
}
if len(v.ContentRedactionType) > 0 {
locationName := "X-Amzn-Transcribe-Content-Redaction-Type"
encoder.SetHeader(locationName).String(string(v.ContentRedactionType))
}
if v.EnablePartialResultsStabilization {
locationName := "X-Amzn-Transcribe-Enable-Partial-Results-Stabilization"
encoder.SetHeader(locationName).Boolean(v.EnablePartialResultsStabilization)
}
if len(v.LanguageCode) > 0 {
locationName := "X-Amzn-Transcribe-Language-Code"
encoder.SetHeader(locationName).String(string(v.LanguageCode))
}
if v.LanguageModelName != nil && len(*v.LanguageModelName) > 0 {
locationName := "X-Amzn-Transcribe-Language-Model-Name"
encoder.SetHeader(locationName).String(*v.LanguageModelName)
}
if len(v.MediaEncoding) > 0 {
locationName := "X-Amzn-Transcribe-Media-Encoding"
encoder.SetHeader(locationName).String(string(v.MediaEncoding))
}
if v.MediaSampleRateHertz != nil {
locationName := "X-Amzn-Transcribe-Sample-Rate"
encoder.SetHeader(locationName).Integer(*v.MediaSampleRateHertz)
}
if len(v.PartialResultsStability) > 0 {
locationName := "X-Amzn-Transcribe-Partial-Results-Stability"
encoder.SetHeader(locationName).String(string(v.PartialResultsStability))
}
if v.PiiEntityTypes != nil && len(*v.PiiEntityTypes) > 0 {
locationName := "X-Amzn-Transcribe-Pii-Entity-Types"
encoder.SetHeader(locationName).String(*v.PiiEntityTypes)
}
if v.SessionId != nil && len(*v.SessionId) > 0 {
locationName := "X-Amzn-Transcribe-Session-Id"
encoder.SetHeader(locationName).String(*v.SessionId)
}
if len(v.VocabularyFilterMethod) > 0 {
locationName := "X-Amzn-Transcribe-Vocabulary-Filter-Method"
encoder.SetHeader(locationName).String(string(v.VocabularyFilterMethod))
}
if v.VocabularyFilterName != nil && len(*v.VocabularyFilterName) > 0 {
locationName := "X-Amzn-Transcribe-Vocabulary-Filter-Name"
encoder.SetHeader(locationName).String(*v.VocabularyFilterName)
}
if v.VocabularyName != nil && len(*v.VocabularyName) > 0 {
locationName := "X-Amzn-Transcribe-Vocabulary-Name"
encoder.SetHeader(locationName).String(*v.VocabularyName)
}
return nil
}
type awsRestjson1_serializeOpStartMedicalStreamTranscription struct {
}
func (*awsRestjson1_serializeOpStartMedicalStreamTranscription) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartMedicalStreamTranscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartMedicalStreamTranscriptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/medical-stream-transcription")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsStartMedicalStreamTranscriptionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/vnd.amazon.eventstream")
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStartMedicalStreamTranscriptionInput(v *StartMedicalStreamTranscriptionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.ContentIdentificationType) > 0 {
locationName := "X-Amzn-Transcribe-Content-Identification-Type"
encoder.SetHeader(locationName).String(string(v.ContentIdentificationType))
}
if v.EnableChannelIdentification {
locationName := "X-Amzn-Transcribe-Enable-Channel-Identification"
encoder.SetHeader(locationName).Boolean(v.EnableChannelIdentification)
}
if len(v.LanguageCode) > 0 {
locationName := "X-Amzn-Transcribe-Language-Code"
encoder.SetHeader(locationName).String(string(v.LanguageCode))
}
if len(v.MediaEncoding) > 0 {
locationName := "X-Amzn-Transcribe-Media-Encoding"
encoder.SetHeader(locationName).String(string(v.MediaEncoding))
}
if v.MediaSampleRateHertz != nil {
locationName := "X-Amzn-Transcribe-Sample-Rate"
encoder.SetHeader(locationName).Integer(*v.MediaSampleRateHertz)
}
if v.NumberOfChannels != nil {
locationName := "X-Amzn-Transcribe-Number-Of-Channels"
encoder.SetHeader(locationName).Integer(*v.NumberOfChannels)
}
if v.SessionId != nil && len(*v.SessionId) > 0 {
locationName := "X-Amzn-Transcribe-Session-Id"
encoder.SetHeader(locationName).String(*v.SessionId)
}
if v.ShowSpeakerLabel {
locationName := "X-Amzn-Transcribe-Show-Speaker-Label"
encoder.SetHeader(locationName).Boolean(v.ShowSpeakerLabel)
}
if len(v.Specialty) > 0 {
locationName := "X-Amzn-Transcribe-Specialty"
encoder.SetHeader(locationName).String(string(v.Specialty))
}
if len(v.Type) > 0 {
locationName := "X-Amzn-Transcribe-Type"
encoder.SetHeader(locationName).String(string(v.Type))
}
if v.VocabularyName != nil && len(*v.VocabularyName) > 0 {
locationName := "X-Amzn-Transcribe-Vocabulary-Name"
encoder.SetHeader(locationName).String(*v.VocabularyName)
}
return nil
}
type awsRestjson1_serializeOpStartStreamTranscription struct {
}
func (*awsRestjson1_serializeOpStartStreamTranscription) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartStreamTranscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartStreamTranscriptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/stream-transcription")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsStartStreamTranscriptionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/vnd.amazon.eventstream")
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStartStreamTranscriptionInput(v *StartStreamTranscriptionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.ContentIdentificationType) > 0 {
locationName := "X-Amzn-Transcribe-Content-Identification-Type"
encoder.SetHeader(locationName).String(string(v.ContentIdentificationType))
}
if len(v.ContentRedactionType) > 0 {
locationName := "X-Amzn-Transcribe-Content-Redaction-Type"
encoder.SetHeader(locationName).String(string(v.ContentRedactionType))
}
if v.EnableChannelIdentification {
locationName := "X-Amzn-Transcribe-Enable-Channel-Identification"
encoder.SetHeader(locationName).Boolean(v.EnableChannelIdentification)
}
if v.EnablePartialResultsStabilization {
locationName := "X-Amzn-Transcribe-Enable-Partial-Results-Stabilization"
encoder.SetHeader(locationName).Boolean(v.EnablePartialResultsStabilization)
}
if v.IdentifyLanguage {
locationName := "X-Amzn-Transcribe-Identify-Language"
encoder.SetHeader(locationName).Boolean(v.IdentifyLanguage)
}
if len(v.LanguageCode) > 0 {
locationName := "X-Amzn-Transcribe-Language-Code"
encoder.SetHeader(locationName).String(string(v.LanguageCode))
}
if v.LanguageModelName != nil && len(*v.LanguageModelName) > 0 {
locationName := "X-Amzn-Transcribe-Language-Model-Name"
encoder.SetHeader(locationName).String(*v.LanguageModelName)
}
if v.LanguageOptions != nil && len(*v.LanguageOptions) > 0 {
locationName := "X-Amzn-Transcribe-Language-Options"
encoder.SetHeader(locationName).String(*v.LanguageOptions)
}
if len(v.MediaEncoding) > 0 {
locationName := "X-Amzn-Transcribe-Media-Encoding"
encoder.SetHeader(locationName).String(string(v.MediaEncoding))
}
if v.MediaSampleRateHertz != nil {
locationName := "X-Amzn-Transcribe-Sample-Rate"
encoder.SetHeader(locationName).Integer(*v.MediaSampleRateHertz)
}
if v.NumberOfChannels != nil {
locationName := "X-Amzn-Transcribe-Number-Of-Channels"
encoder.SetHeader(locationName).Integer(*v.NumberOfChannels)
}
if len(v.PartialResultsStability) > 0 {
locationName := "X-Amzn-Transcribe-Partial-Results-Stability"
encoder.SetHeader(locationName).String(string(v.PartialResultsStability))
}
if v.PiiEntityTypes != nil && len(*v.PiiEntityTypes) > 0 {
locationName := "X-Amzn-Transcribe-Pii-Entity-Types"
encoder.SetHeader(locationName).String(*v.PiiEntityTypes)
}
if len(v.PreferredLanguage) > 0 {
locationName := "X-Amzn-Transcribe-Preferred-Language"
encoder.SetHeader(locationName).String(string(v.PreferredLanguage))
}
if v.SessionId != nil && len(*v.SessionId) > 0 {
locationName := "X-Amzn-Transcribe-Session-Id"
encoder.SetHeader(locationName).String(*v.SessionId)
}
if v.ShowSpeakerLabel {
locationName := "X-Amzn-Transcribe-Show-Speaker-Label"
encoder.SetHeader(locationName).Boolean(v.ShowSpeakerLabel)
}
if len(v.VocabularyFilterMethod) > 0 {
locationName := "X-Amzn-Transcribe-Vocabulary-Filter-Method"
encoder.SetHeader(locationName).String(string(v.VocabularyFilterMethod))
}
if v.VocabularyFilterName != nil && len(*v.VocabularyFilterName) > 0 {
locationName := "X-Amzn-Transcribe-Vocabulary-Filter-Name"
encoder.SetHeader(locationName).String(*v.VocabularyFilterName)
}
if v.VocabularyFilterNames != nil && len(*v.VocabularyFilterNames) > 0 {
locationName := "X-Amzn-Transcribe-Vocabulary-Filter-Names"
encoder.SetHeader(locationName).String(*v.VocabularyFilterNames)
}
if v.VocabularyName != nil && len(*v.VocabularyName) > 0 {
locationName := "X-Amzn-Transcribe-Vocabulary-Name"
encoder.SetHeader(locationName).String(*v.VocabularyName)
}
if v.VocabularyNames != nil && len(*v.VocabularyNames) > 0 {
locationName := "X-Amzn-Transcribe-Vocabulary-Names"
encoder.SetHeader(locationName).String(*v.VocabularyNames)
}
return nil
}
func awsRestjson1_serializeEventStreamAudioStream(v types.AudioStream, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
switch vv := v.(type) {
case *types.AudioStreamMemberAudioEvent:
msg.Headers.Set(eventstreamapi.EventTypeHeader, eventstream.StringValue("AudioEvent"))
return awsRestjson1_serializeEventMessageAudioEvent(&vv.Value, msg)
case *types.AudioStreamMemberConfigurationEvent:
msg.Headers.Set(eventstreamapi.EventTypeHeader, eventstream.StringValue("ConfigurationEvent"))
return awsRestjson1_serializeEventMessageConfigurationEvent(&vv.Value, msg)
default:
return fmt.Errorf("unexpected event message type: %v", v)
}
}
func awsRestjson1_serializeEventMessageAudioEvent(v *types.AudioEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
if v.AudioChunk != nil {
msg.Headers.Set(eventstreamapi.ContentTypeHeader, eventstream.StringValue("application/octet-stream"))
msg.Payload = v.AudioChunk
}
return nil
}
func awsRestjson1_serializeEventMessageConfigurationEvent(v *types.ConfigurationEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
msg.Headers.Set(eventstreamapi.ContentTypeHeader, eventstream.StringValue("application/json"))
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeDocumentConfigurationEvent(v, jsonEncoder.Value); err != nil {
return err
}
msg.Payload = jsonEncoder.Bytes()
return nil
}
func awsRestjson1_serializeDocumentChannelDefinition(v *types.ChannelDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("ChannelId")
ok.Integer(v.ChannelId)
}
if len(v.ParticipantRole) > 0 {
ok := object.Key("ParticipantRole")
ok.String(string(v.ParticipantRole))
}
return nil
}
func awsRestjson1_serializeDocumentChannelDefinitions(v []types.ChannelDefinition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentChannelDefinition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentConfigurationEvent(v *types.ConfigurationEvent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChannelDefinitions != nil {
ok := object.Key("ChannelDefinitions")
if err := awsRestjson1_serializeDocumentChannelDefinitions(v.ChannelDefinitions, ok); err != nil {
return err
}
}
if v.PostCallAnalyticsSettings != nil {
ok := object.Key("PostCallAnalyticsSettings")
if err := awsRestjson1_serializeDocumentPostCallAnalyticsSettings(v.PostCallAnalyticsSettings, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPostCallAnalyticsSettings(v *types.PostCallAnalyticsSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ContentRedactionOutput) > 0 {
ok := object.Key("ContentRedactionOutput")
ok.String(string(v.ContentRedactionOutput))
}
if v.DataAccessRoleArn != nil {
ok := object.Key("DataAccessRoleArn")
ok.String(*v.DataAccessRoleArn)
}
if v.OutputEncryptionKMSKeyId != nil {
ok := object.Key("OutputEncryptionKMSKeyId")
ok.String(*v.OutputEncryptionKMSKeyId)
}
if v.OutputLocation != nil {
ok := object.Key("OutputLocation")
ok.String(*v.OutputLocation)
}
return nil
}
| 520 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transcribestreaming
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/transcribestreaming/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpStartCallAnalyticsStreamTranscription struct {
}
func (*validateOpStartCallAnalyticsStreamTranscription) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartCallAnalyticsStreamTranscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartCallAnalyticsStreamTranscriptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartCallAnalyticsStreamTranscriptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartMedicalStreamTranscription struct {
}
func (*validateOpStartMedicalStreamTranscription) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartMedicalStreamTranscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartMedicalStreamTranscriptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartMedicalStreamTranscriptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartStreamTranscription struct {
}
func (*validateOpStartStreamTranscription) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartStreamTranscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartStreamTranscriptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartStreamTranscriptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpStartCallAnalyticsStreamTranscriptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartCallAnalyticsStreamTranscription{}, middleware.After)
}
func addOpStartMedicalStreamTranscriptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartMedicalStreamTranscription{}, middleware.After)
}
func addOpStartStreamTranscriptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartStreamTranscription{}, middleware.After)
}
func validateAudioStream(v types.AudioStream) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AudioStream"}
switch uv := v.(type) {
case *types.AudioStreamMemberConfigurationEvent:
if err := validateConfigurationEvent(&uv.Value); err != nil {
invalidParams.AddNested("[ConfigurationEvent]", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateChannelDefinition(v *types.ChannelDefinition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ChannelDefinition"}
if len(v.ParticipantRole) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ParticipantRole"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateChannelDefinitions(v []types.ChannelDefinition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ChannelDefinitions"}
for i := range v {
if err := validateChannelDefinition(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConfigurationEvent(v *types.ConfigurationEvent) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConfigurationEvent"}
if v.ChannelDefinitions != nil {
if err := validateChannelDefinitions(v.ChannelDefinitions); err != nil {
invalidParams.AddNested("ChannelDefinitions", err.(smithy.InvalidParamsError))
}
}
if v.PostCallAnalyticsSettings != nil {
if err := validatePostCallAnalyticsSettings(v.PostCallAnalyticsSettings); err != nil {
invalidParams.AddNested("PostCallAnalyticsSettings", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePostCallAnalyticsSettings(v *types.PostCallAnalyticsSettings) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PostCallAnalyticsSettings"}
if v.OutputLocation == nil {
invalidParams.Add(smithy.NewErrParamRequired("OutputLocation"))
}
if v.DataAccessRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DataAccessRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartCallAnalyticsStreamTranscriptionInput(v *StartCallAnalyticsStreamTranscriptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartCallAnalyticsStreamTranscriptionInput"}
if len(v.LanguageCode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("LanguageCode"))
}
if v.MediaSampleRateHertz == nil {
invalidParams.Add(smithy.NewErrParamRequired("MediaSampleRateHertz"))
}
if len(v.MediaEncoding) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MediaEncoding"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartMedicalStreamTranscriptionInput(v *StartMedicalStreamTranscriptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartMedicalStreamTranscriptionInput"}
if len(v.LanguageCode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("LanguageCode"))
}
if v.MediaSampleRateHertz == nil {
invalidParams.Add(smithy.NewErrParamRequired("MediaSampleRateHertz"))
}
if len(v.MediaEncoding) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MediaEncoding"))
}
if len(v.Specialty) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Specialty"))
}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartStreamTranscriptionInput(v *StartStreamTranscriptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartStreamTranscriptionInput"}
if v.MediaSampleRateHertz == nil {
invalidParams.Add(smithy.NewErrParamRequired("MediaSampleRateHertz"))
}
if len(v.MediaEncoding) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MediaEncoding"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 241 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver Transcribe Streaming endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "transcribestreaming.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribestreaming-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "transcribestreaming-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribestreaming.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "transcribestreaming-ca-central-1",
}: endpoints.Endpoint{
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "transcribestreaming-ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribestreaming-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "transcribestreaming-fips-ca-central-1",
}: endpoints.Endpoint{
Hostname: "transcribestreaming-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "transcribestreaming-fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "transcribestreaming-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "transcribestreaming-fips-us-east-2",
}: endpoints.Endpoint{
Hostname: "transcribestreaming-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "transcribestreaming-fips-us-west-2",
}: endpoints.Endpoint{
Hostname: "transcribestreaming-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "transcribestreaming-us-east-1",
}: endpoints.Endpoint{
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "transcribestreaming-us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribestreaming-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "transcribestreaming-us-east-2",
}: endpoints.Endpoint{
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "transcribestreaming-us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribestreaming-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "transcribestreaming-us-west-2",
}: endpoints.Endpoint{
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "transcribestreaming-us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribestreaming-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "transcribestreaming.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribestreaming-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "transcribestreaming-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribestreaming.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribestreaming-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribestreaming.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-iso-east-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribestreaming-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribestreaming.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribestreaming-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribestreaming.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribestreaming-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribestreaming.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "transcribestreaming.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "transcribestreaming-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "transcribestreaming-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "transcribestreaming.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
},
},
}
| 470 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | package testing
import (
"bytes"
"context"
"errors"
"reflect"
"strings"
"sync"
"testing"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/service/internal/eventstreamtesting"
"github.com/aws/aws-sdk-go-v2/service/transcribestreaming"
"github.com/aws/aws-sdk-go-v2/service/transcribestreaming/types"
"github.com/aws/smithy-go"
"github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/middleware"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)
func removeValidationMiddleware(stack *middleware.Stack) error {
_, err := stack.Initialize.Remove("OperationInputValidation")
return err
}
func TestStartStreamTranscription_Read(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("TranscriptEvent"),
},
},
Payload: []byte(`{
"Transcript": {
"Results": []
}
}`),
},
},
BiDirectional: true,
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := transcribestreaming.NewFromConfig(cfg)
resp, err := svc.StartStreamTranscription(context.Background(),
&transcribestreaming.StartStreamTranscriptionInput{}, func(options *transcribestreaming.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
defer resp.GetStream().Close()
expectEvents := []types.TranscriptResultStream{
&types.TranscriptResultStreamMemberTranscriptEvent{
Value: types.TranscriptEvent{Transcript: &types.Transcript{Results: []types.Result{}}},
},
}
for i := 0; i < len(expectEvents); i++ {
event := <-resp.GetStream().Events()
if event == nil {
t.Errorf("%d, expect event, got nil", i)
}
if diff := cmp.Diff(expectEvents[i], event, cmpopts.IgnoreTypes(document.NoSerde{})); len(diff) > 0 {
t.Errorf("%d, %v", i, diff)
}
}
if err := resp.GetStream().Err(); err != nil {
t.Errorf("expect no error, %v", err)
}
}
func TestStartStreamTranscription_ReadClose(t *testing.T) {
sess, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("TranscriptEvent"),
},
},
Payload: []byte(`{
"Transcript": {
"Results": []
}
}`),
},
},
BiDirectional: true,
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := transcribestreaming.NewFromConfig(sess)
resp, err := svc.StartStreamTranscription(context.Background(), &transcribestreaming.StartStreamTranscriptionInput{}, func(options *transcribestreaming.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
// Assert calling Err before close does not close the stream.
resp.GetStream().Err()
select {
case _, ok := <-resp.GetStream().Events():
if !ok {
t.Fatalf("expect stream not to be closed, but was")
}
default:
}
resp.GetStream().Close()
<-resp.GetStream().Events()
if err := resp.GetStream().Err(); err != nil {
t.Errorf("expect no error, %v", err)
}
}
func TestStartStreamTranscription_ReadUnknownEvent(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("TranscriptEvent"),
},
},
Payload: []byte(`{
"Transcript": {
"Results": []
}
}`),
},
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("UnknownEventName"),
},
},
Payload: []byte(`{}`),
},
},
BiDirectional: true,
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := transcribestreaming.NewFromConfig(cfg)
resp, err := svc.StartStreamTranscription(context.Background(), &transcribestreaming.StartStreamTranscriptionInput{}, func(options *transcribestreaming.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
defer resp.GetStream().Close()
expectEvents := []types.TranscriptResultStream{
&types.TranscriptResultStreamMemberTranscriptEvent{Value: types.TranscriptEvent{Transcript: &types.Transcript{Results: []types.Result{}}}},
&types.UnknownUnionMember{Tag: "UnknownEventName", Value: func() []byte {
encoder := eventstream.NewEncoder()
buff := bytes.NewBuffer(nil)
encoder.Encode(buff, eventstream.Message{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("UnknownEventName"),
},
},
Payload: []byte(`{}`)})
return buff.Bytes()
}()},
}
for i := 0; i < len(expectEvents); i++ {
event := <-resp.GetStream().Events()
if event == nil {
t.Errorf("%d, expect event, got nil", i)
}
if diff := cmp.Diff(expectEvents[i], event, cmpopts.IgnoreTypes(document.NoSerde{})); len(diff) > 0 {
t.Errorf("%d, %v", i, diff)
}
}
if err := resp.GetStream().Err(); err != nil {
t.Errorf("expect no error, %v", err)
}
}
func TestStartStreamTranscription_ReadException(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventExceptionTypeHeader,
{
Name: eventstreamapi.ExceptionTypeHeader,
Value: eventstream.StringValue("BadRequestException"),
},
},
Payload: []byte(`{
"Message": "this is an exception message"
}`),
},
},
BiDirectional: true,
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := transcribestreaming.NewFromConfig(cfg)
resp, err := svc.StartStreamTranscription(context.Background(), &transcribestreaming.StartStreamTranscriptionInput{}, func(options *transcribestreaming.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
defer resp.GetStream().Close()
<-resp.GetStream().Events()
err = resp.GetStream().Err()
if err == nil {
t.Fatalf("expect err, got none")
}
var expectedErr *types.BadRequestException
if !errors.As(err, &expectedErr) {
t.Errorf("expect err type %T", expectedErr)
}
if diff := cmp.Diff(
expectedErr,
&types.BadRequestException{Message: aws.String("this is an exception message")},
cmpopts.IgnoreTypes(document.NoSerde{}),
); len(diff) > 0 {
t.Errorf(diff)
}
}
func TestStartStreamTranscription_ReadUnmodeledException(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventExceptionTypeHeader,
{
Name: eventstreamapi.ExceptionTypeHeader,
Value: eventstream.StringValue("UnmodeledException"),
},
},
Payload: []byte(`{
"Message": "this is an unmodeled exception message"
}`),
},
},
BiDirectional: true,
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := transcribestreaming.NewFromConfig(cfg)
resp, err := svc.StartStreamTranscription(context.Background(), &transcribestreaming.StartStreamTranscriptionInput{}, func(options *transcribestreaming.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
defer resp.GetStream().Close()
<-resp.GetStream().Events()
err = resp.GetStream().Err()
if err == nil {
t.Fatalf("expect err, got none")
}
var expectedErr *smithy.GenericAPIError
if !errors.As(err, &expectedErr) {
t.Errorf("expect err type %T", expectedErr)
}
if diff := cmp.Diff(
expectedErr,
&smithy.GenericAPIError{
Code: "UnmodeledException",
Message: "this is an unmodeled exception message",
},
cmpopts.IgnoreTypes(document.NoSerde{}),
); len(diff) > 0 {
t.Errorf(diff)
}
}
func TestStartStreamTranscription_ReadErrorEvent(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
{
Name: eventstreamapi.MessageTypeHeader,
Value: eventstream.StringValue(eventstreamapi.ErrorMessageType),
},
{
Name: eventstreamapi.ErrorCodeHeader,
Value: eventstream.StringValue("AnErrorCode"),
},
{
Name: eventstreamapi.ErrorMessageHeader,
Value: eventstream.StringValue("An error message"),
},
},
},
},
BiDirectional: true,
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := transcribestreaming.NewFromConfig(cfg)
resp, err := svc.StartStreamTranscription(context.Background(), &transcribestreaming.StartStreamTranscriptionInput{}, func(options *transcribestreaming.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
defer resp.GetStream().Close()
<-resp.GetStream().Events()
err = resp.GetStream().Err()
if err == nil {
t.Fatalf("expect err, got none")
}
var expectedErr *smithy.GenericAPIError
if !errors.As(err, &expectedErr) {
t.Errorf("expect err type %T", expectedErr)
}
if diff := cmp.Diff(
expectedErr,
&smithy.GenericAPIError{
Code: "AnErrorCode",
Message: "An error message",
},
cmpopts.IgnoreTypes(document.NoSerde{}),
); len(diff) > 0 {
t.Errorf(diff)
}
}
func TestStartStreamTranscription_ReadWrite(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
ClientEvents: []eventstream.Message{
{
Headers: eventstream.Headers{
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("AudioEvent"),
},
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.ContentTypeHeader,
Value: eventstream.StringValue("application/octet-stream"),
},
},
Payload: []byte{0x1, 0x2, 0x3, 0x4},
},
},
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("TranscriptEvent"),
},
},
Payload: []byte(`{
"Transcript": {
"Results": []
}
}`),
},
},
BiDirectional: true,
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := transcribestreaming.NewFromConfig(cfg)
resp, err := svc.StartStreamTranscription(context.Background(), &transcribestreaming.StartStreamTranscriptionInput{}, func(options *transcribestreaming.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
stream := resp.GetStream()
defer stream.Close()
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
expectedServiceEvents := []types.TranscriptResultStream{
&types.TranscriptResultStreamMemberTranscriptEvent{Value: types.TranscriptEvent{Transcript: &types.Transcript{Results: []types.Result{}}}},
}
for i := 0; i < len(expectedServiceEvents); i++ {
event := <-resp.GetStream().Events()
if event == nil {
t.Errorf("%d, expect event, got nil", i)
}
if e, a := expectedServiceEvents[i], event; !reflect.DeepEqual(e, a) {
t.Errorf("%d, expect %T %v, got %T %v", i, e, e, a, a)
}
}
}()
clientEvents := []types.AudioStream{
&types.AudioStreamMemberAudioEvent{Value: types.AudioEvent{AudioChunk: []byte{0x1, 0x2, 0x3, 0x4}}},
}
for _, event := range clientEvents {
err = stream.Send(context.Background(), event)
if err != nil {
t.Errorf("expect no error, got %v", err)
}
}
wg.Wait()
stream.Close()
if err := stream.Err(); err != nil {
t.Errorf("expect no error, %v", err)
}
}
func TestStartStreamTranscription_Write(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
ClientEvents: []eventstream.Message{
{
Headers: eventstream.Headers{
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("AudioEvent"),
},
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.ContentTypeHeader,
Value: eventstream.StringValue("application/octet-stream"),
},
},
Payload: []byte{0x1, 0x2, 0x3, 0x4},
},
},
BiDirectional: true,
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := transcribestreaming.NewFromConfig(cfg)
resp, err := svc.StartStreamTranscription(context.Background(), &transcribestreaming.StartStreamTranscriptionInput{}, func(options *transcribestreaming.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
stream := resp.GetStream()
clientEvents := []types.AudioStream{
&types.AudioStreamMemberAudioEvent{Value: types.AudioEvent{AudioChunk: []byte{0x1, 0x2, 0x3, 0x4}}},
}
for _, event := range clientEvents {
err = stream.Send(context.Background(), event)
if err != nil {
t.Errorf("expect no error, got %v", err)
}
}
if err := stream.Close(); err != nil {
t.Errorf("expect no error, got %v", err)
}
}
func TestStartStreamTranscription_WriteClose(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
BiDirectional: true,
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := transcribestreaming.NewFromConfig(cfg)
resp, err := svc.StartStreamTranscription(context.Background(), &transcribestreaming.StartStreamTranscriptionInput{}, func(options *transcribestreaming.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
stream := resp.GetStream()
// Assert calling Err before close does not close the stream.
stream.Err()
err = stream.Send(context.Background(), &types.AudioStreamMemberAudioEvent{Value: types.AudioEvent{AudioChunk: []byte{}}})
if err != nil {
t.Errorf("expect no error, got %v", err)
}
stream.Close()
if err := stream.Err(); err != nil {
t.Errorf("expect no error, got %v", err)
}
}
func TestStartStreamTranscription_WriteError(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
BiDirectional: true,
ForceCloseAfter: time.Millisecond * 500,
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := transcribestreaming.NewFromConfig(cfg)
resp, err := svc.StartStreamTranscription(context.Background(), &transcribestreaming.StartStreamTranscriptionInput{}, func(options *transcribestreaming.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
stream := resp.GetStream()
defer stream.Close()
for {
err = resp.GetStream().Send(context.Background(), &types.AudioStreamMemberAudioEvent{Value: types.AudioEvent{}})
if err != nil {
if strings.Contains("unable to send event", err.Error()) {
t.Errorf("expected stream closed error, got %v", err)
}
break
}
}
}
func TestStartStreamTranscription_ResponseError(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
StaticResponse: &eventstreamtesting.StaticResponse{
StatusCode: 500,
Body: []byte(`{
"Message": "this is an exception message"
}`),
},
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := transcribestreaming.NewFromConfig(cfg)
_, err = svc.StartStreamTranscription(context.Background(), &transcribestreaming.StartStreamTranscriptionInput{}, func(options *transcribestreaming.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err == nil {
t.Fatal("expect error got, nil")
}
var expectedErr *smithy.GenericAPIError
if !errors.As(err, &expectedErr) {
t.Errorf("expect err type %T, got %v", expectedErr, err)
}
if diff := cmp.Diff(
expectedErr,
&smithy.GenericAPIError{
Code: "UnknownError",
Message: "this is an exception message",
},
cmpopts.IgnoreTypes(document.NoSerde{}),
); len(diff) > 0 {
t.Errorf(diff)
}
}
| 661 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package testing
// goModuleVersion is the tagged release for this module
const goModuleVersion = "tip"
| 7 |
aws-sdk-go-v2 | aws | Go | // Package testing is used for custom unit tests for transcribestreaming.
package testing
| 3 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type CallAnalyticsLanguageCode string
// Enum values for CallAnalyticsLanguageCode
const (
CallAnalyticsLanguageCodeEnUs CallAnalyticsLanguageCode = "en-US"
CallAnalyticsLanguageCodeEnGb CallAnalyticsLanguageCode = "en-GB"
CallAnalyticsLanguageCodeEsUs CallAnalyticsLanguageCode = "es-US"
CallAnalyticsLanguageCodeFrCa CallAnalyticsLanguageCode = "fr-CA"
CallAnalyticsLanguageCodeFrFr CallAnalyticsLanguageCode = "fr-FR"
CallAnalyticsLanguageCodeEnAu CallAnalyticsLanguageCode = "en-AU"
CallAnalyticsLanguageCodeItIt CallAnalyticsLanguageCode = "it-IT"
CallAnalyticsLanguageCodeDeDe CallAnalyticsLanguageCode = "de-DE"
CallAnalyticsLanguageCodePtBr CallAnalyticsLanguageCode = "pt-BR"
)
// Values returns all known values for CallAnalyticsLanguageCode. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (CallAnalyticsLanguageCode) Values() []CallAnalyticsLanguageCode {
return []CallAnalyticsLanguageCode{
"en-US",
"en-GB",
"es-US",
"fr-CA",
"fr-FR",
"en-AU",
"it-IT",
"de-DE",
"pt-BR",
}
}
type ContentIdentificationType string
// Enum values for ContentIdentificationType
const (
ContentIdentificationTypePii ContentIdentificationType = "PII"
)
// Values returns all known values for ContentIdentificationType. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (ContentIdentificationType) Values() []ContentIdentificationType {
return []ContentIdentificationType{
"PII",
}
}
type ContentRedactionOutput string
// Enum values for ContentRedactionOutput
const (
ContentRedactionOutputRedacted ContentRedactionOutput = "redacted"
ContentRedactionOutputRedactedAndUnredacted ContentRedactionOutput = "redacted_and_unredacted"
)
// Values returns all known values for ContentRedactionOutput. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ContentRedactionOutput) Values() []ContentRedactionOutput {
return []ContentRedactionOutput{
"redacted",
"redacted_and_unredacted",
}
}
type ContentRedactionType string
// Enum values for ContentRedactionType
const (
ContentRedactionTypePii ContentRedactionType = "PII"
)
// Values returns all known values for ContentRedactionType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ContentRedactionType) Values() []ContentRedactionType {
return []ContentRedactionType{
"PII",
}
}
type ItemType string
// Enum values for ItemType
const (
ItemTypePronunciation ItemType = "pronunciation"
ItemTypePunctuation ItemType = "punctuation"
)
// Values returns all known values for ItemType. Note that this can be expanded in
// the future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (ItemType) Values() []ItemType {
return []ItemType{
"pronunciation",
"punctuation",
}
}
type LanguageCode string
// Enum values for LanguageCode
const (
LanguageCodeEnUs LanguageCode = "en-US"
LanguageCodeEnGb LanguageCode = "en-GB"
LanguageCodeEsUs LanguageCode = "es-US"
LanguageCodeFrCa LanguageCode = "fr-CA"
LanguageCodeFrFr LanguageCode = "fr-FR"
LanguageCodeEnAu LanguageCode = "en-AU"
LanguageCodeItIt LanguageCode = "it-IT"
LanguageCodeDeDe LanguageCode = "de-DE"
LanguageCodePtBr LanguageCode = "pt-BR"
LanguageCodeJaJp LanguageCode = "ja-JP"
LanguageCodeKoKr LanguageCode = "ko-KR"
LanguageCodeZhCn LanguageCode = "zh-CN"
LanguageCodeHiIn LanguageCode = "hi-IN"
LanguageCodeThTh LanguageCode = "th-TH"
)
// Values returns all known values for LanguageCode. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (LanguageCode) Values() []LanguageCode {
return []LanguageCode{
"en-US",
"en-GB",
"es-US",
"fr-CA",
"fr-FR",
"en-AU",
"it-IT",
"de-DE",
"pt-BR",
"ja-JP",
"ko-KR",
"zh-CN",
"hi-IN",
"th-TH",
}
}
type MediaEncoding string
// Enum values for MediaEncoding
const (
MediaEncodingPcm MediaEncoding = "pcm"
MediaEncodingOggOpus MediaEncoding = "ogg-opus"
MediaEncodingFlac MediaEncoding = "flac"
)
// Values returns all known values for MediaEncoding. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (MediaEncoding) Values() []MediaEncoding {
return []MediaEncoding{
"pcm",
"ogg-opus",
"flac",
}
}
type MedicalContentIdentificationType string
// Enum values for MedicalContentIdentificationType
const (
MedicalContentIdentificationTypePhi MedicalContentIdentificationType = "PHI"
)
// Values returns all known values for MedicalContentIdentificationType. Note that
// this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (MedicalContentIdentificationType) Values() []MedicalContentIdentificationType {
return []MedicalContentIdentificationType{
"PHI",
}
}
type PartialResultsStability string
// Enum values for PartialResultsStability
const (
PartialResultsStabilityHigh PartialResultsStability = "high"
PartialResultsStabilityMedium PartialResultsStability = "medium"
PartialResultsStabilityLow PartialResultsStability = "low"
)
// Values returns all known values for PartialResultsStability. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (PartialResultsStability) Values() []PartialResultsStability {
return []PartialResultsStability{
"high",
"medium",
"low",
}
}
type ParticipantRole string
// Enum values for ParticipantRole
const (
ParticipantRoleAgent ParticipantRole = "AGENT"
ParticipantRoleCustomer ParticipantRole = "CUSTOMER"
)
// Values returns all known values for ParticipantRole. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ParticipantRole) Values() []ParticipantRole {
return []ParticipantRole{
"AGENT",
"CUSTOMER",
}
}
type Sentiment string
// Enum values for Sentiment
const (
SentimentPositive Sentiment = "POSITIVE"
SentimentNegative Sentiment = "NEGATIVE"
SentimentMixed Sentiment = "MIXED"
SentimentNeutral Sentiment = "NEUTRAL"
)
// Values returns all known values for Sentiment. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (Sentiment) Values() []Sentiment {
return []Sentiment{
"POSITIVE",
"NEGATIVE",
"MIXED",
"NEUTRAL",
}
}
type Specialty string
// Enum values for Specialty
const (
SpecialtyPrimarycare Specialty = "PRIMARYCARE"
SpecialtyCardiology Specialty = "CARDIOLOGY"
SpecialtyNeurology Specialty = "NEUROLOGY"
SpecialtyOncology Specialty = "ONCOLOGY"
SpecialtyRadiology Specialty = "RADIOLOGY"
SpecialtyUrology Specialty = "UROLOGY"
)
// Values returns all known values for Specialty. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (Specialty) Values() []Specialty {
return []Specialty{
"PRIMARYCARE",
"CARDIOLOGY",
"NEUROLOGY",
"ONCOLOGY",
"RADIOLOGY",
"UROLOGY",
}
}
type Type string
// Enum values for Type
const (
TypeConversation Type = "CONVERSATION"
TypeDictation Type = "DICTATION"
)
// Values returns all known values for Type. Note that this can be expanded in the
// future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (Type) Values() []Type {
return []Type{
"CONVERSATION",
"DICTATION",
}
}
type VocabularyFilterMethod string
// Enum values for VocabularyFilterMethod
const (
VocabularyFilterMethodRemove VocabularyFilterMethod = "remove"
VocabularyFilterMethodMask VocabularyFilterMethod = "mask"
VocabularyFilterMethodTag VocabularyFilterMethod = "tag"
)
// Values returns all known values for VocabularyFilterMethod. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (VocabularyFilterMethod) Values() []VocabularyFilterMethod {
return []VocabularyFilterMethod{
"remove",
"mask",
"tag",
}
}
| 307 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// One or more arguments to the StartStreamTranscription ,
// StartMedicalStreamTranscription , or StartCallAnalyticsStreamTranscription
// operation was not valid. For example, MediaEncoding or LanguageCode used not
// valid values. Check the specified parameters and try your request again.
type BadRequestException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *BadRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *BadRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *BadRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "BadRequestException"
}
return *e.ErrorCodeOverride
}
func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// A new stream started with the same session ID. The current stream has been
// terminated.
type ConflictException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// A problem occurred while processing the audio. Amazon Transcribe terminated
// processing.
type InternalFailureException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalFailureException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalFailureException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalFailureException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalFailureException"
}
return *e.ErrorCodeOverride
}
func (e *InternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Your client has exceeded one of the Amazon Transcribe limits. This is typically
// the audio length limit. Break your audio stream into smaller chunks and try your
// request again.
type LimitExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *LimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The service is currently unavailable. Try your request later.
type ServiceUnavailableException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ServiceUnavailableException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceUnavailableException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceUnavailableException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceUnavailableException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
)
// A list of possible alternative transcriptions for the input audio. Each
// alternative may contain one or more of Items , Entities , or Transcript .
type Alternative struct {
// Contains entities identified as personally identifiable information (PII) in
// your transcription output.
Entities []Entity
// Contains words, phrases, or punctuation marks in your transcription output.
Items []Item
// Contains transcribed text.
Transcript *string
noSmithyDocumentSerde
}
// A wrapper for your audio chunks. Your audio stream consists of one or more
// audio events, which consist of one or more audio chunks. For more information,
// see Event stream encoding (https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html)
// .
type AudioEvent struct {
// An audio blob that contains the next part of the audio that you want to
// transcribe. The maximum audio chunk size is 32 KB.
AudioChunk []byte
noSmithyDocumentSerde
}
// An encoded stream of audio blobs. Audio streams are encoded as either HTTP/2 or
// WebSocket data frames. For more information, see Transcribing streaming audio (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html)
// .
//
// The following types satisfy this interface:
//
// AudioStreamMemberAudioEvent
// AudioStreamMemberConfigurationEvent
type AudioStream interface {
isAudioStream()
}
// A blob of audio from your application. Your audio stream consists of one or
// more audio events. For more information, see Event stream encoding (https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html)
// .
type AudioStreamMemberAudioEvent struct {
Value AudioEvent
noSmithyDocumentSerde
}
func (*AudioStreamMemberAudioEvent) isAudioStream() {}
// Contains audio channel definitions and post-call analytics settings.
type AudioStreamMemberConfigurationEvent struct {
Value ConfigurationEvent
noSmithyDocumentSerde
}
func (*AudioStreamMemberConfigurationEvent) isAudioStream() {}
// Contains entities identified as personally identifiable information (PII) in
// your transcription output, along with various associated attributes. Examples
// include category, confidence score, content, type, and start and end times.
type CallAnalyticsEntity struct {
// The time, in milliseconds, from the beginning of the audio stream to the start
// of the identified entity.
BeginOffsetMillis *int64
// The category of information identified. For example, PII .
Category *string
// The confidence score associated with the identification of an entity in your
// transcript. Confidence scores are values between 0 and 1. A larger value
// indicates a higher probability that the identified entity correctly matches the
// entity spoken in your media.
Confidence *float64
// The word or words that represent the identified entity.
Content *string
// The time, in milliseconds, from the beginning of the audio stream to the end of
// the identified entity.
EndOffsetMillis *int64
// The type of PII identified. For example, NAME or CREDIT_DEBIT_NUMBER .
Type *string
noSmithyDocumentSerde
}
// A word, phrase, or punctuation mark in your Call Analytics transcription
// output, along with various associated attributes, such as confidence score,
// type, and start and end times.
type CallAnalyticsItem struct {
// The time, in milliseconds, from the beginning of the audio stream to the start
// of the identified item.
BeginOffsetMillis *int64
// The confidence score associated with a word or phrase in your transcript.
// Confidence scores are values between 0 and 1. A larger value indicates a higher
// probability that the identified item correctly matches the item spoken in your
// media.
Confidence *float64
// The word or punctuation that was transcribed.
Content *string
// The time, in milliseconds, from the beginning of the audio stream to the end of
// the identified item.
EndOffsetMillis *int64
// If partial result stabilization is enabled, Stable indicates whether the
// specified item is stable ( true ) or if it may change when the segment is
// complete ( false ).
Stable *bool
// The type of item identified. Options are: PRONUNCIATION (spoken words) and
// PUNCTUATION .
Type ItemType
// Indicates whether the specified item matches a word in the vocabulary filter
// included in your Call Analytics request. If true , there is a vocabulary filter
// match.
VocabularyFilterMatch bool
noSmithyDocumentSerde
}
// Contains detailed information about your Call Analytics streaming session.
// These details are provided in the UtteranceEvent and CategoryEvent objects.
//
// The following types satisfy this interface:
//
// CallAnalyticsTranscriptResultStreamMemberCategoryEvent
// CallAnalyticsTranscriptResultStreamMemberUtteranceEvent
type CallAnalyticsTranscriptResultStream interface {
isCallAnalyticsTranscriptResultStream()
}
// Provides information on matched categories that were used to generate real-time
// supervisor alerts.
type CallAnalyticsTranscriptResultStreamMemberCategoryEvent struct {
Value CategoryEvent
noSmithyDocumentSerde
}
func (*CallAnalyticsTranscriptResultStreamMemberCategoryEvent) isCallAnalyticsTranscriptResultStream() {
}
// Contains set of transcription results from one or more audio segments, along
// with additional information per your request parameters. This can include
// information relating to channel definitions, partial result stabilization,
// sentiment, issue detection, and other transcription-related data.
type CallAnalyticsTranscriptResultStreamMemberUtteranceEvent struct {
Value UtteranceEvent
noSmithyDocumentSerde
}
func (*CallAnalyticsTranscriptResultStreamMemberUtteranceEvent) isCallAnalyticsTranscriptResultStream() {
}
// Provides information on any TranscriptFilterType categories that matched your
// transcription output. Matches are identified for each segment upon completion of
// that segment.
type CategoryEvent struct {
// Lists the categories that were matched in your audio segment.
MatchedCategories []string
// Contains information about the matched categories, including category names and
// timestamps.
MatchedDetails map[string]PointsOfInterest
noSmithyDocumentSerde
}
// Makes it possible to specify which speaker is on which audio channel. For
// example, if your agent is the first participant to speak, you would set
// ChannelId to 0 (to indicate the first channel) and ParticipantRole to AGENT (to
// indicate that it's the agent speaking).
type ChannelDefinition struct {
// Specify the audio channel you want to define.
//
// This member is required.
ChannelId int32
// Specify the speaker you want to define. Omitting this parameter is equivalent
// to specifying both participants.
//
// This member is required.
ParticipantRole ParticipantRole
noSmithyDocumentSerde
}
// Provides the location, using character count, in your transcript where a match
// is identified. For example, the location of an issue or a category match within
// a segment.
type CharacterOffsets struct {
// Provides the character count of the first character where a match is
// identified. For example, the first character associated with an issue or a
// category match in a segment transcript.
Begin *int32
// Provides the character count of the last character where a match is identified.
// For example, the last character associated with an issue or a category match in
// a segment transcript.
End *int32
noSmithyDocumentSerde
}
// Allows you to set audio channel definitions and post-call analytics settings.
type ConfigurationEvent struct {
// Indicates which speaker is on which audio channel.
ChannelDefinitions []ChannelDefinition
// Provides additional optional settings for your Call Analytics post-call
// request, including encryption and output locations for your redacted and
// unredacted transcript.
PostCallAnalyticsSettings *PostCallAnalyticsSettings
noSmithyDocumentSerde
}
// Contains entities identified as personally identifiable information (PII) in
// your transcription output, along with various associated attributes. Examples
// include category, confidence score, type, stability score, and start and end
// times.
type Entity struct {
// The category of information identified. The only category is PII .
Category *string
// The confidence score associated with the identified PII entity in your audio.
// Confidence scores are values between 0 and 1. A larger value indicates a higher
// probability that the identified entity correctly matches the entity spoken in
// your media.
Confidence *float64
// The word or words identified as PII.
Content *string
// The end time, in milliseconds, of the utterance that was identified as PII.
EndTime float64
// The start time, in milliseconds, of the utterance that was identified as PII.
StartTime float64
// The type of PII identified. For example, NAME or CREDIT_DEBIT_NUMBER .
Type *string
noSmithyDocumentSerde
}
// Lists the issues that were identified in your audio segment.
type IssueDetected struct {
// Provides the timestamps that identify when in an audio segment the specified
// issue occurs.
CharacterOffsets *CharacterOffsets
noSmithyDocumentSerde
}
// A word, phrase, or punctuation mark in your transcription output, along with
// various associated attributes, such as confidence score, type, and start and end
// times.
type Item struct {
// The confidence score associated with a word or phrase in your transcript.
// Confidence scores are values between 0 and 1. A larger value indicates a higher
// probability that the identified item correctly matches the item spoken in your
// media.
Confidence *float64
// The word or punctuation that was transcribed.
Content *string
// The end time, in milliseconds, of the transcribed item.
EndTime float64
// If speaker partitioning is enabled, Speaker labels the speaker of the specified
// item.
Speaker *string
// If partial result stabilization is enabled, Stable indicates whether the
// specified item is stable ( true ) or if it may change when the segment is
// complete ( false ).
Stable *bool
// The start time, in milliseconds, of the transcribed item.
StartTime float64
// The type of item identified. Options are: PRONUNCIATION (spoken words) and
// PUNCTUATION .
Type ItemType
// Indicates whether the specified item matches a word in the vocabulary filter
// included in your request. If true , there is a vocabulary filter match.
VocabularyFilterMatch bool
noSmithyDocumentSerde
}
// The language code that represents the language identified in your audio,
// including the associated confidence score. If you enabled channel identification
// in your request and each channel contained a different language, you will have
// more than one LanguageWithScore result.
type LanguageWithScore struct {
// The language code of the identified language.
LanguageCode LanguageCode
// The confidence score associated with the identified language code. Confidence
// scores are values between zero and one; larger values indicate a higher
// confidence in the identified language.
Score float64
noSmithyDocumentSerde
}
// A list of possible alternative transcriptions for the input audio. Each
// alternative may contain one or more of Items , Entities , or Transcript .
type MedicalAlternative struct {
// Contains entities identified as personal health information (PHI) in your
// transcription output.
Entities []MedicalEntity
// Contains words, phrases, or punctuation marks in your transcription output.
Items []MedicalItem
// Contains transcribed text.
Transcript *string
noSmithyDocumentSerde
}
// Contains entities identified as personal health information (PHI) in your
// transcription output, along with various associated attributes. Examples include
// category, confidence score, type, stability score, and start and end times.
type MedicalEntity struct {
// The category of information identified. The only category is PHI .
Category *string
// The confidence score associated with the identified PHI entity in your audio.
// Confidence scores are values between 0 and 1. A larger value indicates a higher
// probability that the identified entity correctly matches the entity spoken in
// your media.
Confidence *float64
// The word or words identified as PHI.
Content *string
// The end time, in milliseconds, of the utterance that was identified as PHI.
EndTime float64
// The start time, in milliseconds, of the utterance that was identified as PHI.
StartTime float64
noSmithyDocumentSerde
}
// A word, phrase, or punctuation mark in your transcription output, along with
// various associated attributes, such as confidence score, type, and start and end
// times.
type MedicalItem struct {
// The confidence score associated with a word or phrase in your transcript.
// Confidence scores are values between 0 and 1. A larger value indicates a higher
// probability that the identified item correctly matches the item spoken in your
// media.
Confidence *float64
// The word or punctuation that was transcribed.
Content *string
// The end time, in milliseconds, of the transcribed item.
EndTime float64
// If speaker partitioning is enabled, Speaker labels the speaker of the specified
// item.
Speaker *string
// The start time, in milliseconds, of the transcribed item.
StartTime float64
// The type of item identified. Options are: PRONUNCIATION (spoken words) and
// PUNCTUATION .
Type ItemType
noSmithyDocumentSerde
}
// The Result associated with a . Contains a set of transcription results from one
// or more audio segments, along with additional information per your request
// parameters. This can include information relating to alternative transcriptions,
// channel identification, partial result stabilization, language identification,
// and other transcription-related data.
type MedicalResult struct {
// A list of possible alternative transcriptions for the input audio. Each
// alternative may contain one or more of Items , Entities , or Transcript .
Alternatives []MedicalAlternative
// Indicates the channel identified for the Result .
ChannelId *string
// The end time, in milliseconds, of the Result .
EndTime float64
// Indicates if the segment is complete. If IsPartial is true , the segment is not
// complete. If IsPartial is false , the segment is complete.
IsPartial bool
// Provides a unique identifier for the Result .
ResultId *string
// The start time, in milliseconds, of the Result .
StartTime float64
noSmithyDocumentSerde
}
// The MedicalTranscript associated with a . MedicalTranscript contains Results ,
// which contains a set of transcription results from one or more audio segments,
// along with additional information per your request parameters.
type MedicalTranscript struct {
// Contains a set of transcription results from one or more audio segments, along
// with additional information per your request parameters. This can include
// information relating to alternative transcriptions, channel identification,
// partial result stabilization, language identification, and other
// transcription-related data.
Results []MedicalResult
noSmithyDocumentSerde
}
// The MedicalTranscriptEvent associated with a MedicalTranscriptResultStream .
// Contains a set of transcription results from one or more audio segments, along
// with additional information per your request parameters.
type MedicalTranscriptEvent struct {
// Contains Results , which contains a set of transcription results from one or
// more audio segments, along with additional information per your request
// parameters. This can include information relating to alternative transcriptions,
// channel identification, partial result stabilization, language identification,
// and other transcription-related data.
Transcript *MedicalTranscript
noSmithyDocumentSerde
}
// Contains detailed information about your streaming session.
//
// The following types satisfy this interface:
//
// MedicalTranscriptResultStreamMemberTranscriptEvent
type MedicalTranscriptResultStream interface {
isMedicalTranscriptResultStream()
}
// The MedicalTranscriptEvent associated with a MedicalTranscriptResultStream .
// Contains a set of transcription results from one or more audio segments, along
// with additional information per your request parameters. This can include
// information relating to alternative transcriptions, channel identification,
// partial result stabilization, language identification, and other
// transcription-related data.
type MedicalTranscriptResultStreamMemberTranscriptEvent struct {
Value MedicalTranscriptEvent
noSmithyDocumentSerde
}
func (*MedicalTranscriptResultStreamMemberTranscriptEvent) isMedicalTranscriptResultStream() {}
// Contains the timestamps of matched categories.
type PointsOfInterest struct {
// Contains the timestamp ranges (start time through end time) of matched
// categories and rules.
TimestampRanges []TimestampRange
noSmithyDocumentSerde
}
// Allows you to specify additional settings for your streaming Call Analytics
// post-call request, including output locations for your redacted and unredacted
// transcript, which IAM role to use, and, optionally, which encryption key to use.
// ContentRedactionOutput , DataAccessRoleArn , and OutputLocation are required
// fields.
type PostCallAnalyticsSettings struct {
// The Amazon Resource Name (ARN) of an IAM role that has permissions to access
// the Amazon S3 bucket that contains your input files. If the role that you
// specify doesn’t have the appropriate permissions to access the specified Amazon
// S3 location, your request fails. IAM role ARNs have the format
// arn:partition:iam::account:role/role-name-with-path . For example:
// arn:aws:iam::111122223333:role/Admin . For more information, see IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns)
// .
//
// This member is required.
DataAccessRoleArn *string
// The Amazon S3 location where you want your Call Analytics post-call
// transcription output stored. You can use any of the following formats to specify
// the output location:
// - s3://DOC-EXAMPLE-BUCKET
// - s3://DOC-EXAMPLE-BUCKET/my-output-folder/
// - s3://DOC-EXAMPLE-BUCKET/my-output-folder/my-call-analytics-job.json
//
// This member is required.
OutputLocation *string
// Specify whether you want only a redacted transcript or both a redacted and an
// unredacted transcript. If you choose redacted and unredacted, two JSON files are
// generated and stored in the Amazon S3 output location you specify. Note that to
// include ContentRedactionOutput in your request, you must enable content
// redaction ( ContentRedactionType ).
ContentRedactionOutput ContentRedactionOutput
// The KMS key you want to use to encrypt your Call Analytics post-call output. If
// using a key located in the current Amazon Web Services account, you can specify
// your KMS key in one of four ways:
// - Use the KMS key ID itself. For example, 1234abcd-12ab-34cd-56ef-1234567890ab
// .
// - Use an alias for the KMS key ID. For example, alias/ExampleAlias .
// - Use the Amazon Resource Name (ARN) for the KMS key ID. For example,
// arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab .
// - Use the ARN for the KMS key alias. For example,
// arn:aws:kms:region:account-ID:alias/ExampleAlias .
// If using a key located in a different Amazon Web Services account than the
// current Amazon Web Services account, you can specify your KMS key in one of two
// ways:
// - Use the ARN for the KMS key ID. For example,
// arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab .
// - Use the ARN for the KMS key alias. For example,
// arn:aws:kms:region:account-ID:alias/ExampleAlias .
// Note that the user making the request must have permission to use the specified
// KMS key.
OutputEncryptionKMSKeyId *string
noSmithyDocumentSerde
}
// The Result associated with a . Contains a set of transcription results from one
// or more audio segments, along with additional information per your request
// parameters. This can include information relating to alternative transcriptions,
// channel identification, partial result stabilization, language identification,
// and other transcription-related data.
type Result struct {
// A list of possible alternative transcriptions for the input audio. Each
// alternative may contain one or more of Items , Entities , or Transcript .
Alternatives []Alternative
// Indicates which audio channel is associated with the Result .
ChannelId *string
// The end time, in milliseconds, of the Result .
EndTime float64
// Indicates if the segment is complete. If IsPartial is true , the segment is not
// complete. If IsPartial is false , the segment is complete.
IsPartial bool
// The language code that represents the language spoken in your audio stream.
LanguageCode LanguageCode
// The language code of the dominant language identified in your stream. If you
// enabled channel identification and each channel of your audio contains a
// different language, you may have more than one result.
LanguageIdentification []LanguageWithScore
// Provides a unique identifier for the Result .
ResultId *string
// The start time, in milliseconds, of the Result .
StartTime float64
noSmithyDocumentSerde
}
// Contains the timestamp range (start time through end time) of a matched
// category.
type TimestampRange struct {
// The time, in milliseconds, from the beginning of the audio stream to the start
// of the category match.
BeginOffsetMillis *int64
// The time, in milliseconds, from the beginning of the audio stream to the end of
// the category match.
EndOffsetMillis *int64
noSmithyDocumentSerde
}
// The Transcript associated with a . Transcript contains Results , which contains
// a set of transcription results from one or more audio segments, along with
// additional information per your request parameters.
type Transcript struct {
// Contains a set of transcription results from one or more audio segments, along
// with additional information per your request parameters. This can include
// information relating to alternative transcriptions, channel identification,
// partial result stabilization, language identification, and other
// transcription-related data.
Results []Result
noSmithyDocumentSerde
}
// The TranscriptEvent associated with a TranscriptResultStream . Contains a set of
// transcription results from one or more audio segments, along with additional
// information per your request parameters.
type TranscriptEvent struct {
// Contains Results , which contains a set of transcription results from one or
// more audio segments, along with additional information per your request
// parameters. This can include information relating to alternative transcriptions,
// channel identification, partial result stabilization, language identification,
// and other transcription-related data.
Transcript *Transcript
noSmithyDocumentSerde
}
// Contains detailed information about your streaming session.
//
// The following types satisfy this interface:
//
// TranscriptResultStreamMemberTranscriptEvent
type TranscriptResultStream interface {
isTranscriptResultStream()
}
// Contains Transcript , which contains Results . The object contains a set of
// transcription results from one or more audio segments, along with additional
// information per your request parameters.
type TranscriptResultStreamMemberTranscriptEvent struct {
Value TranscriptEvent
noSmithyDocumentSerde
}
func (*TranscriptResultStreamMemberTranscriptEvent) isTranscriptResultStream() {}
// Contains set of transcription results from one or more audio segments, along
// with additional information about the parameters included in your request. For
// example, channel definitions, partial result stabilization, sentiment, and issue
// detection.
type UtteranceEvent struct {
// The time, in milliseconds, from the beginning of the audio stream to the start
// of the UtteranceEvent .
BeginOffsetMillis *int64
// The time, in milliseconds, from the beginning of the audio stream to the start
// of the UtteranceEvent .
EndOffsetMillis *int64
// Contains entities identified as personally identifiable information (PII) in
// your transcription output.
Entities []CallAnalyticsEntity
// Indicates whether the segment in the UtteranceEvent is complete ( FALSE ) or
// partial ( TRUE ).
IsPartial bool
// Provides the issue that was detected in the specified segment.
IssuesDetected []IssueDetected
// Contains words, phrases, or punctuation marks that are associated with the
// specified UtteranceEvent .
Items []CallAnalyticsItem
// Provides the role of the speaker for each audio channel, either CUSTOMER or
// AGENT .
ParticipantRole ParticipantRole
// Provides the sentiment that was detected in the specified segment.
Sentiment Sentiment
// Contains transcribed text.
Transcript *string
// The unique identifier that is associated with the specified UtteranceEvent .
UtteranceId *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
// UnknownUnionMember is returned when a union member is returned over the wire,
// but has an unknown tag.
type UnknownUnionMember struct {
Tag string
Value []byte
noSmithyDocumentSerde
}
func (*UnknownUnionMember) isAudioStream() {}
func (*UnknownUnionMember) isCallAnalyticsTranscriptResultStream() {}
func (*UnknownUnionMember) isMedicalTranscriptResultStream() {}
func (*UnknownUnionMember) isTranscriptResultStream() {}
| 729 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types_test
import (
"fmt"
"github.com/aws/aws-sdk-go-v2/service/transcribestreaming/types"
)
func ExampleAudioStream_outputUsage() {
var union types.AudioStream
// type switches can be used to check the union value
switch v := union.(type) {
case *types.AudioStreamMemberAudioEvent:
_ = v.Value // Value is types.AudioEvent
case *types.AudioStreamMemberConfigurationEvent:
_ = v.Value // Value is types.ConfigurationEvent
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.ConfigurationEvent
var _ *types.AudioEvent
func ExampleCallAnalyticsTranscriptResultStream_outputUsage() {
var union types.CallAnalyticsTranscriptResultStream
// type switches can be used to check the union value
switch v := union.(type) {
case *types.CallAnalyticsTranscriptResultStreamMemberCategoryEvent:
_ = v.Value // Value is types.CategoryEvent
case *types.CallAnalyticsTranscriptResultStreamMemberUtteranceEvent:
_ = v.Value // Value is types.UtteranceEvent
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.CategoryEvent
var _ *types.UtteranceEvent
func ExampleMedicalTranscriptResultStream_outputUsage() {
var union types.MedicalTranscriptResultStream
// type switches can be used to check the union value
switch v := union.(type) {
case *types.MedicalTranscriptResultStreamMemberTranscriptEvent:
_ = v.Value // Value is types.MedicalTranscriptEvent
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.MedicalTranscriptEvent
func ExampleTranscriptResultStream_outputUsage() {
var union types.TranscriptResultStream
// type switches can be used to check the union value
switch v := union.(type) {
case *types.TranscriptResultStreamMemberTranscriptEvent:
_ = v.Value // Value is types.TranscriptEvent
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.TranscriptEvent
| 89 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "Transfer"
const ServiceAPIVersion = "2018-11-05"
// Client provides the API client to make operations call for AWS Transfer Family.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "transfer", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 434 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transfer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Used by administrators to choose which groups in the directory should have
// access to upload and download files over the enabled protocols using Transfer
// Family. For example, a Microsoft Active Directory might contain 50,000 users,
// but only a small fraction might need the ability to transfer files to the
// server. An administrator can use CreateAccess to limit the access to the
// correct set of users who need this ability.
func (c *Client) CreateAccess(ctx context.Context, params *CreateAccessInput, optFns ...func(*Options)) (*CreateAccessOutput, error) {
if params == nil {
params = &CreateAccessInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAccess", params, optFns, c.addOperationCreateAccessMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAccessOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAccessInput struct {
// A unique identifier that is required to identify specific groups within your
// directory. The users of the group that you associate have access to your Amazon
// S3 or Amazon EFS resources over the enabled protocols using Transfer Family. If
// you know the group name, you can view the SID values by running the following
// command using Windows PowerShell. Get-ADGroup -Filter {samAccountName -like
// "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid In that
// command, replace YourGroupName with the name of your Active Directory group. The
// regular expression used to validate this parameter is a string of characters
// consisting of uppercase and lowercase alphanumeric characters with no spaces.
// You can also include underscores or any of the following characters: =,.@:/-
//
// This member is required.
ExternalId *string
// The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role
// that controls your users' access to your Amazon S3 bucket or Amazon EFS file
// system. The policies attached to this role determine the level of access that
// you want to provide your users when transferring files into and out of your
// Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a
// trust relationship that allows the server to access your resources when
// servicing your users' transfer requests.
//
// This member is required.
Role *string
// A system-assigned unique identifier for a server instance. This is the specific
// server that you added your user to.
//
// This member is required.
ServerId *string
// The landing directory (folder) for a user when they log in to the server using
// the client. A HomeDirectory example is /bucket_name/home/mydirectory .
HomeDirectory *string
// Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and
// keys should be visible to your user and how you want to make them visible. You
// must specify the Entry and Target pair, where Entry shows how the path is made
// visible and Target is the actual Amazon S3 or Amazon EFS path. If you only
// specify a target, it is displayed as is. You also must ensure that your Identity
// and Access Management (IAM) role provides access to paths in Target . This value
// can be set only when HomeDirectoryType is set to LOGICAL. The following is an
// Entry and Target pair example. [ { "Entry": "/directory1", "Target":
// "/bucket_name/home/mydirectory" } ] In most cases, you can use this value
// instead of the session policy to lock down your user to the designated home
// directory (" chroot "). To do this, you can set Entry to / and set Target to
// the HomeDirectory parameter value. The following is an Entry and Target pair
// example for chroot . [ { "Entry": "/", "Target":
// "/bucket_name/home/mydirectory" } ]
HomeDirectoryMappings []types.HomeDirectoryMapEntry
// The type of landing directory (folder) that you want your users' home directory
// to be when they log in to the server. If you set it to PATH , the user will see
// the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol
// clients. If you set it LOGICAL , you need to provide mappings in the
// HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths
// visible to your users.
HomeDirectoryType types.HomeDirectoryType
// A session policy for your user so that you can use the same Identity and Access
// Management (IAM) role across multiple users. This policy scopes down a user's
// access to portions of their Amazon S3 bucket. Variables that you can use inside
// this policy include ${Transfer:UserName} , ${Transfer:HomeDirectory} , and
// ${Transfer:HomeBucket} . This policy applies only when the domain of ServerId
// is Amazon S3. Amazon EFS does not use session policies. For session policies,
// Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource
// Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the
// Policy argument. For an example of a session policy, see Example session policy (https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html)
// . For more information, see AssumeRole (https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html)
// in the Security Token Service API Reference.
Policy *string
// The full POSIX identity, including user ID ( Uid ), group ID ( Gid ), and any
// secondary groups IDs ( SecondaryGids ), that controls your users' access to your
// Amazon EFS file systems. The POSIX permissions that are set on files and
// directories in your file system determine the level of access your users get
// when transferring files into and out of your Amazon EFS file systems.
PosixProfile *types.PosixProfile
noSmithyDocumentSerde
}
type CreateAccessOutput struct {
// The external identifier of the group whose users have access to your Amazon S3
// or Amazon EFS resources over the enabled protocols using Transfer Family.
//
// This member is required.
ExternalId *string
// The identifier of the server that the user is attached to.
//
// This member is required.
ServerId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAccessMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAccess{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAccess{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateAccessValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccess(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateAccess(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "CreateAccess",
}
}
| 212 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transfer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an agreement. An agreement is a bilateral trading partner agreement, or
// partnership, between an Transfer Family server and an AS2 process. The agreement
// defines the file and message transfer relationship between the server and the
// AS2 process. To define an agreement, Transfer Family combines a server, local
// profile, partner profile, certificate, and other attributes. The partner is
// identified with the PartnerProfileId , and the AS2 process is identified with
// the LocalProfileId .
func (c *Client) CreateAgreement(ctx context.Context, params *CreateAgreementInput, optFns ...func(*Options)) (*CreateAgreementOutput, error) {
if params == nil {
params = &CreateAgreementInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAgreement", params, optFns, c.addOperationCreateAgreementMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAgreementOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAgreementInput struct {
// With AS2, you can send files by calling StartFileTransfer and specifying the
// file paths in the request parameter, SendFilePaths . We use the file’s parent
// directory (for example, for --send-file-paths /bucket/dir/file.txt , parent
// directory is /bucket/dir/ ) to temporarily store a processed AS2 message file,
// store the MDN when we receive them from the partner, and write a final JSON file
// containing relevant metadata of the transmission. So, the AccessRole needs to
// provide read and write access to the parent directory of the file location used
// in the StartFileTransfer request. Additionally, you need to provide read and
// write access to the parent directory of the files that you intend to send with
// StartFileTransfer . If you are using Basic authentication for your AS2
// connector, the access role requires the secretsmanager:GetSecretValue
// permission for the secret. If the secret is encrypted using a customer-managed
// key instead of the Amazon Web Services managed key in Secrets Manager, then the
// role also needs the kms:Decrypt permission for that key.
//
// This member is required.
AccessRole *string
// The landing directory (folder) for files transferred by using the AS2 protocol.
// A BaseDirectory example is /DOC-EXAMPLE-BUCKET/home/mydirectory .
//
// This member is required.
BaseDirectory *string
// A unique identifier for the AS2 local profile.
//
// This member is required.
LocalProfileId *string
// A unique identifier for the partner profile used in the agreement.
//
// This member is required.
PartnerProfileId *string
// A system-assigned unique identifier for a server instance. This is the specific
// server that the agreement uses.
//
// This member is required.
ServerId *string
// A name or short description to identify the agreement.
Description *string
// The status of the agreement. The agreement can be either ACTIVE or INACTIVE .
Status types.AgreementStatusType
// Key-value pairs that can be used to group and search for agreements.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateAgreementOutput struct {
// The unique identifier for the agreement. Use this ID for deleting, or updating
// an agreement, as well as in any other API calls that require that you specify
// the agreement ID.
//
// This member is required.
AgreementId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAgreementMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAgreement{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAgreement{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateAgreementValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAgreement(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateAgreement(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "CreateAgreement",
}
}
| 179 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transfer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates the connector, which captures the parameters for an outbound connection
// for the AS2 protocol. The connector is required for sending files to an
// externally hosted AS2 server. For more details about connectors, see Create AS2
// connectors (https://docs.aws.amazon.com/transfer/latest/userguide/create-b2b-server.html#configure-as2-connector)
// .
func (c *Client) CreateConnector(ctx context.Context, params *CreateConnectorInput, optFns ...func(*Options)) (*CreateConnectorOutput, error) {
if params == nil {
params = &CreateConnectorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateConnector", params, optFns, c.addOperationCreateConnectorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateConnectorOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateConnectorInput struct {
// With AS2, you can send files by calling StartFileTransfer and specifying the
// file paths in the request parameter, SendFilePaths . We use the file’s parent
// directory (for example, for --send-file-paths /bucket/dir/file.txt , parent
// directory is /bucket/dir/ ) to temporarily store a processed AS2 message file,
// store the MDN when we receive them from the partner, and write a final JSON file
// containing relevant metadata of the transmission. So, the AccessRole needs to
// provide read and write access to the parent directory of the file location used
// in the StartFileTransfer request. Additionally, you need to provide read and
// write access to the parent directory of the files that you intend to send with
// StartFileTransfer . If you are using Basic authentication for your AS2
// connector, the access role requires the secretsmanager:GetSecretValue
// permission for the secret. If the secret is encrypted using a customer-managed
// key instead of the Amazon Web Services managed key in Secrets Manager, then the
// role also needs the kms:Decrypt permission for that key.
//
// This member is required.
AccessRole *string
// A structure that contains the parameters for a connector object.
//
// This member is required.
As2Config *types.As2ConnectorConfig
// The URL of the partner's AS2 endpoint.
//
// This member is required.
Url *string
// The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role
// that allows a connector to turn on CloudWatch logging for Amazon S3 events. When
// set, you can view connector activity in your CloudWatch logs.
LoggingRole *string
// Key-value pairs that can be used to group and search for connectors. Tags are
// metadata attached to connectors for any purpose.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateConnectorOutput struct {
// The unique identifier for the connector, returned after the API call succeeds.
//
// This member is required.
ConnectorId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateConnector{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateConnector{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateConnectorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateConnector(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateConnector(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "CreateConnector",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transfer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates the local or partner profile to use for AS2 transfers.
func (c *Client) CreateProfile(ctx context.Context, params *CreateProfileInput, optFns ...func(*Options)) (*CreateProfileOutput, error) {
if params == nil {
params = &CreateProfileInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateProfile", params, optFns, c.addOperationCreateProfileMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateProfileOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateProfileInput struct {
// The As2Id is the AS2-name, as defined in the RFC 4130 (https://datatracker.ietf.org/doc/html/rfc4130)
// . For inbound transfers, this is the AS2-From header for the AS2 messages sent
// from the partner. For outbound connectors, this is the AS2-To header for the
// AS2 messages sent to the partner using the StartFileTransfer API operation.
// This ID cannot include spaces.
//
// This member is required.
As2Id *string
// Determines the type of profile to create:
// - Specify LOCAL to create a local profile. A local profile represents the
// AS2-enabled Transfer Family server organization or party.
// - Specify PARTNER to create a partner profile. A partner profile represents a
// remote organization, external to Transfer Family.
//
// This member is required.
ProfileType types.ProfileType
// An array of identifiers for the imported certificates. You use this identifier
// for working with profiles and partner profiles.
CertificateIds []string
// Key-value pairs that can be used to group and search for AS2 profiles.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateProfileOutput struct {
// The unique identifier for the AS2 profile, returned after the API call succeeds.
//
// This member is required.
ProfileId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateProfileMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateProfile{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateProfile{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateProfileValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProfile(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateProfile(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "CreateProfile",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transfer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Instantiates an auto-scaling virtual server based on the selected file transfer
// protocol in Amazon Web Services. When you make updates to your file transfer
// protocol-enabled server or when you work with users, use the service-generated
// ServerId property that is assigned to the newly created server.
func (c *Client) CreateServer(ctx context.Context, params *CreateServerInput, optFns ...func(*Options)) (*CreateServerOutput, error) {
if params == nil {
params = &CreateServerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateServer", params, optFns, c.addOperationCreateServerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateServerOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateServerInput struct {
// The Amazon Resource Name (ARN) of the Certificate Manager (ACM) certificate.
// Required when Protocols is set to FTPS . To request a new public certificate,
// see Request a public certificate (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html)
// in the Certificate Manager User Guide. To import an existing certificate into
// ACM, see Importing certificates into ACM (https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html)
// in the Certificate Manager User Guide. To request a private certificate to use
// FTPS through private IP addresses, see Request a private certificate (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-private.html)
// in the Certificate Manager User Guide. Certificates with the following
// cryptographic algorithms and key sizes are supported:
// - 2048-bit RSA (RSA_2048)
// - 4096-bit RSA (RSA_4096)
// - Elliptic Prime Curve 256 bit (EC_prime256v1)
// - Elliptic Prime Curve 384 bit (EC_secp384r1)
// - Elliptic Prime Curve 521 bit (EC_secp521r1)
// The certificate must be a valid SSL/TLS X.509 version 3 certificate with FQDN
// or IP address specified and information about the issuer.
Certificate *string
// The domain of the storage system that is used for file transfers. There are two
// domains available: Amazon Simple Storage Service (Amazon S3) and Amazon Elastic
// File System (Amazon EFS). The default value is S3. After the server is created,
// the domain cannot be changed.
Domain types.Domain
// The virtual private cloud (VPC) endpoint settings that are configured for your
// server. When you host your endpoint within your VPC, you can make your endpoint
// accessible only to resources within your VPC, or you can attach Elastic IP
// addresses and make your endpoint accessible to clients over the internet. Your
// VPC's default security groups are automatically assigned to your endpoint.
EndpointDetails *types.EndpointDetails
// The type of endpoint that you want your server to use. You can choose to make
// your server's endpoint publicly accessible (PUBLIC) or host it inside your VPC.
// With an endpoint that is hosted in a VPC, you can restrict access to your server
// and resources only within your VPC or choose to make it internet facing by
// attaching Elastic IP addresses directly to it. After May 19, 2021, you won't be
// able to create a server using EndpointType=VPC_ENDPOINT in your Amazon Web
// Services account if your account hasn't already done so before May 19, 2021. If
// you have already created servers with EndpointType=VPC_ENDPOINT in your Amazon
// Web Services account on or before May 19, 2021, you will not be affected. After
// this date, use EndpointType = VPC . For more information, see
// https://docs.aws.amazon.com/transfer/latest/userguide/create-server-in-vpc.html#deprecate-vpc-endpoint.
// It is recommended that you use VPC as the EndpointType . With this endpoint
// type, you have the option to directly associate up to three Elastic IPv4
// addresses (BYO IP included) with your server's endpoint and use VPC security
// groups to restrict traffic by the client's public IP address. This is not
// possible with EndpointType set to VPC_ENDPOINT .
EndpointType types.EndpointType
// The RSA, ECDSA, or ED25519 private key to use for your SFTP-enabled server. You
// can add multiple host keys, in case you want to rotate keys, or have a set of
// active keys that use different algorithms. Use the following command to generate
// an RSA 2048 bit key with no passphrase: ssh-keygen -t rsa -b 2048 -N "" -m PEM
// -f my-new-server-key . Use a minimum value of 2048 for the -b option. You can
// create a stronger key by using 3072 or 4096. Use the following command to
// generate an ECDSA 256 bit key with no passphrase: ssh-keygen -t ecdsa -b 256 -N
// "" -m PEM -f my-new-server-key . Valid values for the -b option for ECDSA are
// 256, 384, and 521. Use the following command to generate an ED25519 key with no
// passphrase: ssh-keygen -t ed25519 -N "" -f my-new-server-key . For all of these
// commands, you can replace my-new-server-key with a string of your choice. If you
// aren't planning to migrate existing users from an existing SFTP-enabled server
// to a new server, don't update the host key. Accidentally changing a server's
// host key can be disruptive. For more information, see Manage host keys for your
// SFTP-enabled server (https://docs.aws.amazon.com/transfer/latest/userguide/edit-server-config.html#configuring-servers-change-host-key)
// in the Transfer Family User Guide.
HostKey *string
// Required when IdentityProviderType is set to AWS_DIRECTORY_SERVICE , Amazon Web
// Services_LAMBDA or API_GATEWAY . Accepts an array containing all of the
// information required to use a directory in AWS_DIRECTORY_SERVICE or invoke a
// customer-supplied authentication API, including the API Gateway URL. Not
// required when IdentityProviderType is set to SERVICE_MANAGED .
IdentityProviderDetails *types.IdentityProviderDetails
// The mode of authentication for a server. The default value is SERVICE_MANAGED ,
// which allows you to store and access user credentials within the Transfer Family
// service. Use AWS_DIRECTORY_SERVICE to provide access to Active Directory groups
// in Directory Service for Microsoft Active Directory or Microsoft Active
// Directory in your on-premises environment or in Amazon Web Services using AD
// Connector. This option also requires you to provide a Directory ID by using the
// IdentityProviderDetails parameter. Use the API_GATEWAY value to integrate with
// an identity provider of your choosing. The API_GATEWAY setting requires you to
// provide an Amazon API Gateway endpoint URL to call for authentication by using
// the IdentityProviderDetails parameter. Use the AWS_LAMBDA value to directly use
// an Lambda function as your identity provider. If you choose this value, you must
// specify the ARN for the Lambda function in the Function parameter for the
// IdentityProviderDetails data type.
IdentityProviderType types.IdentityProviderType
// The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role
// that allows a server to turn on Amazon CloudWatch logging for Amazon S3 or
// Amazon EFSevents. When set, you can view user activity in your CloudWatch logs.
LoggingRole *string
// Specifies a string to display when users connect to a server. This string is
// displayed after the user authenticates. The SFTP protocol does not support
// post-authentication display banners.
PostAuthenticationLoginBanner *string
// Specifies a string to display when users connect to a server. This string is
// displayed before the user authenticates. For example, the following banner
// displays details about using the system: This system is for the use of
// authorized users only. Individuals using this computer system without authority,
// or in excess of their authority, are subject to having all of their activities
// on this system monitored and recorded by system personnel.
PreAuthenticationLoginBanner *string
// The protocol settings that are configured for your server.
// - To indicate passive mode (for FTP and FTPS protocols), use the PassiveIp
// parameter. Enter a single dotted-quad IPv4 address, such as the external IP
// address of a firewall, router, or load balancer.
// - To ignore the error that is generated when the client attempts to use the
// SETSTAT command on a file that you are uploading to an Amazon S3 bucket, use
// the SetStatOption parameter. To have the Transfer Family server ignore the
// SETSTAT command and upload files without needing to make any changes to your
// SFTP client, set the value to ENABLE_NO_OP . If you set the SetStatOption
// parameter to ENABLE_NO_OP , Transfer Family generates a log entry to Amazon
// CloudWatch Logs, so that you can determine when the client is making a SETSTAT
// call.
// - To determine whether your Transfer Family server resumes recent, negotiated
// sessions through a unique session ID, use the TlsSessionResumptionMode
// parameter.
// - As2Transports indicates the transport method for the AS2 messages.
// Currently, only HTTP is supported.
ProtocolDetails *types.ProtocolDetails
// Specifies the file transfer protocol or protocols over which your file transfer
// protocol client can connect to your server's endpoint. The available protocols
// are:
// - SFTP (Secure Shell (SSH) File Transfer Protocol): File transfer over SSH
// - FTPS (File Transfer Protocol Secure): File transfer with TLS encryption
// - FTP (File Transfer Protocol): Unencrypted file transfer
// - AS2 (Applicability Statement 2): used for transporting structured
// business-to-business data
//
// - If you select FTPS , you must choose a certificate stored in Certificate
// Manager (ACM) which is used to identify your server when clients connect to it
// over FTPS.
// - If Protocol includes either FTP or FTPS , then the EndpointType must be VPC
// and the IdentityProviderType must be either AWS_DIRECTORY_SERVICE , AWS_LAMBDA
// , or API_GATEWAY .
// - If Protocol includes FTP , then AddressAllocationIds cannot be associated.
// - If Protocol is set only to SFTP , the EndpointType can be set to PUBLIC and
// the IdentityProviderType can be set any of the supported identity types:
// SERVICE_MANAGED , AWS_DIRECTORY_SERVICE , AWS_LAMBDA , or API_GATEWAY .
// - If Protocol includes AS2 , then the EndpointType must be VPC , and domain
// must be Amazon S3.
Protocols []types.Protocol
// Specifies the name of the security policy that is attached to the server.
SecurityPolicyName *string
// Specifies the log groups to which your server logs are sent. To specify a log
// group, you must provide the ARN for an existing log group. In this case, the
// format of the log group is as follows:
// arn:aws:logs:region-name:amazon-account-id:log-group:log-group-name:* For
// example, arn:aws:logs:us-east-1:111122223333:log-group:mytestgroup:* If you
// have previously specified a log group for a server, you can clear it, and in
// effect turn off structured logging, by providing an empty value for this
// parameter in an update-server call. For example: update-server --server-id
// s-1234567890abcdef0 --structured-log-destinations
StructuredLogDestinations []string
// Key-value pairs that can be used to group and search for servers.
Tags []types.Tag
// Specifies the workflow ID for the workflow to assign and the execution role
// that's used for executing the workflow. In addition to a workflow to execute
// when a file is uploaded completely, WorkflowDetails can also contain a workflow
// ID (and execution role) for a workflow to execute on partial upload. A partial
// upload occurs when the server session disconnects while the file is still being
// uploaded.
WorkflowDetails *types.WorkflowDetails
noSmithyDocumentSerde
}
type CreateServerOutput struct {
// The service-assigned identifier of the server that is created.
//
// This member is required.
ServerId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateServerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateServer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateServer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateServerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateServer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateServer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "CreateServer",
}
}
| 299 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transfer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a user and associates them with an existing file transfer
// protocol-enabled server. You can only create and associate users with servers
// that have the IdentityProviderType set to SERVICE_MANAGED . Using parameters for
// CreateUser , you can specify the user name, set the home directory, store the
// user's public key, and assign the user's Identity and Access Management (IAM)
// role. You can also optionally add a session policy, and assign metadata with
// tags that can be used to group and search for users.
func (c *Client) CreateUser(ctx context.Context, params *CreateUserInput, optFns ...func(*Options)) (*CreateUserOutput, error) {
if params == nil {
params = &CreateUserInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateUser", params, optFns, c.addOperationCreateUserMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateUserOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateUserInput struct {
// The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role
// that controls your users' access to your Amazon S3 bucket or Amazon EFS file
// system. The policies attached to this role determine the level of access that
// you want to provide your users when transferring files into and out of your
// Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a
// trust relationship that allows the server to access your resources when
// servicing your users' transfer requests.
//
// This member is required.
Role *string
// A system-assigned unique identifier for a server instance. This is the specific
// server that you added your user to.
//
// This member is required.
ServerId *string
// A unique string that identifies a user and is associated with a ServerId . This
// user name must be a minimum of 3 and a maximum of 100 characters long. The
// following are valid characters: a-z, A-Z, 0-9, underscore '_', hyphen '-',
// period '.', and at sign '@'. The user name can't start with a hyphen, period, or
// at sign.
//
// This member is required.
UserName *string
// The landing directory (folder) for a user when they log in to the server using
// the client. A HomeDirectory example is /bucket_name/home/mydirectory .
HomeDirectory *string
// Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and
// keys should be visible to your user and how you want to make them visible. You
// must specify the Entry and Target pair, where Entry shows how the path is made
// visible and Target is the actual Amazon S3 or Amazon EFS path. If you only
// specify a target, it is displayed as is. You also must ensure that your Identity
// and Access Management (IAM) role provides access to paths in Target . This value
// can be set only when HomeDirectoryType is set to LOGICAL. The following is an
// Entry and Target pair example. [ { "Entry": "/directory1", "Target":
// "/bucket_name/home/mydirectory" } ] In most cases, you can use this value
// instead of the session policy to lock your user down to the designated home
// directory (" chroot "). To do this, you can set Entry to / and set Target to
// the HomeDirectory parameter value. The following is an Entry and Target pair
// example for chroot . [ { "Entry": "/", "Target":
// "/bucket_name/home/mydirectory" } ]
HomeDirectoryMappings []types.HomeDirectoryMapEntry
// The type of landing directory (folder) that you want your users' home directory
// to be when they log in to the server. If you set it to PATH , the user will see
// the absolute Amazon S3 bucket or EFS paths as is in their file transfer protocol
// clients. If you set it LOGICAL , you need to provide mappings in the
// HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths
// visible to your users.
HomeDirectoryType types.HomeDirectoryType
// A session policy for your user so that you can use the same Identity and Access
// Management (IAM) role across multiple users. This policy scopes down a user's
// access to portions of their Amazon S3 bucket. Variables that you can use inside
// this policy include ${Transfer:UserName} , ${Transfer:HomeDirectory} , and
// ${Transfer:HomeBucket} . This policy applies only when the domain of ServerId
// is Amazon S3. Amazon EFS does not use session policies. For session policies,
// Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource
// Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the
// Policy argument. For an example of a session policy, see Example session policy (https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html)
// . For more information, see AssumeRole (https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html)
// in the Amazon Web Services Security Token Service API Reference.
Policy *string
// Specifies the full POSIX identity, including user ID ( Uid ), group ID ( Gid ),
// and any secondary groups IDs ( SecondaryGids ), that controls your users' access
// to your Amazon EFS file systems. The POSIX permissions that are set on files and
// directories in Amazon EFS determine the level of access your users get when
// transferring files into and out of your Amazon EFS file systems.
PosixProfile *types.PosixProfile
// The public portion of the Secure Shell (SSH) key used to authenticate the user
// to the server. The three standard SSH public key format elements are , , and an
// optional , with spaces between each element. Transfer Family accepts RSA,
// ECDSA, and ED25519 keys.
// - For RSA keys, the key type is ssh-rsa .
// - For ED25519 keys, the key type is ssh-ed25519 .
// - For ECDSA keys, the key type is either ecdsa-sha2-nistp256 ,
// ecdsa-sha2-nistp384 , or ecdsa-sha2-nistp521 , depending on the size of the
// key you generated.
SshPublicKeyBody *string
// Key-value pairs that can be used to group and search for users. Tags are
// metadata attached to users for any purpose.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateUserOutput struct {
// The identifier of the server that the user is attached to.
//
// This member is required.
ServerId *string
// A unique string that identifies a Transfer Family user.
//
// This member is required.
UserName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateUserMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateUser{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateUser{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateUserValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateUser(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateUser(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "CreateUser",
}
}
| 222 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transfer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Allows you to create a workflow with specified steps and step details the
// workflow invokes after file transfer completes. After creating a workflow, you
// can associate the workflow created with any transfer servers by specifying the
// workflow-details field in CreateServer and UpdateServer operations.
func (c *Client) CreateWorkflow(ctx context.Context, params *CreateWorkflowInput, optFns ...func(*Options)) (*CreateWorkflowOutput, error) {
if params == nil {
params = &CreateWorkflowInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateWorkflow", params, optFns, c.addOperationCreateWorkflowMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateWorkflowOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateWorkflowInput struct {
// Specifies the details for the steps that are in the specified workflow. The TYPE
// specifies which of the following actions is being taken for this step.
// - COPY - Copy the file to another location.
// - CUSTOM - Perform a custom step with an Lambda function target.
// - DECRYPT - Decrypt a file that was encrypted before it was uploaded.
// - DELETE - Delete the file.
// - TAG - Add a tag to the file.
// Currently, copying and tagging are supported only on S3. For file location, you
// specify either the Amazon S3 bucket and key, or the Amazon EFS file system ID
// and path.
//
// This member is required.
Steps []types.WorkflowStep
// A textual description for the workflow.
Description *string
// Specifies the steps (actions) to take if errors are encountered during
// execution of the workflow. For custom steps, the Lambda function needs to send
// FAILURE to the call back API to kick off the exception steps. Additionally, if
// the Lambda does not send SUCCESS before it times out, the exception steps are
// executed.
OnExceptionSteps []types.WorkflowStep
// Key-value pairs that can be used to group and search for workflows. Tags are
// metadata attached to workflows for any purpose.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateWorkflowOutput struct {
// A unique identifier for the workflow.
//
// This member is required.
WorkflowId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateWorkflowMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateWorkflow{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateWorkflow{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateWorkflowValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkflow(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateWorkflow(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "CreateWorkflow",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Allows you to delete the access specified in the ServerID and ExternalID
// parameters.
func (c *Client) DeleteAccess(ctx context.Context, params *DeleteAccessInput, optFns ...func(*Options)) (*DeleteAccessOutput, error) {
if params == nil {
params = &DeleteAccessInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAccess", params, optFns, c.addOperationDeleteAccessMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAccessOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAccessInput struct {
// A unique identifier that is required to identify specific groups within your
// directory. The users of the group that you associate have access to your Amazon
// S3 or Amazon EFS resources over the enabled protocols using Transfer Family. If
// you know the group name, you can view the SID values by running the following
// command using Windows PowerShell. Get-ADGroup -Filter {samAccountName -like
// "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid In that
// command, replace YourGroupName with the name of your Active Directory group. The
// regular expression used to validate this parameter is a string of characters
// consisting of uppercase and lowercase alphanumeric characters with no spaces.
// You can also include underscores or any of the following characters: =,.@:/-
//
// This member is required.
ExternalId *string
// A system-assigned unique identifier for a server that has this user assigned.
//
// This member is required.
ServerId *string
noSmithyDocumentSerde
}
type DeleteAccessOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAccessMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAccess{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAccess{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteAccessValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccess(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteAccess(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DeleteAccess",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Delete the agreement that's specified in the provided AgreementId .
func (c *Client) DeleteAgreement(ctx context.Context, params *DeleteAgreementInput, optFns ...func(*Options)) (*DeleteAgreementOutput, error) {
if params == nil {
params = &DeleteAgreementInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAgreement", params, optFns, c.addOperationDeleteAgreementMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAgreementOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAgreementInput struct {
// A unique identifier for the agreement. This identifier is returned when you
// create an agreement.
//
// This member is required.
AgreementId *string
// The server identifier associated with the agreement that you are deleting.
//
// This member is required.
ServerId *string
noSmithyDocumentSerde
}
type DeleteAgreementOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAgreementMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAgreement{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAgreement{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteAgreementValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAgreement(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteAgreement(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DeleteAgreement",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the certificate that's specified in the CertificateId parameter.
func (c *Client) DeleteCertificate(ctx context.Context, params *DeleteCertificateInput, optFns ...func(*Options)) (*DeleteCertificateOutput, error) {
if params == nil {
params = &DeleteCertificateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteCertificate", params, optFns, c.addOperationDeleteCertificateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteCertificateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteCertificateInput struct {
// The identifier of the certificate object that you are deleting.
//
// This member is required.
CertificateId *string
noSmithyDocumentSerde
}
type DeleteCertificateOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteCertificateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteCertificate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteCertificate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteCertificateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCertificate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteCertificate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DeleteCertificate",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the agreement that's specified in the provided ConnectorId .
func (c *Client) DeleteConnector(ctx context.Context, params *DeleteConnectorInput, optFns ...func(*Options)) (*DeleteConnectorOutput, error) {
if params == nil {
params = &DeleteConnectorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteConnector", params, optFns, c.addOperationDeleteConnectorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteConnectorOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteConnectorInput struct {
// The unique identifier for the connector.
//
// This member is required.
ConnectorId *string
noSmithyDocumentSerde
}
type DeleteConnectorOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteConnector{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteConnector{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteConnectorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteConnector(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteConnector(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DeleteConnector",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the host key that's specified in the HostKeyId parameter.
func (c *Client) DeleteHostKey(ctx context.Context, params *DeleteHostKeyInput, optFns ...func(*Options)) (*DeleteHostKeyOutput, error) {
if params == nil {
params = &DeleteHostKeyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteHostKey", params, optFns, c.addOperationDeleteHostKeyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteHostKeyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteHostKeyInput struct {
// The identifier of the host key that you are deleting.
//
// This member is required.
HostKeyId *string
// The identifier of the server that contains the host key that you are deleting.
//
// This member is required.
ServerId *string
noSmithyDocumentSerde
}
type DeleteHostKeyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteHostKeyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteHostKey{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteHostKey{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteHostKeyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteHostKey(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteHostKey(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DeleteHostKey",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the profile that's specified in the ProfileId parameter.
func (c *Client) DeleteProfile(ctx context.Context, params *DeleteProfileInput, optFns ...func(*Options)) (*DeleteProfileOutput, error) {
if params == nil {
params = &DeleteProfileInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteProfile", params, optFns, c.addOperationDeleteProfileMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteProfileOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteProfileInput struct {
// The identifier of the profile that you are deleting.
//
// This member is required.
ProfileId *string
noSmithyDocumentSerde
}
type DeleteProfileOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteProfileMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteProfile{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteProfile{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteProfileValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProfile(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteProfile(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DeleteProfile",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the file transfer protocol-enabled server that you specify. No response
// returns from this operation.
func (c *Client) DeleteServer(ctx context.Context, params *DeleteServerInput, optFns ...func(*Options)) (*DeleteServerOutput, error) {
if params == nil {
params = &DeleteServerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteServer", params, optFns, c.addOperationDeleteServerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteServerOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteServerInput struct {
// A unique system-assigned identifier for a server instance.
//
// This member is required.
ServerId *string
noSmithyDocumentSerde
}
type DeleteServerOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteServerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteServer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteServer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteServerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteServer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteServer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DeleteServer",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a user's Secure Shell (SSH) public key.
func (c *Client) DeleteSshPublicKey(ctx context.Context, params *DeleteSshPublicKeyInput, optFns ...func(*Options)) (*DeleteSshPublicKeyOutput, error) {
if params == nil {
params = &DeleteSshPublicKeyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSshPublicKey", params, optFns, c.addOperationDeleteSshPublicKeyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSshPublicKeyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSshPublicKeyInput struct {
// A system-assigned unique identifier for a file transfer protocol-enabled server
// instance that has the user assigned to it.
//
// This member is required.
ServerId *string
// A unique identifier used to reference your user's specific SSH key.
//
// This member is required.
SshPublicKeyId *string
// A unique string that identifies a user whose public key is being deleted.
//
// This member is required.
UserName *string
noSmithyDocumentSerde
}
type DeleteSshPublicKeyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSshPublicKeyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteSshPublicKey{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteSshPublicKey{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSshPublicKeyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSshPublicKey(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteSshPublicKey(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DeleteSshPublicKey",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the user belonging to a file transfer protocol-enabled server you
// specify. No response returns from this operation. When you delete a user from a
// server, the user's information is lost.
func (c *Client) DeleteUser(ctx context.Context, params *DeleteUserInput, optFns ...func(*Options)) (*DeleteUserOutput, error) {
if params == nil {
params = &DeleteUserInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteUser", params, optFns, c.addOperationDeleteUserMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteUserOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteUserInput struct {
// A system-assigned unique identifier for a server instance that has the user
// assigned to it.
//
// This member is required.
ServerId *string
// A unique string that identifies a user that is being deleted from a server.
//
// This member is required.
UserName *string
noSmithyDocumentSerde
}
type DeleteUserOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteUserMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteUser{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteUser{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteUserValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteUser(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteUser(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DeleteUser",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified workflow.
func (c *Client) DeleteWorkflow(ctx context.Context, params *DeleteWorkflowInput, optFns ...func(*Options)) (*DeleteWorkflowOutput, error) {
if params == nil {
params = &DeleteWorkflowInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteWorkflow", params, optFns, c.addOperationDeleteWorkflowMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteWorkflowOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteWorkflowInput struct {
// A unique identifier for the workflow.
//
// This member is required.
WorkflowId *string
noSmithyDocumentSerde
}
type DeleteWorkflowOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteWorkflowMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteWorkflow{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteWorkflow{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteWorkflowValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWorkflow(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteWorkflow(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DeleteWorkflow",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transfer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the access that is assigned to the specific file transfer
// protocol-enabled server, as identified by its ServerId property and its
// ExternalId . The response from this call returns the properties of the access
// that is associated with the ServerId value that was specified.
func (c *Client) DescribeAccess(ctx context.Context, params *DescribeAccessInput, optFns ...func(*Options)) (*DescribeAccessOutput, error) {
if params == nil {
params = &DescribeAccessInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAccess", params, optFns, c.addOperationDescribeAccessMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAccessOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAccessInput struct {
// A unique identifier that is required to identify specific groups within your
// directory. The users of the group that you associate have access to your Amazon
// S3 or Amazon EFS resources over the enabled protocols using Transfer Family. If
// you know the group name, you can view the SID values by running the following
// command using Windows PowerShell. Get-ADGroup -Filter {samAccountName -like
// "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid In that
// command, replace YourGroupName with the name of your Active Directory group. The
// regular expression used to validate this parameter is a string of characters
// consisting of uppercase and lowercase alphanumeric characters with no spaces.
// You can also include underscores or any of the following characters: =,.@:/-
//
// This member is required.
ExternalId *string
// A system-assigned unique identifier for a server that has this access assigned.
//
// This member is required.
ServerId *string
noSmithyDocumentSerde
}
type DescribeAccessOutput struct {
// The external identifier of the server that the access is attached to.
//
// This member is required.
Access *types.DescribedAccess
// A system-assigned unique identifier for a server that has this access assigned.
//
// This member is required.
ServerId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAccessMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAccess{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAccess{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAccessValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAccess(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeAccess(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DescribeAccess",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transfer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the agreement that's identified by the AgreementId .
func (c *Client) DescribeAgreement(ctx context.Context, params *DescribeAgreementInput, optFns ...func(*Options)) (*DescribeAgreementOutput, error) {
if params == nil {
params = &DescribeAgreementInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAgreement", params, optFns, c.addOperationDescribeAgreementMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAgreementOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAgreementInput struct {
// A unique identifier for the agreement. This identifier is returned when you
// create an agreement.
//
// This member is required.
AgreementId *string
// The server identifier that's associated with the agreement.
//
// This member is required.
ServerId *string
noSmithyDocumentSerde
}
type DescribeAgreementOutput struct {
// The details for the specified agreement, returned as a DescribedAgreement
// object.
//
// This member is required.
Agreement *types.DescribedAgreement
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAgreementMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAgreement{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAgreement{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAgreementValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAgreement(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeAgreement(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DescribeAgreement",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package transfer
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/transfer/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the certificate that's identified by the CertificateId .
func (c *Client) DescribeCertificate(ctx context.Context, params *DescribeCertificateInput, optFns ...func(*Options)) (*DescribeCertificateOutput, error) {
if params == nil {
params = &DescribeCertificateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeCertificate", params, optFns, c.addOperationDescribeCertificateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeCertificateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeCertificateInput struct {
// An array of identifiers for the imported certificates. You use this identifier
// for working with profiles and partner profiles.
//
// This member is required.
CertificateId *string
noSmithyDocumentSerde
}
type DescribeCertificateOutput struct {
// The details for the specified certificate, returned as an object.
//
// This member is required.
Certificate *types.DescribedCertificate
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeCertificateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeCertificate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeCertificate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeCertificateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCertificate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeCertificate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "transfer",
OperationName: "DescribeCertificate",
}
}
| 128 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.