diff --git a/.changelog/05d1d0c0151d4d439725fcb7b27f4646.json b/.changelog/05d1d0c0151d4d439725fcb7b27f4646.json new file mode 100644 index 00000000000..4deb7628edb --- /dev/null +++ b/.changelog/05d1d0c0151d4d439725fcb7b27f4646.json @@ -0,0 +1,8 @@ +{ + "id": "05d1d0c0-151d-4d43-9725-fcb7b27f4646", + "type": "feature", + "description": "This release will have ValidationException be thrown from ECR LifecyclePolicy APIs in regions LifecyclePolicy is not supported, this includes existing Amazon Dedicated Cloud (ADC) regions. This release will also change Tag: TagValue and Tag: TagKey to required.", + "modules": [ + "service/ecr" + ] +} \ No newline at end of file diff --git a/.changelog/2028471ad40640eabf9427fd27c1e9b2.json b/.changelog/2028471ad40640eabf9427fd27c1e9b2.json new file mode 100644 index 00000000000..1a2111ed157 --- /dev/null +++ b/.changelog/2028471ad40640eabf9427fd27c1e9b2.json @@ -0,0 +1,8 @@ +{ + "id": "2028471a-d406-40ea-bf94-27fd27c1e9b2", + "type": "feature", + "description": "This release launches new updates to QuickSight KPI visuals - support for sparklines, new templated layout and new targets for conditional formatting rules.", + "modules": [ + "service/quicksight" + ] +} \ No newline at end of file diff --git a/.changelog/780aa1b3c4a7482887eaef6e49d3f39c.json b/.changelog/780aa1b3c4a7482887eaef6e49d3f39c.json new file mode 100644 index 00000000000..e51f162ca70 --- /dev/null +++ b/.changelog/780aa1b3c4a7482887eaef6e49d3f39c.json @@ -0,0 +1,8 @@ +{ + "id": "780aa1b3-c4a7-4828-87ea-ef6e49d3f39c", + "type": "feature", + "description": "AWS Elemental Link now supports attaching a Link UHD device to a MediaConnect flow.", + "modules": [ + "service/medialive" + ] +} \ No newline at end of file diff --git a/service/ecr/api_op_CreateRepository.go b/service/ecr/api_op_CreateRepository.go index 3f2ec9791ec..1fdf9b212b7 100644 --- a/service/ecr/api_op_CreateRepository.go +++ b/service/ecr/api_op_CreateRepository.go @@ -37,7 +37,9 @@ type CreateRepositoryInput struct { // The name to use for the repository. The repository name may be specified on its // own (such as nginx-web-app ) or it can be prepended with a namespace to group - // the repository into a category (such as project-a/nginx-web-app ). + // the repository into a category (such as project-a/nginx-web-app ). The + // repository name must start with a letter and can only contain lowercase letters, + // numbers, hyphens, underscores, and forward slashes. // // This member is required. RepositoryName *string diff --git a/service/ecr/deserializers.go b/service/ecr/deserializers.go index 79c79b7aba6..7d849ef5410 100644 --- a/service/ecr/deserializers.go +++ b/service/ecr/deserializers.go @@ -991,6 +991,9 @@ func awsAwsjson11_deserializeOpErrorDeleteLifecyclePolicy(response *smithyhttp.R case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2554,6 +2557,9 @@ func awsAwsjson11_deserializeOpErrorGetLifecyclePolicy(response *smithyhttp.Resp case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2674,6 +2680,9 @@ func awsAwsjson11_deserializeOpErrorGetLifecyclePolicyPreview(response *smithyht case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3877,6 +3886,9 @@ func awsAwsjson11_deserializeOpErrorPutLifecyclePolicy(response *smithyhttp.Resp case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4597,6 +4609,9 @@ func awsAwsjson11_deserializeOpErrorStartLifecyclePolicyPreview(response *smithy case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, diff --git a/service/ecr/endpoints.go b/service/ecr/endpoints.go index 04cd1d96da0..8d169bdb22f 100644 --- a/service/ecr/endpoints.go +++ b/service/ecr/endpoints.go @@ -493,383 +493,6 @@ func (r *resolver) ResolveEndpoint( } return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") } - if _Region == "af-south-1" { - uriString := "https://api.ecr.af-south-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-east-1" { - uriString := "https://api.ecr.ap-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-northeast-1" { - uriString := "https://api.ecr.ap-northeast-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-northeast-2" { - uriString := "https://api.ecr.ap-northeast-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-northeast-3" { - uriString := "https://api.ecr.ap-northeast-3.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-south-1" { - uriString := "https://api.ecr.ap-south-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-southeast-1" { - uriString := "https://api.ecr.ap-southeast-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-southeast-2" { - uriString := "https://api.ecr.ap-southeast-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-southeast-3" { - uriString := "https://api.ecr.ap-southeast-3.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ca-central-1" { - uriString := "https://api.ecr.ca-central-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-central-1" { - uriString := "https://api.ecr.eu-central-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-north-1" { - uriString := "https://api.ecr.eu-north-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-south-1" { - uriString := "https://api.ecr.eu-south-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-west-1" { - uriString := "https://api.ecr.eu-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-west-2" { - uriString := "https://api.ecr.eu-west-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-west-3" { - uriString := "https://api.ecr.eu-west-3.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "me-south-1" { - uriString := "https://api.ecr.me-south-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "sa-east-1" { - uriString := "https://api.ecr.sa-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-east-1" { - uriString := "https://api.ecr.us-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-east-2" { - uriString := "https://api.ecr.us-east-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-west-1" { - uriString := "https://api.ecr.us-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-west-2" { - uriString := "https://api.ecr.us-west-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "cn-north-1" { - uriString := "https://api.ecr.cn-north-1.amazonaws.com.cn" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "cn-northwest-1" { - uriString := "https://api.ecr.cn-northwest-1.amazonaws.com.cn" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-gov-east-1" { - uriString := "https://api.ecr.us-gov-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-gov-west-1" { - uriString := "https://api.ecr.us-gov-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-iso-east-1" { - uriString := "https://api.ecr.us-iso-east-1.c2s.ic.gov" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-iso-west-1" { - uriString := "https://api.ecr.us-iso-west-1.c2s.ic.gov" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-isob-east-1" { - uriString := "https://api.ecr.us-isob-east-1.sc2s.sgov.gov" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } uriString := func() string { var out strings.Builder out.WriteString("https://api.ecr.") diff --git a/service/ecr/endpoints_test.go b/service/ecr/endpoints_test.go index 1058dfed807..4cebe340896 100644 --- a/service/ecr/endpoints_test.go +++ b/service/ecr/endpoints_test.go @@ -18,8 +18,8 @@ import ( func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("af-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -57,8 +57,8 @@ func TestEndpointCase0(t *testing.T) { func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -96,8 +96,8 @@ func TestEndpointCase1(t *testing.T) { func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -135,8 +135,8 @@ func TestEndpointCase2(t *testing.T) { func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -174,8 +174,8 @@ func TestEndpointCase3(t *testing.T) { func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-3"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -213,8 +213,8 @@ func TestEndpointCase4(t *testing.T) { func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -252,8 +252,8 @@ func TestEndpointCase5(t *testing.T) { func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -291,8 +291,8 @@ func TestEndpointCase6(t *testing.T) { func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -330,8 +330,8 @@ func TestEndpointCase7(t *testing.T) { func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-3"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -369,8 +369,8 @@ func TestEndpointCase8(t *testing.T) { func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ca-central-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -408,8 +408,8 @@ func TestEndpointCase9(t *testing.T) { func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-central-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -447,8 +447,8 @@ func TestEndpointCase10(t *testing.T) { func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -486,8 +486,8 @@ func TestEndpointCase11(t *testing.T) { func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -525,8 +525,8 @@ func TestEndpointCase12(t *testing.T) { func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -564,8 +564,8 @@ func TestEndpointCase13(t *testing.T) { func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -603,8 +603,8 @@ func TestEndpointCase14(t *testing.T) { func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-3"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -642,8 +642,8 @@ func TestEndpointCase15(t *testing.T) { func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("me-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -681,8 +681,8 @@ func TestEndpointCase16(t *testing.T) { func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("sa-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -720,8 +720,8 @@ func TestEndpointCase17(t *testing.T) { func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -759,8 +759,8 @@ func TestEndpointCase18(t *testing.T) { func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -798,8 +798,8 @@ func TestEndpointCase19(t *testing.T) { func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -837,8 +837,8 @@ func TestEndpointCase20(t *testing.T) { func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -876,8 +876,8 @@ func TestEndpointCase21(t *testing.T) { func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -915,8 +915,8 @@ func TestEndpointCase22(t *testing.T) { func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -954,8 +954,8 @@ func TestEndpointCase23(t *testing.T) { func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -993,8 +993,8 @@ func TestEndpointCase24(t *testing.T) { func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1032,8 +1032,8 @@ func TestEndpointCase25(t *testing.T) { func TestEndpointCase26(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1071,8 +1071,8 @@ func TestEndpointCase26(t *testing.T) { func TestEndpointCase27(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1110,8 +1110,8 @@ func TestEndpointCase27(t *testing.T) { func TestEndpointCase28(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1149,8 +1149,8 @@ func TestEndpointCase28(t *testing.T) { func TestEndpointCase29(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-northwest-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1188,8 +1188,8 @@ func TestEndpointCase29(t *testing.T) { func TestEndpointCase30(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1227,8 +1227,8 @@ func TestEndpointCase30(t *testing.T) { func TestEndpointCase31(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1266,8 +1266,8 @@ func TestEndpointCase31(t *testing.T) { func TestEndpointCase32(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1305,8 +1305,8 @@ func TestEndpointCase32(t *testing.T) { func TestEndpointCase33(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1344,8 +1344,8 @@ func TestEndpointCase33(t *testing.T) { func TestEndpointCase34(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1383,8 +1383,8 @@ func TestEndpointCase34(t *testing.T) { func TestEndpointCase35(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1422,8 +1422,8 @@ func TestEndpointCase35(t *testing.T) { func TestEndpointCase36(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1461,8 +1461,8 @@ func TestEndpointCase36(t *testing.T) { func TestEndpointCase37(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1500,8 +1500,8 @@ func TestEndpointCase37(t *testing.T) { func TestEndpointCase38(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1539,8 +1539,8 @@ func TestEndpointCase38(t *testing.T) { func TestEndpointCase39(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1578,8 +1578,8 @@ func TestEndpointCase39(t *testing.T) { func TestEndpointCase40(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1613,12 +1613,32 @@ func TestEndpointCase40(t *testing.T) { } } -// For region us-iso-east-1 with FIPS enabled and DualStack disabled +// For region us-iso-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase41(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase42(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1652,12 +1672,32 @@ func TestEndpointCase41(t *testing.T) { } } +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase43(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase42(t *testing.T) { +func TestEndpointCase44(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1691,12 +1731,32 @@ func TestEndpointCase42(t *testing.T) { } } +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase45(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase43(t *testing.T) { +func TestEndpointCase46(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1730,12 +1790,32 @@ func TestEndpointCase43(t *testing.T) { } } +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase47(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase44(t *testing.T) { +func TestEndpointCase48(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1771,10 +1851,10 @@ func TestEndpointCase44(t *testing.T) { } // For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase45(t *testing.T) { +func TestEndpointCase49(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1810,11 +1890,11 @@ func TestEndpointCase45(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase46(t *testing.T) { +func TestEndpointCase50(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1831,11 +1911,11 @@ func TestEndpointCase46(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase47(t *testing.T) { +func TestEndpointCase51(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -1850,3 +1930,19 @@ func TestEndpointCase47(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Missing region +func TestEndpointCase52(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/ecr/types/types.go b/service/ecr/types/types.go index 42509094007..1dbaf772597 100644 --- a/service/ecr/types/types.go +++ b/service/ecr/types/types.go @@ -612,7 +612,8 @@ type RegistryScanningRule struct { // The frequency that scans are performed at for a private registry. When the // ENHANCED scan type is specified, the supported scan frequencies are // CONTINUOUS_SCAN and SCAN_ON_PUSH . When the BASIC scan type is specified, the - // SCAN_ON_PUSH and MANUAL scan frequencies are supported. + // SCAN_ON_PUSH scan frequency is supported. If scan on push is not specified, then + // the MANUAL scan frequency is set by default. // // This member is required. ScanFrequency ScanFrequency @@ -700,7 +701,8 @@ type Repository struct { // The Amazon Resource Name (ARN) that identifies the repository. The ARN contains // the arn:aws:ecr namespace, followed by the region of the repository, Amazon Web // Services account ID of the repository owner, repository namespace, and - // repository name. For example, arn:aws:ecr:region:012345678910:repository/test . + // repository name. For example, + // arn:aws:ecr:region:012345678910:repository-namespace/repository-name . RepositoryArn *string // The name of the repository. @@ -715,8 +717,8 @@ type Repository struct { // The filter settings used with image replication. Specifying a repository filter // to a replication rule provides a method for controlling which repositories in a -// private registry are replicated. If no repository filter is specified, all -// images in the repository are replicated. +// private registry are replicated. If no filters are added, the contents of all +// repositories are replicated. type RepositoryFilter struct { // The repository filter details. When the PREFIX_MATCH filter type is specified, @@ -835,9 +837,13 @@ type Tag struct { // One part of a key-value pair that make up a tag. A key is a general label that // acts like a category for more specific tag values. + // + // This member is required. Key *string // A value acts as a descriptor within a tag category (key). + // + // This member is required. Value *string noSmithyDocumentSerde diff --git a/service/ecr/validators.go b/service/ecr/validators.go index 9baf8c8cffe..754611f1c8d 100644 --- a/service/ecr/validators.go +++ b/service/ecr/validators.go @@ -1045,6 +1045,41 @@ func validateScanningRepositoryFilterList(v []types.ScanningRepositoryFilter) er } } +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 validateOpBatchCheckLayerAvailabilityInput(v *BatchCheckLayerAvailabilityInput) error { if v == nil { return nil @@ -1161,6 +1196,11 @@ func validateOpCreateRepositoryInput(v *CreateRepositoryInput) error { if v.RepositoryName == nil { invalidParams.Add(smithy.NewErrParamRequired("RepositoryName")) } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } if v.EncryptionConfiguration != nil { if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil { invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError)) @@ -1576,6 +1616,10 @@ func validateOpTagResourceInput(v *TagResourceInput) error { } 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 diff --git a/service/medialive/api_op_DescribeInputDevice.go b/service/medialive/api_op_DescribeInputDevice.go index e3ff09f17dd..80a0ea2ab23 100644 --- a/service/medialive/api_op_DescribeInputDevice.go +++ b/service/medialive/api_op_DescribeInputDevice.go @@ -74,12 +74,21 @@ type DescribeInputDeviceOutput struct { // The network MAC address of the input device. MacAddress *string + // An array of the ARNs for the MediaLive inputs attached to the device. Returned + // only if the outputType is MEDIALIVE_INPUT. + MedialiveInputArns []string + // A name that you specify for the input device. Name *string // The network settings for the input device. NetworkSettings *types.InputDeviceNetworkSettings + // The output attachment type of the input device. Specifies MEDIACONNECT_FLOW if + // this device is the source for a MediaConnect flow. Specifies MEDIALIVE_INPUT if + // this device is the source for a MediaLive input. + OutputType types.InputDeviceOutputType + // The unique serial number of the input device. SerialNumber *string diff --git a/service/medialive/api_op_StartInputDevice.go b/service/medialive/api_op_StartInputDevice.go new file mode 100644 index 00000000000..e7496b3b233 --- /dev/null +++ b/service/medialive/api_op_StartInputDevice.go @@ -0,0 +1,260 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package medialive + +import ( + "context" + "errors" + "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/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Start an input device that is attached to a MediaConnect flow. (There is no +// need to start a device that is attached to a MediaLive input; MediaLive starts +// the device when the channel starts.) +func (c *Client) StartInputDevice(ctx context.Context, params *StartInputDeviceInput, optFns ...func(*Options)) (*StartInputDeviceOutput, error) { + if params == nil { + params = &StartInputDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartInputDevice", params, optFns, c.addOperationStartInputDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartInputDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Placeholder documentation for StartInputDeviceRequest +type StartInputDeviceInput struct { + + // The unique ID of the input device to reboot. For example, hd-123456789abcdef. + // + // This member is required. + InputDeviceId *string + + noSmithyDocumentSerde +} + +// Placeholder documentation for StartInputDeviceResponse +type StartInputDeviceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartInputDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartInputDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartInputDevice{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addStartInputDeviceResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartInputDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartInputDevice(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 + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartInputDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "medialive", + OperationName: "StartInputDevice", + } +} + +type opStartInputDeviceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opStartInputDeviceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opStartInputDeviceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "medialive" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "medialive" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("medialive") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addStartInputDeviceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opStartInputDeviceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/medialive/api_op_StopInputDevice.go b/service/medialive/api_op_StopInputDevice.go new file mode 100644 index 00000000000..6733decbc68 --- /dev/null +++ b/service/medialive/api_op_StopInputDevice.go @@ -0,0 +1,260 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package medialive + +import ( + "context" + "errors" + "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/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Stop an input device that is attached to a MediaConnect flow. (There is no need +// to stop a device that is attached to a MediaLive input; MediaLive automatically +// stops the device when the channel stops.) +func (c *Client) StopInputDevice(ctx context.Context, params *StopInputDeviceInput, optFns ...func(*Options)) (*StopInputDeviceOutput, error) { + if params == nil { + params = &StopInputDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopInputDevice", params, optFns, c.addOperationStopInputDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopInputDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Placeholder documentation for StopInputDeviceRequest +type StopInputDeviceInput struct { + + // The unique ID of the input device to reboot. For example, hd-123456789abcdef. + // + // This member is required. + InputDeviceId *string + + noSmithyDocumentSerde +} + +// Placeholder documentation for StopInputDeviceResponse +type StopInputDeviceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopInputDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStopInputDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopInputDevice{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addStopInputDeviceResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpStopInputDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopInputDevice(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 + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStopInputDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "medialive", + OperationName: "StopInputDevice", + } +} + +type opStopInputDeviceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opStopInputDeviceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opStopInputDeviceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "medialive" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "medialive" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("medialive") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addStopInputDeviceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opStopInputDeviceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/medialive/api_op_UpdateInputDevice.go b/service/medialive/api_op_UpdateInputDevice.go index a70024cd50d..253f957a5c8 100644 --- a/service/medialive/api_op_UpdateInputDevice.go +++ b/service/medialive/api_op_UpdateInputDevice.go @@ -86,12 +86,21 @@ type UpdateInputDeviceOutput struct { // The network MAC address of the input device. MacAddress *string + // An array of the ARNs for the MediaLive inputs attached to the device. Returned + // only if the outputType is MEDIALIVE_INPUT. + MedialiveInputArns []string + // A name that you specify for the input device. Name *string // The network settings for the input device. NetworkSettings *types.InputDeviceNetworkSettings + // The output attachment type of the input device. Specifies MEDIACONNECT_FLOW if + // this device is the source for a MediaConnect flow. Specifies MEDIALIVE_INPUT if + // this device is the source for a MediaLive input. + OutputType types.InputDeviceOutputType + // The unique serial number of the input device. SerialNumber *string diff --git a/service/medialive/deserializers.go b/service/medialive/deserializers.go index fee693a37e0..c74374e8bb2 100644 --- a/service/medialive/deserializers.go +++ b/service/medialive/deserializers.go @@ -4573,6 +4573,11 @@ func awsRestjson1_deserializeOpDocumentDescribeInputDeviceOutput(v **DescribeInp sv.MacAddress = ptr.String(jtv) } + case "medialiveInputArns": + if err := awsRestjson1_deserializeDocument__listOf__string(&sv.MedialiveInputArns, value); err != nil { + return err + } + case "name": if value != nil { jtv, ok := value.(string) @@ -4587,6 +4592,15 @@ func awsRestjson1_deserializeOpDocumentDescribeInputDeviceOutput(v **DescribeInp return err } + case "outputType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InputDeviceOutputType to be of type string, got %T instead", value) + } + sv.OutputType = types.InputDeviceOutputType(jtv) + } + case "serialNumber": if value != nil { jtv, ok := value.(string) @@ -8813,6 +8827,110 @@ func awsRestjson1_deserializeOpDocumentStartChannelOutput(v **StartChannelOutput return nil } +type awsRestjson1_deserializeOpStartInputDevice struct { +} + +func (*awsRestjson1_deserializeOpStartInputDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartInputDevice) 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_deserializeOpErrorStartInputDevice(response, &metadata) + } + output := &StartInputDeviceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartInputDevice(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("BadGatewayException", errorCode): + return awsRestjson1_deserializeErrorBadGatewayException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("GatewayTimeoutException", errorCode): + return awsRestjson1_deserializeErrorGatewayTimeoutException(response, errorBody) + + case strings.EqualFold("InternalServerErrorException", errorCode): + return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnprocessableEntityException", errorCode): + return awsRestjson1_deserializeErrorUnprocessableEntityException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpStartInputDeviceMaintenanceWindow struct { } @@ -9451,6 +9569,110 @@ func awsRestjson1_deserializeOpDocumentStopChannelOutput(v **StopChannelOutput, return nil } +type awsRestjson1_deserializeOpStopInputDevice struct { +} + +func (*awsRestjson1_deserializeOpStopInputDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStopInputDevice) 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_deserializeOpErrorStopInputDevice(response, &metadata) + } + output := &StopInputDeviceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStopInputDevice(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("BadGatewayException", errorCode): + return awsRestjson1_deserializeErrorBadGatewayException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("GatewayTimeoutException", errorCode): + return awsRestjson1_deserializeErrorGatewayTimeoutException(response, errorBody) + + case strings.EqualFold("InternalServerErrorException", errorCode): + return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnprocessableEntityException", errorCode): + return awsRestjson1_deserializeErrorUnprocessableEntityException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpStopMultiplex struct { } @@ -10691,6 +10913,11 @@ func awsRestjson1_deserializeOpDocumentUpdateInputDeviceOutput(v **UpdateInputDe sv.MacAddress = ptr.String(jtv) } + case "medialiveInputArns": + if err := awsRestjson1_deserializeDocument__listOf__string(&sv.MedialiveInputArns, value); err != nil { + return err + } + case "name": if value != nil { jtv, ok := value.(string) @@ -10705,6 +10932,15 @@ func awsRestjson1_deserializeOpDocumentUpdateInputDeviceOutput(v **UpdateInputDe return err } + case "outputType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InputDeviceOutputType to be of type string, got %T instead", value) + } + sv.OutputType = types.InputDeviceOutputType(jtv) + } + case "serialNumber": if value != nil { jtv, ok := value.(string) @@ -21627,6 +21863,73 @@ func awsRestjson1_deserializeDocumentInputDeviceHdSettings(v **types.InputDevice return nil } +func awsRestjson1_deserializeDocumentInputDeviceMediaConnectSettings(v **types.InputDeviceMediaConnectSettings, 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.InputDeviceMediaConnectSettings + if *v == nil { + sv = &types.InputDeviceMediaConnectSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "flowArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.FlowArn = ptr.String(jtv) + } + + case "roleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + case "secretArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.SecretArn = ptr.String(jtv) + } + + case "sourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.SourceName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentInputDeviceNetworkSettings(v **types.InputDeviceNetworkSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21829,6 +22132,11 @@ func awsRestjson1_deserializeDocumentInputDeviceSummary(v **types.InputDeviceSum sv.MacAddress = ptr.String(jtv) } + case "medialiveInputArns": + if err := awsRestjson1_deserializeDocument__listOf__string(&sv.MedialiveInputArns, value); err != nil { + return err + } + case "name": if value != nil { jtv, ok := value.(string) @@ -21843,6 +22151,15 @@ func awsRestjson1_deserializeDocumentInputDeviceSummary(v **types.InputDeviceSum return err } + case "outputType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InputDeviceOutputType to be of type string, got %T instead", value) + } + sv.OutputType = types.InputDeviceOutputType(jtv) + } + case "serialNumber": if value != nil { jtv, ok := value.(string) @@ -21911,6 +22228,15 @@ func awsRestjson1_deserializeDocumentInputDeviceUhdSettings(v **types.InputDevic sv.ActiveInput = types.InputDeviceActiveInput(jtv) } + case "codec": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InputDeviceCodec to be of type string, got %T instead", value) + } + sv.Codec = types.InputDeviceCodec(jtv) + } + case "configuredInput": if value != nil { jtv, ok := value.(string) @@ -22002,6 +22328,11 @@ func awsRestjson1_deserializeDocumentInputDeviceUhdSettings(v **types.InputDevic sv.MaxBitrate = int32(i64) } + case "mediaconnectSettings": + if err := awsRestjson1_deserializeDocumentInputDeviceMediaConnectSettings(&sv.MediaconnectSettings, value); err != nil { + return err + } + case "scanType": if value != nil { jtv, ok := value.(string) diff --git a/service/medialive/generated.json b/service/medialive/generated.json index 6616c36dc16..abeadea01bd 100644 --- a/service/medialive/generated.json +++ b/service/medialive/generated.json @@ -58,9 +58,11 @@ "api_op_RebootInputDevice.go", "api_op_RejectInputDeviceTransfer.go", "api_op_StartChannel.go", + "api_op_StartInputDevice.go", "api_op_StartInputDeviceMaintenanceWindow.go", "api_op_StartMultiplex.go", "api_op_StopChannel.go", + "api_op_StopInputDevice.go", "api_op_StopMultiplex.go", "api_op_TransferInputDevice.go", "api_op_UpdateAccountConfiguration.go", diff --git a/service/medialive/serializers.go b/service/medialive/serializers.go index ec40147dd37..1919e0291f4 100644 --- a/service/medialive/serializers.go +++ b/service/medialive/serializers.go @@ -3741,6 +3741,71 @@ func awsRestjson1_serializeOpHttpBindingsStartChannelInput(v *StartChannelInput, return nil } +type awsRestjson1_serializeOpStartInputDevice struct { +} + +func (*awsRestjson1_serializeOpStartInputDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartInputDevice) 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.(*StartInputDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/prod/inputDevices/{InputDeviceId}/start") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStartInputDeviceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartInputDeviceInput(v *StartInputDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InputDeviceId == nil || len(*v.InputDeviceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InputDeviceId must not be empty")} + } + if v.InputDeviceId != nil { + if err := encoder.SetURI("InputDeviceId").String(*v.InputDeviceId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpStartInputDeviceMaintenanceWindow struct { } @@ -3936,6 +4001,71 @@ func awsRestjson1_serializeOpHttpBindingsStopChannelInput(v *StopChannelInput, e return nil } +type awsRestjson1_serializeOpStopInputDevice struct { +} + +func (*awsRestjson1_serializeOpStopInputDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStopInputDevice) 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.(*StopInputDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/prod/inputDevices/{InputDeviceId}/stop") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStopInputDeviceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStopInputDeviceInput(v *StopInputDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InputDeviceId == nil || len(*v.InputDeviceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InputDeviceId must not be empty")} + } + if v.InputDeviceId != nil { + if err := encoder.SetURI("InputDeviceId").String(*v.InputDeviceId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpStopMultiplex struct { } @@ -8723,6 +8853,11 @@ func awsRestjson1_serializeDocumentInputDeviceConfigurableSettings(v *types.Inpu object := value.Object() defer object.Close() + if len(v.Codec) > 0 { + ok := object.Key("codec") + ok.String(string(v.Codec)) + } + if len(v.ConfiguredInput) > 0 { ok := object.Key("configuredInput") ok.String(string(v.ConfiguredInput)) @@ -8738,6 +8873,40 @@ func awsRestjson1_serializeDocumentInputDeviceConfigurableSettings(v *types.Inpu ok.Integer(v.MaxBitrate) } + if v.MediaconnectSettings != nil { + ok := object.Key("mediaconnectSettings") + if err := awsRestjson1_serializeDocumentInputDeviceMediaConnectConfigurableSettings(v.MediaconnectSettings, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentInputDeviceMediaConnectConfigurableSettings(v *types.InputDeviceMediaConnectConfigurableSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FlowArn != nil { + ok := object.Key("flowArn") + ok.String(*v.FlowArn) + } + + if v.RoleArn != nil { + ok := object.Key("roleArn") + ok.String(*v.RoleArn) + } + + if v.SecretArn != nil { + ok := object.Key("secretArn") + ok.String(*v.SecretArn) + } + + if v.SourceName != nil { + ok := object.Key("sourceName") + ok.String(*v.SourceName) + } + return nil } diff --git a/service/medialive/types/enums.go b/service/medialive/types/enums.go index 422f2ff97db..0f740bd127f 100644 --- a/service/medialive/types/enums.go +++ b/service/medialive/types/enums.go @@ -2999,6 +2999,24 @@ func (InputDeviceActiveInput) Values() []InputDeviceActiveInput { } } +type InputDeviceCodec string + +// Enum values for InputDeviceCodec +const ( + InputDeviceCodecHevc InputDeviceCodec = "HEVC" + InputDeviceCodecAvc InputDeviceCodec = "AVC" +) + +// Values returns all known values for InputDeviceCodec. 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 (InputDeviceCodec) Values() []InputDeviceCodec { + return []InputDeviceCodec{ + "HEVC", + "AVC", + } +} + type InputDeviceConfiguredInput string // Enum values for InputDeviceConfiguredInput @@ -3055,6 +3073,26 @@ func (InputDeviceIpScheme) Values() []InputDeviceIpScheme { } } +type InputDeviceOutputType string + +// Enum values for InputDeviceOutputType +const ( + InputDeviceOutputTypeNone InputDeviceOutputType = "NONE" + InputDeviceOutputTypeMedialiveInput InputDeviceOutputType = "MEDIALIVE_INPUT" + InputDeviceOutputTypeMediaconnectFlow InputDeviceOutputType = "MEDIACONNECT_FLOW" +) + +// Values returns all known values for InputDeviceOutputType. 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 (InputDeviceOutputType) Values() []InputDeviceOutputType { + return []InputDeviceOutputType{ + "NONE", + "MEDIALIVE_INPUT", + "MEDIACONNECT_FLOW", + } +} + type InputDeviceScanType string // Enum values for InputDeviceScanType diff --git a/service/medialive/types/types.go b/service/medialive/types/types.go index 817c8c6f967..d5aea16b108 100644 --- a/service/medialive/types/types.go +++ b/service/medialive/types/types.go @@ -2903,6 +2903,10 @@ type InputDestinationVpc struct { // Configurable settings for the input device. type InputDeviceConfigurableSettings struct { + // Choose the codec for the video that the device produces. Only UHD devices can + // specify this parameter. + Codec InputDeviceCodec + // The input source that you want to use. If the device has a source connected to // only one of its input ports, or if you don't care which source the device sends, // specify Auto. If the device has sources connected to both its input ports, and @@ -2916,6 +2920,11 @@ type InputDeviceConfigurableSettings struct { // bitrate of the source video. MaxBitrate int32 + // To attach this device to a MediaConnect flow, specify these parameters. To + // detach an existing flow, enter {} for the value of mediaconnectSettings. Only + // UHD devices can specify this parameter. + MediaconnectSettings *InputDeviceMediaConnectConfigurableSettings + noSmithyDocumentSerde } @@ -2957,6 +2966,46 @@ type InputDeviceHdSettings struct { noSmithyDocumentSerde } +// Parameters required to attach a MediaConnect flow to the device. +type InputDeviceMediaConnectConfigurableSettings struct { + + // The ARN of the MediaConnect flow to attach this device to. + FlowArn *string + + // The ARN for the role that MediaLive assumes to access the attached flow and + // secret. For more information about how to create this role, see the MediaLive + // user guide. + RoleArn *string + + // The ARN for the secret that holds the encryption key to encrypt the content + // output by the device. + SecretArn *string + + // The name of the MediaConnect Flow source to stream to. + SourceName *string + + noSmithyDocumentSerde +} + +// Information about the MediaConnect flow attached to the device. +type InputDeviceMediaConnectSettings struct { + + // The ARN of the MediaConnect flow. + FlowArn *string + + // The ARN for the role that MediaLive assumes to access the attached flow and + // secret. + RoleArn *string + + // The ARN of the secret used to encrypt the stream. + SecretArn *string + + // The name of the MediaConnect flow source. + SourceName *string + + noSmithyDocumentSerde +} + // The network settings for the input device. type InputDeviceNetworkSettings struct { @@ -3028,12 +3077,21 @@ type InputDeviceSummary struct { // The network MAC address of the input device. MacAddress *string + // An array of the ARNs for the MediaLive inputs attached to the device. Returned + // only if the outputType is MEDIALIVE_INPUT. + MedialiveInputArns []string + // A name that you specify for the input device. Name *string // Network settings for the input device. NetworkSettings *InputDeviceNetworkSettings + // The output attachment type of the input device. Specifies MEDIACONNECT_FLOW if + // this device is the source for a MediaConnect flow. Specifies MEDIALIVE_INPUT if + // this device is the source for a MediaLive input. + OutputType InputDeviceOutputType + // The unique serial number of the input device. SerialNumber *string @@ -3057,6 +3115,9 @@ type InputDeviceUhdSettings struct { // is currently active (SDI or HDMI). ActiveInput InputDeviceActiveInput + // The codec for the video that the device produces. + Codec InputDeviceCodec + // The source at the input device that is currently active. You can specify this // source. ConfiguredInput InputDeviceConfiguredInput @@ -3078,6 +3139,10 @@ type InputDeviceUhdSettings struct { // can specify this maximum. MaxBitrate int32 + // Information about the MediaConnect flow attached to the device. Returned only + // if the outputType is MEDIACONNECT_FLOW. + MediaconnectSettings *InputDeviceMediaConnectSettings + // The scan type of the video source. ScanType InputDeviceScanType diff --git a/service/medialive/validators.go b/service/medialive/validators.go index 9a38f664640..388a6216858 100644 --- a/service/medialive/validators.go +++ b/service/medialive/validators.go @@ -710,6 +710,26 @@ func (m *validateOpStartChannel) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpStartInputDevice struct { +} + +func (*validateOpStartInputDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartInputDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartInputDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartInputDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartInputDeviceMaintenanceWindow struct { } @@ -770,6 +790,26 @@ func (m *validateOpStopChannel) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpStopInputDevice struct { +} + +func (*validateOpStopInputDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopInputDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopInputDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopInputDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStopMultiplex struct { } @@ -1110,6 +1150,10 @@ func addOpStartChannelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartChannel{}, middleware.After) } +func addOpStartInputDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartInputDevice{}, middleware.After) +} + func addOpStartInputDeviceMaintenanceWindowValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartInputDeviceMaintenanceWindow{}, middleware.After) } @@ -1122,6 +1166,10 @@ func addOpStopChannelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopChannel{}, middleware.After) } +func addOpStopInputDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopInputDevice{}, middleware.After) +} + func addOpStopMultiplexValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopMultiplex{}, middleware.After) } @@ -3963,6 +4011,21 @@ func validateOpStartChannelInput(v *StartChannelInput) error { } } +func validateOpStartInputDeviceInput(v *StartInputDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartInputDeviceInput"} + if v.InputDeviceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InputDeviceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartInputDeviceMaintenanceWindowInput(v *StartInputDeviceMaintenanceWindowInput) error { if v == nil { return nil @@ -4008,6 +4071,21 @@ func validateOpStopChannelInput(v *StopChannelInput) error { } } +func validateOpStopInputDeviceInput(v *StopInputDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopInputDeviceInput"} + if v.InputDeviceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InputDeviceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStopMultiplexInput(v *StopMultiplexInput) error { if v == nil { return nil diff --git a/service/quicksight/deserializers.go b/service/quicksight/deserializers.go index aca0933d88b..9004215ebd3 100644 --- a/service/quicksight/deserializers.go +++ b/service/quicksight/deserializers.go @@ -56878,6 +56878,88 @@ func awsRestjson1_deserializeDocumentJoinKeyProperties(v **types.JoinKeyProperti return nil } +func awsRestjson1_deserializeDocumentKPIActualValueConditionalFormatting(v **types.KPIActualValueConditionalFormatting, 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.KPIActualValueConditionalFormatting + if *v == nil { + sv = &types.KPIActualValueConditionalFormatting{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Icon": + if err := awsRestjson1_deserializeDocumentConditionalFormattingIcon(&sv.Icon, value); err != nil { + return err + } + + case "TextColor": + if err := awsRestjson1_deserializeDocumentConditionalFormattingColor(&sv.TextColor, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKPIComparisonValueConditionalFormatting(v **types.KPIComparisonValueConditionalFormatting, 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.KPIComparisonValueConditionalFormatting + if *v == nil { + sv = &types.KPIComparisonValueConditionalFormatting{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Icon": + if err := awsRestjson1_deserializeDocumentConditionalFormattingIcon(&sv.Icon, value); err != nil { + return err + } + + case "TextColor": + if err := awsRestjson1_deserializeDocumentConditionalFormattingColor(&sv.TextColor, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentKPIConditionalFormatting(v **types.KPIConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -56936,6 +57018,16 @@ func awsRestjson1_deserializeDocumentKPIConditionalFormattingOption(v **types.KP for key, value := range shape { switch key { + case "ActualValue": + if err := awsRestjson1_deserializeDocumentKPIActualValueConditionalFormatting(&sv.ActualValue, value); err != nil { + return err + } + + case "ComparisonValue": + if err := awsRestjson1_deserializeDocumentKPIComparisonValueConditionalFormatting(&sv.ComparisonValue, value); err != nil { + return err + } + case "PrimaryValue": if err := awsRestjson1_deserializeDocumentKPIPrimaryValueConditionalFormatting(&sv.PrimaryValue, value); err != nil { return err @@ -57137,11 +57229,21 @@ func awsRestjson1_deserializeDocumentKPIOptions(v **types.KPIOptions, value inte return err } + case "Sparkline": + if err := awsRestjson1_deserializeDocumentKPISparklineOptions(&sv.Sparkline, value); err != nil { + return err + } + case "TrendArrows": if err := awsRestjson1_deserializeDocumentTrendArrowOptions(&sv.TrendArrows, value); err != nil { return err } + case "VisualLayoutOptions": + if err := awsRestjson1_deserializeDocumentKPIVisualLayoutOptions(&sv.VisualLayoutOptions, value); err != nil { + return err + } + default: _, _ = key, value @@ -57264,6 +57366,73 @@ func awsRestjson1_deserializeDocumentKPISortConfiguration(v **types.KPISortConfi return nil } +func awsRestjson1_deserializeDocumentKPISparklineOptions(v **types.KPISparklineOptions, 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.KPISparklineOptions + if *v == nil { + sv = &types.KPISparklineOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Color": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) + } + sv.Color = ptr.String(jtv) + } + + case "TooltipVisibility": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) + } + sv.TooltipVisibility = types.Visibility(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KPISparklineType to be of type string, got %T instead", value) + } + sv.Type = types.KPISparklineType(jtv) + } + + case "Visibility": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) + } + sv.Visibility = types.Visibility(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentKPIVisual(v **types.KPIVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -57334,6 +57503,82 @@ func awsRestjson1_deserializeDocumentKPIVisual(v **types.KPIVisual, value interf return nil } +func awsRestjson1_deserializeDocumentKPIVisualLayoutOptions(v **types.KPIVisualLayoutOptions, 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.KPIVisualLayoutOptions + if *v == nil { + sv = &types.KPIVisualLayoutOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "StandardLayout": + if err := awsRestjson1_deserializeDocumentKPIVisualStandardLayout(&sv.StandardLayout, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKPIVisualStandardLayout(v **types.KPIVisualStandardLayout, 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.KPIVisualStandardLayout + if *v == nil { + sv = &types.KPIVisualStandardLayout{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KPIVisualStandardLayoutType to be of type string, got %T instead", value) + } + sv.Type = types.KPIVisualStandardLayoutType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentLabelOptions(v **types.LabelOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/quicksight/serializers.go b/service/quicksight/serializers.go index f04d308e2c0..e0dd59a6d9b 100644 --- a/service/quicksight/serializers.go +++ b/service/quicksight/serializers.go @@ -24774,6 +24774,48 @@ func awsRestjson1_serializeDocumentJoinKeyProperties(v *types.JoinKeyProperties, return nil } +func awsRestjson1_serializeDocumentKPIActualValueConditionalFormatting(v *types.KPIActualValueConditionalFormatting, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Icon != nil { + ok := object.Key("Icon") + if err := awsRestjson1_serializeDocumentConditionalFormattingIcon(v.Icon, ok); err != nil { + return err + } + } + + if v.TextColor != nil { + ok := object.Key("TextColor") + if err := awsRestjson1_serializeDocumentConditionalFormattingColor(v.TextColor, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentKPIComparisonValueConditionalFormatting(v *types.KPIComparisonValueConditionalFormatting, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Icon != nil { + ok := object.Key("Icon") + if err := awsRestjson1_serializeDocumentConditionalFormattingIcon(v.Icon, ok); err != nil { + return err + } + } + + if v.TextColor != nil { + ok := object.Key("TextColor") + if err := awsRestjson1_serializeDocumentConditionalFormattingColor(v.TextColor, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentKPIConditionalFormatting(v *types.KPIConditionalFormatting, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -24792,6 +24834,20 @@ func awsRestjson1_serializeDocumentKPIConditionalFormattingOption(v *types.KPICo object := value.Object() defer object.Close() + if v.ActualValue != nil { + ok := object.Key("ActualValue") + if err := awsRestjson1_serializeDocumentKPIActualValueConditionalFormatting(v.ActualValue, ok); err != nil { + return err + } + } + + if v.ComparisonValue != nil { + ok := object.Key("ComparisonValue") + if err := awsRestjson1_serializeDocumentKPIComparisonValueConditionalFormatting(v.ComparisonValue, ok); err != nil { + return err + } + } + if v.PrimaryValue != nil { ok := object.Key("PrimaryValue") if err := awsRestjson1_serializeDocumentKPIPrimaryValueConditionalFormatting(v.PrimaryValue, ok); err != nil { @@ -24922,6 +24978,13 @@ func awsRestjson1_serializeDocumentKPIOptions(v *types.KPIOptions, value smithyj } } + if v.Sparkline != nil { + ok := object.Key("Sparkline") + if err := awsRestjson1_serializeDocumentKPISparklineOptions(v.Sparkline, ok); err != nil { + return err + } + } + if v.TrendArrows != nil { ok := object.Key("TrendArrows") if err := awsRestjson1_serializeDocumentTrendArrowOptions(v.TrendArrows, ok); err != nil { @@ -24929,6 +24992,13 @@ func awsRestjson1_serializeDocumentKPIOptions(v *types.KPIOptions, value smithyj } } + if v.VisualLayoutOptions != nil { + ok := object.Key("VisualLayoutOptions") + if err := awsRestjson1_serializeDocumentKPIVisualLayoutOptions(v.VisualLayoutOptions, ok); err != nil { + return err + } + } + return nil } @@ -24981,6 +25051,33 @@ func awsRestjson1_serializeDocumentKPISortConfiguration(v *types.KPISortConfigur return nil } +func awsRestjson1_serializeDocumentKPISparklineOptions(v *types.KPISparklineOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Color != nil { + ok := object.Key("Color") + ok.String(*v.Color) + } + + if len(v.TooltipVisibility) > 0 { + ok := object.Key("TooltipVisibility") + ok.String(string(v.TooltipVisibility)) + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + if len(v.Visibility) > 0 { + ok := object.Key("Visibility") + ok.String(string(v.Visibility)) + } + + return nil +} + func awsRestjson1_serializeDocumentKPIVisual(v *types.KPIVisual, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -25035,6 +25132,32 @@ func awsRestjson1_serializeDocumentKPIVisual(v *types.KPIVisual, value smithyjso return nil } +func awsRestjson1_serializeDocumentKPIVisualLayoutOptions(v *types.KPIVisualLayoutOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.StandardLayout != nil { + ok := object.Key("StandardLayout") + if err := awsRestjson1_serializeDocumentKPIVisualStandardLayout(v.StandardLayout, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentKPIVisualStandardLayout(v *types.KPIVisualStandardLayout, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + func awsRestjson1_serializeDocumentLabelOptions(v *types.LabelOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/quicksight/types/enums.go b/service/quicksight/types/enums.go index a7b76a3c6de..72568579384 100644 --- a/service/quicksight/types/enums.go +++ b/service/quicksight/types/enums.go @@ -2154,6 +2154,42 @@ func (JoinType) Values() []JoinType { } } +type KPISparklineType string + +// Enum values for KPISparklineType +const ( + KPISparklineTypeLine KPISparklineType = "LINE" + KPISparklineTypeArea KPISparklineType = "AREA" +) + +// Values returns all known values for KPISparklineType. 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 (KPISparklineType) Values() []KPISparklineType { + return []KPISparklineType{ + "LINE", + "AREA", + } +} + +type KPIVisualStandardLayoutType string + +// Enum values for KPIVisualStandardLayoutType +const ( + KPIVisualStandardLayoutTypeClassic KPIVisualStandardLayoutType = "CLASSIC" + KPIVisualStandardLayoutTypeVertical KPIVisualStandardLayoutType = "VERTICAL" +) + +// Values returns all known values for KPIVisualStandardLayoutType. 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 (KPIVisualStandardLayoutType) Values() []KPIVisualStandardLayoutType { + return []KPIVisualStandardLayoutType{ + "CLASSIC", + "VERTICAL", + } +} + type LayoutElementType string // Enum values for LayoutElementType diff --git a/service/quicksight/types/types.go b/service/quicksight/types/types.go index d5eff625e7b..40c22abdf7e 100644 --- a/service/quicksight/types/types.go +++ b/service/quicksight/types/types.go @@ -6959,6 +6959,30 @@ type JoinKeyProperties struct { noSmithyDocumentSerde } +// The conditional formatting for the actual value of a KPI visual. +type KPIActualValueConditionalFormatting struct { + + // The conditional formatting of the actual value's icon. + Icon *ConditionalFormattingIcon + + // The conditional formatting of the actual value's text color. + TextColor *ConditionalFormattingColor + + noSmithyDocumentSerde +} + +// The conditional formatting for the comparison value of a KPI visual. +type KPIComparisonValueConditionalFormatting struct { + + // The conditional formatting of the comparison value's icon. + Icon *ConditionalFormattingIcon + + // The conditional formatting of the comparison value's text color. + TextColor *ConditionalFormattingColor + + noSmithyDocumentSerde +} + // The conditional formatting of a KPI visual. type KPIConditionalFormatting struct { @@ -6971,6 +6995,12 @@ type KPIConditionalFormatting struct { // The conditional formatting options of a KPI visual. type KPIConditionalFormattingOption struct { + // The conditional formatting for the actual value of a KPI visual. + ActualValue *KPIActualValueConditionalFormatting + + // The conditional formatting for the comparison value of a KPI visual. + ComparisonValue *KPIComparisonValueConditionalFormatting + // The conditional formatting for the primary value of a KPI visual. PrimaryValue *KPIPrimaryValueConditionalFormatting @@ -7032,9 +7062,16 @@ type KPIOptions struct { // The options that determine the secondary value font configuration. SecondaryValueFontConfiguration *FontConfiguration + // The options that determine the visibility, color, type, and tooltip visibility + // of the sparkline of a KPI visual. + Sparkline *KPISparklineOptions + // The options that determine the presentation of trend arrows in a KPI visual. TrendArrows *TrendArrowOptions + // The options that determine the layout a KPI visual. + VisualLayoutOptions *KPIVisualLayoutOptions + noSmithyDocumentSerde } @@ -7068,6 +7105,27 @@ type KPISortConfiguration struct { noSmithyDocumentSerde } +// The options that determine the visibility, color, type, and tooltip visibility +// of the sparkline of a KPI visual. +type KPISparklineOptions struct { + + // The type of the sparkline. + // + // This member is required. + Type KPISparklineType + + // The color of the sparkline. + Color *string + + // The tooltip visibility of the sparkline. + TooltipVisibility Visibility + + // The visibility of the sparkline. + Visibility Visibility + + noSmithyDocumentSerde +} + // A key performance indicator (KPI). For more information, see Using KPIs (https://docs.aws.amazon.com/quicksight/latest/user/kpi.html) // in the Amazon QuickSight User Guide. type KPIVisual struct { @@ -7100,6 +7158,26 @@ type KPIVisual struct { noSmithyDocumentSerde } +// The options that determine the layout a KPI visual. +type KPIVisualLayoutOptions struct { + + // The standard layout of the KPI visual. + StandardLayout *KPIVisualStandardLayout + + noSmithyDocumentSerde +} + +// The standard layout of the KPI visual. +type KPIVisualStandardLayout struct { + + // The standard layout type. + // + // This member is required. + Type KPIVisualStandardLayoutType + + noSmithyDocumentSerde +} + // The share label options for the labels. type LabelOptions struct { diff --git a/service/quicksight/validators.go b/service/quicksight/validators.go index 6465c527526..05e4909b750 100644 --- a/service/quicksight/validators.go +++ b/service/quicksight/validators.go @@ -10248,6 +10248,50 @@ func validateJoinInstruction(v *types.JoinInstruction) error { } } +func validateKPIActualValueConditionalFormatting(v *types.KPIActualValueConditionalFormatting) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KPIActualValueConditionalFormatting"} + if v.TextColor != nil { + if err := validateConditionalFormattingColor(v.TextColor); err != nil { + invalidParams.AddNested("TextColor", err.(smithy.InvalidParamsError)) + } + } + if v.Icon != nil { + if err := validateConditionalFormattingIcon(v.Icon); err != nil { + invalidParams.AddNested("Icon", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateKPIComparisonValueConditionalFormatting(v *types.KPIComparisonValueConditionalFormatting) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KPIComparisonValueConditionalFormatting"} + if v.TextColor != nil { + if err := validateConditionalFormattingColor(v.TextColor); err != nil { + invalidParams.AddNested("TextColor", err.(smithy.InvalidParamsError)) + } + } + if v.Icon != nil { + if err := validateConditionalFormattingIcon(v.Icon); err != nil { + invalidParams.AddNested("Icon", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateKPIConditionalFormatting(v *types.KPIConditionalFormatting) error { if v == nil { return nil @@ -10280,6 +10324,16 @@ func validateKPIConditionalFormattingOption(v *types.KPIConditionalFormattingOpt invalidParams.AddNested("ProgressBar", err.(smithy.InvalidParamsError)) } } + if v.ActualValue != nil { + if err := validateKPIActualValueConditionalFormatting(v.ActualValue); err != nil { + invalidParams.AddNested("ActualValue", err.(smithy.InvalidParamsError)) + } + } + if v.ComparisonValue != nil { + if err := validateKPIComparisonValueConditionalFormatting(v.ComparisonValue); err != nil { + invalidParams.AddNested("ComparisonValue", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -10368,6 +10422,16 @@ func validateKPIOptions(v *types.KPIOptions) error { invalidParams.AddNested("Comparison", err.(smithy.InvalidParamsError)) } } + if v.Sparkline != nil { + if err := validateKPISparklineOptions(v.Sparkline); err != nil { + invalidParams.AddNested("Sparkline", err.(smithy.InvalidParamsError)) + } + } + if v.VisualLayoutOptions != nil { + if err := validateKPIVisualLayoutOptions(v.VisualLayoutOptions); err != nil { + invalidParams.AddNested("VisualLayoutOptions", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -10431,6 +10495,21 @@ func validateKPISortConfiguration(v *types.KPISortConfiguration) error { } } +func validateKPISparklineOptions(v *types.KPISparklineOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KPISparklineOptions"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateKPIVisual(v *types.KPIVisual) error { if v == nil { return nil @@ -10466,6 +10545,38 @@ func validateKPIVisual(v *types.KPIVisual) error { } } +func validateKPIVisualLayoutOptions(v *types.KPIVisualLayoutOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KPIVisualLayoutOptions"} + if v.StandardLayout != nil { + if err := validateKPIVisualStandardLayout(v.StandardLayout); err != nil { + invalidParams.AddNested("StandardLayout", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateKPIVisualStandardLayout(v *types.KPIVisualStandardLayout) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KPIVisualStandardLayout"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateLayout(v *types.Layout) error { if v == nil { return nil