diff --git a/CHANGELOG.md b/CHANGELOG.md index 3034031fe07..98d17b6aee8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +Release v1.53.13 (2024-05-30) +=== + +### Service Client Updates +* `service/acm`: Updates service API + * add v2 smoke tests and smithy smokeTests trait for SDK testing. +* `service/bedrock-agent`: Updates service API and documentation +* `service/bedrock-runtime`: Updates service API and documentation +* `service/cloudtrail`: Updates service API and documentation + * CloudTrail Lake returns PartitionKeys in the GetEventDataStore API response. Events are grouped into partitions based on these keys for better query performance. For example, the calendarday key groups events by day, while combining the calendarday key with the hour key groups them by day and hour. +* `service/connect`: Updates service API and documentation +* `service/emr-serverless`: Updates service API, documentation, and paginators +* `service/rds`: Updates service API, documentation, waiters, paginators, and examples + * Updates Amazon RDS documentation for Aurora Postgres DBname. +* `service/sagemaker`: Updates service API and documentation + * Adds Model Card information as a new component to Model Package. Autopilot launches algorithm selection for TimeSeries modality to generate AutoML candidates per algorithm. + Release v1.53.12 (2024-05-29) === diff --git a/aws/endpoints/defaults.go b/aws/endpoints/defaults.go index 75212228938..fa5625df41f 100644 --- a/aws/endpoints/defaults.go +++ b/aws/endpoints/defaults.go @@ -246,13 +246,6 @@ var awsPartition = partition{ }, }, Services: services{ - "a4b": service{ - Endpoints: serviceEndpoints{ - endpointKey{ - Region: "us-east-1", - }: endpoint{}, - }, - }, "access-analyzer": service{ Endpoints: serviceEndpoints{ endpointKey{ diff --git a/aws/version.go b/aws/version.go index f9ed5204308..1ca16ab1205 100644 --- a/aws/version.go +++ b/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.53.12" +const SDKVersion = "1.53.13" diff --git a/models/apis/acm/2015-12-08/api-2.json b/models/apis/acm/2015-12-08/api-2.json index a395cf4858d..893fda1ca80 100644 --- a/models/apis/acm/2015-12-08/api-2.json +++ b/models/apis/acm/2015-12-08/api-2.json @@ -5,6 +5,7 @@ "endpointPrefix":"acm", "jsonVersion":"1.1", "protocol":"json", + "protocols":["json"], "serviceAbbreviation":"ACM", "serviceFullName":"AWS Certificate Manager", "serviceId":"ACM", diff --git a/models/apis/acm/2015-12-08/endpoint-rule-set-1.json b/models/apis/acm/2015-12-08/endpoint-rule-set-1.json index b176674f548..e0738bc0b10 100644 --- a/models/apis/acm/2015-12-08/endpoint-rule-set-1.json +++ b/models/apis/acm/2015-12-08/endpoint-rule-set-1.json @@ -32,38 +32,83 @@ { "conditions": [ { - "fn": "aws.partition", + "fn": "isSet", "argv": [ { - "ref": "Region" + "ref": "Endpoint" } - ], - "assign": "PartitionResult" + ] } ], - "type": "tree", "rules": [ { "conditions": [ { - "fn": "isSet", + "fn": "booleanEquals", "argv": [ { - "ref": "Endpoint" - } + "ref": "UseFIPS" + }, + true ] + } + ], + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], + "rules": [ + { + "conditions": [ { - "fn": "parseURL", + "fn": "aws.partition", "argv": [ { - "ref": "Endpoint" + "ref": "Region" } ], - "assign": "url" + "assign": "PartitionResult" } ], - "type": "tree", "rules": [ { "conditions": [ @@ -75,165 +120,109 @@ }, true ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] } ], - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error" - }, - { - "conditions": [], - "type": "tree", "rules": [ { "conditions": [ { "fn": "booleanEquals", "argv": [ + true, { - "ref": "UseDualStack" - }, - true + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + }, + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } ] } ], - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error" + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://acm-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" }, { "conditions": [], - "endpoint": { - "url": { - "ref": "Endpoint" - }, - "properties": {}, - "headers": {} - }, - "type": "endpoint" + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" } - ] - } - ] - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] + ], + "type": "tree" }, - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "type": "tree", - "rules": [ { "conditions": [ { "fn": "booleanEquals", "argv": [ - true, { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsFIPS" - ] - } - ] - }, - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } + "ref": "UseFIPS" + }, + true ] } ], - "type": "tree", "rules": [ { - "conditions": [], - "endpoint": { - "url": "https://acm-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - }, - { - "conditions": [], - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error" - } - ] - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - true, + "conditions": [ { - "fn": "getAttr", + "fn": "booleanEquals", "argv": [ { - "ref": "PartitionResult" + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] }, - "supportsFIPS" + true ] } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], - "type": "tree", + ], "rules": [ { "conditions": [ { "fn": "stringEquals", "argv": [ - "aws-us-gov", { "fn": "getAttr", "argv": [ @@ -242,12 +231,13 @@ }, "name" ] - } + }, + "aws-us-gov" ] } ], "endpoint": { - "url": "https://acm.{Region}.{PartitionResult#dnsSuffix}", + "url": "https://acm.{Region}.amazonaws.com", "properties": {}, "headers": {} }, @@ -262,79 +252,88 @@ }, "type": "endpoint" } - ] + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" } - ] + ], + "type": "tree" }, - { - "conditions": [], - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error" - } - ] - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "type": "tree", - "rules": [ { "conditions": [ { "fn": "booleanEquals", "argv": [ - true, { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } + "ref": "UseDualStack" + }, + true ] } ], - "type": "tree", "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://acm.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + }, { "conditions": [], - "endpoint": { - "url": "https://acm.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" } - ] + ], + "type": "tree" }, { "conditions": [], - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error" + "endpoint": { + "url": "https://acm.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" } - ] - }, - { - "conditions": [], - "endpoint": { - "url": "https://acm.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" + ], + "type": "tree" } - ] + ], + "type": "tree" + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" } ] } \ No newline at end of file diff --git a/models/apis/acm/2015-12-08/endpoint-tests-1.json b/models/apis/acm/2015-12-08/endpoint-tests-1.json index 4104b65d8be..b232e72ae64 100644 --- a/models/apis/acm/2015-12-08/endpoint-tests-1.json +++ b/models/apis/acm/2015-12-08/endpoint-tests-1.json @@ -1,1028 +1,31 @@ { "testCases": [ { - "documentation": "For region ap-south-2 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-south-2.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-south-2", - "UseDualStack": true - } - }, - { - "documentation": "For region ap-south-2 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-south-2.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-south-2", - "UseDualStack": false - } - }, - { - "documentation": "For region ap-south-2 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.ap-south-2.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "ap-south-2", - "UseDualStack": true - } - }, - { - "documentation": "For region ap-south-2 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.ap-south-2.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "ap-south-2", - "UseDualStack": false - } - }, - { - "documentation": "For region ap-south-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-south-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-south-1", - "UseDualStack": true - } - }, - { - "documentation": "For region ap-south-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-south-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-south-1", - "UseDualStack": false - } - }, - { - "documentation": "For region ap-south-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.ap-south-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "ap-south-1", - "UseDualStack": true - } - }, - { - "documentation": "For region ap-south-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.ap-south-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "ap-south-1", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-south-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-south-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-south-1", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-south-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-south-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-south-1", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-south-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-south-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-south-1", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-south-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-south-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-south-1", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-south-2 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-south-2.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-south-2", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-south-2 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-south-2.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-south-2", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-south-2 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-south-2.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-south-2", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-south-2 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-south-2.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-south-2", - "UseDualStack": false - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.us-gov-east-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "us-gov-east-1", - "UseDualStack": true - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.us-gov-east-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "us-gov-east-1", - "UseDualStack": false - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.us-gov-east-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "us-gov-east-1", - "UseDualStack": true - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.us-gov-east-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "us-gov-east-1", - "UseDualStack": false - } - }, - { - "documentation": "For region me-central-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.me-central-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "me-central-1", - "UseDualStack": true - } - }, - { - "documentation": "For region me-central-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.me-central-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "me-central-1", - "UseDualStack": false - } - }, - { - "documentation": "For region me-central-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.me-central-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "me-central-1", - "UseDualStack": true - } - }, - { - "documentation": "For region me-central-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.me-central-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "me-central-1", - "UseDualStack": false - } - }, - { - "documentation": "For region ca-central-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ca-central-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "ca-central-1", - "UseDualStack": true - } - }, - { - "documentation": "For region ca-central-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ca-central-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "ca-central-1", - "UseDualStack": false - } - }, - { - "documentation": "For region ca-central-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.ca-central-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "ca-central-1", - "UseDualStack": true - } - }, - { - "documentation": "For region ca-central-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.ca-central-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "ca-central-1", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-central-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-central-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-central-1", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-central-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-central-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-central-1", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-central-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-central-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-central-1", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-central-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-central-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-central-1", - "UseDualStack": false - } - }, - { - "documentation": "For region us-iso-west-1 with FIPS enabled and DualStack enabled", - "expect": { - "error": "FIPS and DualStack are enabled, but this partition does not support one or both" - }, - "params": { - "UseFIPS": true, - "Region": "us-iso-west-1", - "UseDualStack": true - } - }, - { - "documentation": "For region us-iso-west-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.us-iso-west-1.c2s.ic.gov" - } - }, - "params": { - "UseFIPS": true, - "Region": "us-iso-west-1", - "UseDualStack": false - } - }, - { - "documentation": "For region us-iso-west-1 with FIPS disabled and DualStack enabled", - "expect": { - "error": "DualStack is enabled but this partition does not support DualStack" - }, - "params": { - "UseFIPS": false, - "Region": "us-iso-west-1", - "UseDualStack": true - } - }, - { - "documentation": "For region us-iso-west-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.us-iso-west-1.c2s.ic.gov" - } - }, - "params": { - "UseFIPS": false, - "Region": "us-iso-west-1", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-central-2 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-central-2.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-central-2", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-central-2 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-central-2.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-central-2", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-central-2 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-central-2.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-central-2", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-central-2 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-central-2.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-central-2", - "UseDualStack": false - } - }, - { - "documentation": "For region us-west-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.us-west-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "us-west-1", - "UseDualStack": true - } - }, - { - "documentation": "For region us-west-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.us-west-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "us-west-1", - "UseDualStack": false - } - }, - { - "documentation": "For region us-west-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.us-west-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "us-west-1", - "UseDualStack": true - } - }, - { - "documentation": "For region us-west-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.us-west-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "us-west-1", - "UseDualStack": false - } - }, - { - "documentation": "For region us-west-2 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.us-west-2.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "us-west-2", - "UseDualStack": true - } - }, - { - "documentation": "For region us-west-2 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.us-west-2.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "us-west-2", - "UseDualStack": false - } - }, - { - "documentation": "For region us-west-2 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.us-west-2.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "us-west-2", - "UseDualStack": true - } - }, - { - "documentation": "For region us-west-2 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.us-west-2.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "us-west-2", - "UseDualStack": false - } - }, - { - "documentation": "For region af-south-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.af-south-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "af-south-1", - "UseDualStack": true - } - }, - { - "documentation": "For region af-south-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.af-south-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "af-south-1", - "UseDualStack": false - } - }, - { - "documentation": "For region af-south-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.af-south-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "af-south-1", - "UseDualStack": true - } - }, - { - "documentation": "For region af-south-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.af-south-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "af-south-1", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-north-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-north-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-north-1", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-north-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-north-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-north-1", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-north-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-north-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-north-1", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-north-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-north-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-north-1", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-west-3 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-west-3.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-west-3", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-west-3 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-west-3.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-west-3", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-west-3 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-west-3.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-west-3", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-west-3 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-west-3.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-west-3", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-west-2 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-west-2.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-west-2", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-west-2 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-west-2.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-west-2", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-west-2 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-west-2.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-west-2", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-west-2 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-west-2.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-west-2", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-west-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-west-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-west-1", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-west-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.eu-west-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "eu-west-1", - "UseDualStack": false - } - }, - { - "documentation": "For region eu-west-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-west-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-west-1", - "UseDualStack": true - } - }, - { - "documentation": "For region eu-west-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.eu-west-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": false, - "Region": "eu-west-1", - "UseDualStack": false - } - }, - { - "documentation": "For region ap-northeast-3 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-northeast-3.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-northeast-3", - "UseDualStack": true - } - }, - { - "documentation": "For region ap-northeast-3 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-northeast-3.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-northeast-3", - "UseDualStack": false - } - }, - { - "documentation": "For region ap-northeast-3 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.ap-northeast-3.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "ap-northeast-3", - "UseDualStack": true - } - }, - { - "documentation": "For region ap-northeast-3 with FIPS disabled and DualStack disabled", + "documentation": "For region af-south-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.ap-northeast-3.amazonaws.com" + "url": "https://acm.af-south-1.amazonaws.com" } }, "params": { + "Region": "af-south-1", "UseFIPS": false, - "Region": "ap-northeast-3", - "UseDualStack": false - } - }, - { - "documentation": "For region ap-northeast-2 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-northeast-2.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-northeast-2", - "UseDualStack": true - } - }, - { - "documentation": "For region ap-northeast-2 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-northeast-2.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-northeast-2", "UseDualStack": false } }, { - "documentation": "For region ap-northeast-2 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.ap-northeast-2.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "ap-northeast-2", - "UseDualStack": true - } - }, - { - "documentation": "For region ap-northeast-2 with FIPS disabled and DualStack disabled", + "documentation": "For region ap-east-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.ap-northeast-2.amazonaws.com" + "url": "https://acm.ap-east-1.amazonaws.com" } }, "params": { + "Region": "ap-east-1", "UseFIPS": false, - "Region": "ap-northeast-2", - "UseDualStack": false - } - }, - { - "documentation": "For region ap-northeast-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-northeast-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-northeast-1", - "UseDualStack": true - } - }, - { - "documentation": "For region ap-northeast-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-northeast-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-northeast-1", "UseDualStack": false } }, - { - "documentation": "For region ap-northeast-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.ap-northeast-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "ap-northeast-1", - "UseDualStack": true - } - }, { "documentation": "For region ap-northeast-1 with FIPS disabled and DualStack disabled", "expect": { @@ -1031,680 +34,524 @@ } }, "params": { - "UseFIPS": false, "Region": "ap-northeast-1", - "UseDualStack": false - } - }, - { - "documentation": "For region me-south-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.me-south-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "me-south-1", - "UseDualStack": true - } - }, - { - "documentation": "For region me-south-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.me-south-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "me-south-1", - "UseDualStack": false - } - }, - { - "documentation": "For region me-south-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.me-south-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "me-south-1", - "UseDualStack": true - } - }, - { - "documentation": "For region me-south-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm.me-south-1.amazonaws.com" - } - }, - "params": { "UseFIPS": false, - "Region": "me-south-1", - "UseDualStack": false - } - }, - { - "documentation": "For region sa-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.sa-east-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "sa-east-1", - "UseDualStack": true - } - }, - { - "documentation": "For region sa-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.sa-east-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "sa-east-1", "UseDualStack": false } }, { - "documentation": "For region sa-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.sa-east-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "sa-east-1", - "UseDualStack": true - } - }, - { - "documentation": "For region sa-east-1 with FIPS disabled and DualStack disabled", + "documentation": "For region ap-northeast-2 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.sa-east-1.amazonaws.com" + "url": "https://acm.ap-northeast-2.amazonaws.com" } }, "params": { + "Region": "ap-northeast-2", "UseFIPS": false, - "Region": "sa-east-1", - "UseDualStack": false - } - }, - { - "documentation": "For region ap-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-east-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-east-1", - "UseDualStack": true - } - }, - { - "documentation": "For region ap-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.ap-east-1.amazonaws.com" - } - }, - "params": { - "UseFIPS": true, - "Region": "ap-east-1", "UseDualStack": false } }, { - "documentation": "For region ap-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm.ap-east-1.api.aws" - } - }, - "params": { - "UseFIPS": false, - "Region": "ap-east-1", - "UseDualStack": true - } - }, - { - "documentation": "For region ap-east-1 with FIPS disabled and DualStack disabled", + "documentation": "For region ap-northeast-3 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.ap-east-1.amazonaws.com" + "url": "https://acm.ap-northeast-3.amazonaws.com" } }, "params": { + "Region": "ap-northeast-3", "UseFIPS": false, - "Region": "ap-east-1", "UseDualStack": false } }, { - "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.cn-north-1.api.amazonwebservices.com.cn" - } - }, - "params": { - "UseFIPS": true, - "Region": "cn-north-1", - "UseDualStack": true - } - }, - { - "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", + "documentation": "For region ap-south-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm-fips.cn-north-1.amazonaws.com.cn" + "url": "https://acm.ap-south-1.amazonaws.com" } }, "params": { - "UseFIPS": true, - "Region": "cn-north-1", + "Region": "ap-south-1", + "UseFIPS": false, "UseDualStack": false } }, { - "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", + "documentation": "For region ap-southeast-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.cn-north-1.api.amazonwebservices.com.cn" + "url": "https://acm.ap-southeast-1.amazonaws.com" } }, "params": { + "Region": "ap-southeast-1", "UseFIPS": false, - "Region": "cn-north-1", - "UseDualStack": true + "UseDualStack": false } }, { - "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", + "documentation": "For region ap-southeast-2 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.cn-north-1.amazonaws.com.cn" + "url": "https://acm.ap-southeast-2.amazonaws.com" } }, "params": { + "Region": "ap-southeast-2", "UseFIPS": false, - "Region": "cn-north-1", "UseDualStack": false } }, { - "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://acm-fips.us-gov-west-1.api.aws" - } - }, - "params": { - "UseFIPS": true, - "Region": "us-gov-west-1", - "UseDualStack": true - } - }, - { - "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack disabled", + "documentation": "For region ap-southeast-3 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.us-gov-west-1.amazonaws.com" + "url": "https://acm.ap-southeast-3.amazonaws.com" } }, "params": { - "UseFIPS": true, - "Region": "us-gov-west-1", + "Region": "ap-southeast-3", + "UseFIPS": false, "UseDualStack": false } }, { - "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack enabled", + "documentation": "For region ca-central-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.us-gov-west-1.api.aws" + "url": "https://acm.ca-central-1.amazonaws.com" } }, "params": { + "Region": "ca-central-1", "UseFIPS": false, - "Region": "us-gov-west-1", - "UseDualStack": true + "UseDualStack": false } }, { - "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack disabled", + "documentation": "For region ca-central-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.us-gov-west-1.amazonaws.com" + "url": "https://acm-fips.ca-central-1.amazonaws.com" } }, "params": { - "UseFIPS": false, - "Region": "us-gov-west-1", + "Region": "ca-central-1", + "UseFIPS": true, "UseDualStack": false } }, { - "documentation": "For region ap-southeast-1 with FIPS enabled and DualStack enabled", + "documentation": "For region eu-central-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm-fips.ap-southeast-1.api.aws" + "url": "https://acm.eu-central-1.amazonaws.com" } }, "params": { - "UseFIPS": true, - "Region": "ap-southeast-1", - "UseDualStack": true + "Region": "eu-central-1", + "UseFIPS": false, + "UseDualStack": false } }, { - "documentation": "For region ap-southeast-1 with FIPS enabled and DualStack disabled", + "documentation": "For region eu-north-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm-fips.ap-southeast-1.amazonaws.com" + "url": "https://acm.eu-north-1.amazonaws.com" } }, "params": { - "UseFIPS": true, - "Region": "ap-southeast-1", + "Region": "eu-north-1", + "UseFIPS": false, "UseDualStack": false } }, { - "documentation": "For region ap-southeast-1 with FIPS disabled and DualStack enabled", + "documentation": "For region eu-south-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.ap-southeast-1.api.aws" + "url": "https://acm.eu-south-1.amazonaws.com" } }, "params": { + "Region": "eu-south-1", "UseFIPS": false, - "Region": "ap-southeast-1", - "UseDualStack": true + "UseDualStack": false } }, { - "documentation": "For region ap-southeast-1 with FIPS disabled and DualStack disabled", + "documentation": "For region eu-west-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.ap-southeast-1.amazonaws.com" + "url": "https://acm.eu-west-1.amazonaws.com" } }, "params": { + "Region": "eu-west-1", "UseFIPS": false, - "Region": "ap-southeast-1", "UseDualStack": false } }, { - "documentation": "For region ap-southeast-2 with FIPS enabled and DualStack enabled", + "documentation": "For region eu-west-2 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm-fips.ap-southeast-2.api.aws" + "url": "https://acm.eu-west-2.amazonaws.com" } }, "params": { - "UseFIPS": true, - "Region": "ap-southeast-2", - "UseDualStack": true + "Region": "eu-west-2", + "UseFIPS": false, + "UseDualStack": false } }, { - "documentation": "For region ap-southeast-2 with FIPS enabled and DualStack disabled", + "documentation": "For region eu-west-3 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm-fips.ap-southeast-2.amazonaws.com" + "url": "https://acm.eu-west-3.amazonaws.com" } }, "params": { - "UseFIPS": true, - "Region": "ap-southeast-2", + "Region": "eu-west-3", + "UseFIPS": false, "UseDualStack": false } }, { - "documentation": "For region ap-southeast-2 with FIPS disabled and DualStack enabled", + "documentation": "For region me-south-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.ap-southeast-2.api.aws" + "url": "https://acm.me-south-1.amazonaws.com" } }, "params": { + "Region": "me-south-1", "UseFIPS": false, - "Region": "ap-southeast-2", - "UseDualStack": true + "UseDualStack": false } }, { - "documentation": "For region ap-southeast-2 with FIPS disabled and DualStack disabled", + "documentation": "For region sa-east-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.ap-southeast-2.amazonaws.com" + "url": "https://acm.sa-east-1.amazonaws.com" } }, "params": { + "Region": "sa-east-1", "UseFIPS": false, - "Region": "ap-southeast-2", "UseDualStack": false } }, { - "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", + "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", "expect": { - "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + "endpoint": { + "url": "https://acm.us-east-1.amazonaws.com" + } }, "params": { - "UseFIPS": true, - "Region": "us-iso-east-1", - "UseDualStack": true + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false } }, { - "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", + "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm-fips.us-iso-east-1.c2s.ic.gov" + "url": "https://acm-fips.us-east-1.amazonaws.com" } }, "params": { + "Region": "us-east-1", "UseFIPS": true, - "Region": "us-iso-east-1", "UseDualStack": false } }, { - "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", + "documentation": "For region us-east-2 with FIPS disabled and DualStack disabled", "expect": { - "error": "DualStack is enabled but this partition does not support DualStack" + "endpoint": { + "url": "https://acm.us-east-2.amazonaws.com" + } }, "params": { + "Region": "us-east-2", "UseFIPS": false, - "Region": "us-iso-east-1", - "UseDualStack": true + "UseDualStack": false } }, { - "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", + "documentation": "For region us-east-2 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.us-iso-east-1.c2s.ic.gov" + "url": "https://acm-fips.us-east-2.amazonaws.com" } }, "params": { - "UseFIPS": false, - "Region": "us-iso-east-1", + "Region": "us-east-2", + "UseFIPS": true, "UseDualStack": false } }, { - "documentation": "For region ap-southeast-3 with FIPS enabled and DualStack enabled", + "documentation": "For region us-west-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm-fips.ap-southeast-3.api.aws" + "url": "https://acm.us-west-1.amazonaws.com" } }, "params": { - "UseFIPS": true, - "Region": "ap-southeast-3", - "UseDualStack": true + "Region": "us-west-1", + "UseFIPS": false, + "UseDualStack": false } }, { - "documentation": "For region ap-southeast-3 with FIPS enabled and DualStack disabled", + "documentation": "For region us-west-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm-fips.ap-southeast-3.amazonaws.com" + "url": "https://acm-fips.us-west-1.amazonaws.com" } }, "params": { + "Region": "us-west-1", "UseFIPS": true, - "Region": "ap-southeast-3", "UseDualStack": false } }, { - "documentation": "For region ap-southeast-3 with FIPS disabled and DualStack enabled", + "documentation": "For region us-west-2 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.ap-southeast-3.api.aws" + "url": "https://acm.us-west-2.amazonaws.com" } }, "params": { + "Region": "us-west-2", "UseFIPS": false, - "Region": "ap-southeast-3", - "UseDualStack": true + "UseDualStack": false } }, { - "documentation": "For region ap-southeast-3 with FIPS disabled and DualStack disabled", + "documentation": "For region us-west-2 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.ap-southeast-3.amazonaws.com" + "url": "https://acm-fips.us-west-2.amazonaws.com" } }, "params": { - "UseFIPS": false, - "Region": "ap-southeast-3", + "Region": "us-west-2", + "UseFIPS": true, "UseDualStack": false } }, { - "documentation": "For region ap-southeast-4 with FIPS enabled and DualStack enabled", + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", "expect": { "endpoint": { - "url": "https://acm-fips.ap-southeast-4.api.aws" + "url": "https://acm-fips.us-east-1.api.aws" } }, "params": { + "Region": "us-east-1", "UseFIPS": true, - "Region": "ap-southeast-4", "UseDualStack": true } }, { - "documentation": "For region ap-southeast-4 with FIPS enabled and DualStack disabled", + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", "expect": { "endpoint": { - "url": "https://acm-fips.ap-southeast-4.amazonaws.com" + "url": "https://acm.us-east-1.api.aws" } }, "params": { - "UseFIPS": true, - "Region": "ap-southeast-4", - "UseDualStack": false + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true } }, { - "documentation": "For region ap-southeast-4 with FIPS disabled and DualStack enabled", + "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.ap-southeast-4.api.aws" + "url": "https://acm.cn-north-1.amazonaws.com.cn" } }, "params": { + "Region": "cn-north-1", "UseFIPS": false, - "Region": "ap-southeast-4", - "UseDualStack": true + "UseDualStack": false } }, { - "documentation": "For region ap-southeast-4 with FIPS disabled and DualStack disabled", + "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.ap-southeast-4.amazonaws.com" + "url": "https://acm.cn-northwest-1.amazonaws.com.cn" } }, "params": { + "Region": "cn-northwest-1", "UseFIPS": false, - "Region": "ap-southeast-4", "UseDualStack": false } }, { - "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", "expect": { "endpoint": { - "url": "https://acm-fips.us-east-1.api.aws" + "url": "https://acm-fips.cn-north-1.api.amazonwebservices.com.cn" } }, "params": { + "Region": "cn-north-1", "UseFIPS": true, - "Region": "us-east-1", "UseDualStack": true } }, { - "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", + "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm-fips.us-east-1.amazonaws.com" + "url": "https://acm-fips.cn-north-1.amazonaws.com.cn" } }, "params": { + "Region": "cn-north-1", "UseFIPS": true, - "Region": "us-east-1", "UseDualStack": false } }, { - "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", "expect": { "endpoint": { - "url": "https://acm.us-east-1.api.aws" + "url": "https://acm.cn-north-1.api.amazonwebservices.com.cn" } }, "params": { + "Region": "cn-north-1", "UseFIPS": false, - "Region": "us-east-1", "UseDualStack": true } }, { - "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.us-east-1.amazonaws.com" + "url": "https://acm.us-gov-east-1.amazonaws.com" } }, "params": { + "Region": "us-gov-east-1", "UseFIPS": false, - "Region": "us-east-1", "UseDualStack": false } }, { - "documentation": "For region us-east-2 with FIPS enabled and DualStack enabled", + "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm-fips.us-east-2.api.aws" + "url": "https://acm.us-gov-west-1.amazonaws.com" } }, "params": { - "UseFIPS": true, - "Region": "us-east-2", - "UseDualStack": true + "Region": "us-gov-west-1", + "UseFIPS": false, + "UseDualStack": false } }, { - "documentation": "For region us-east-2 with FIPS enabled and DualStack disabled", + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", "expect": { "endpoint": { - "url": "https://acm-fips.us-east-2.amazonaws.com" + "url": "https://acm-fips.us-gov-east-1.api.aws" } }, "params": { + "Region": "us-gov-east-1", "UseFIPS": true, - "Region": "us-east-2", - "UseDualStack": false + "UseDualStack": true } }, { - "documentation": "For region us-east-2 with FIPS disabled and DualStack enabled", + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.us-east-2.api.aws" + "url": "https://acm.us-gov-east-1.amazonaws.com" } }, "params": { - "UseFIPS": false, - "Region": "us-east-2", - "UseDualStack": true + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": false } }, { - "documentation": "For region us-east-2 with FIPS disabled and DualStack disabled", + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", "expect": { "endpoint": { - "url": "https://acm.us-east-2.amazonaws.com" + "url": "https://acm.us-gov-east-1.api.aws" } }, "params": { + "Region": "us-gov-east-1", "UseFIPS": false, - "Region": "us-east-2", - "UseDualStack": false + "UseDualStack": true } }, { - "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack enabled", + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", "expect": { - "endpoint": { - "url": "https://acm-fips.cn-northwest-1.api.amazonwebservices.com.cn" - } + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" }, "params": { + "Region": "us-iso-east-1", "UseFIPS": true, - "Region": "cn-northwest-1", "UseDualStack": true } }, { - "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack disabled", + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm-fips.cn-northwest-1.amazonaws.com.cn" + "url": "https://acm-fips.us-iso-east-1.c2s.ic.gov" } }, "params": { + "Region": "us-iso-east-1", "UseFIPS": true, - "Region": "cn-northwest-1", "UseDualStack": false } }, { - "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack enabled", + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", "expect": { - "endpoint": { - "url": "https://acm.cn-northwest-1.api.amazonwebservices.com.cn" - } + "error": "DualStack is enabled but this partition does not support DualStack" }, "params": { + "Region": "us-iso-east-1", "UseFIPS": false, - "Region": "cn-northwest-1", "UseDualStack": true } }, { - "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack disabled", + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://acm.cn-northwest-1.amazonaws.com.cn" + "url": "https://acm.us-iso-east-1.c2s.ic.gov" } }, "params": { + "Region": "us-iso-east-1", "UseFIPS": false, - "Region": "cn-northwest-1", "UseDualStack": false } }, @@ -1714,8 +561,8 @@ "error": "FIPS and DualStack are enabled, but this partition does not support one or both" }, "params": { - "UseFIPS": true, "Region": "us-isob-east-1", + "UseFIPS": true, "UseDualStack": true } }, @@ -1727,8 +574,8 @@ } }, "params": { - "UseFIPS": true, "Region": "us-isob-east-1", + "UseFIPS": true, "UseDualStack": false } }, @@ -1738,8 +585,8 @@ "error": "DualStack is enabled but this partition does not support DualStack" }, "params": { - "UseFIPS": false, "Region": "us-isob-east-1", + "UseFIPS": false, "UseDualStack": true } }, @@ -1751,21 +598,34 @@ } }, "params": { - "UseFIPS": false, "Region": "us-isob-east-1", + "UseFIPS": false, "UseDualStack": false } }, { - "documentation": "For custom endpoint with fips disabled and dualstack disabled", + "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", "expect": { "endpoint": { "url": "https://example.com" } }, "params": { - "UseFIPS": false, "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "UseFIPS": false, "UseDualStack": false, "Endpoint": "https://example.com" } @@ -1776,8 +636,8 @@ "error": "Invalid Configuration: FIPS and custom endpoint are not supported" }, "params": { - "UseFIPS": true, "Region": "us-east-1", + "UseFIPS": true, "UseDualStack": false, "Endpoint": "https://example.com" } @@ -1788,11 +648,17 @@ "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" }, "params": { - "UseFIPS": false, "Region": "us-east-1", + "UseFIPS": false, "UseDualStack": true, "Endpoint": "https://example.com" } + }, + { + "documentation": "Missing region", + "expect": { + "error": "Invalid Configuration: Missing Region" + } } ], "version": "1.0" diff --git a/models/apis/acm/2015-12-08/smoke-2.json b/models/apis/acm/2015-12-08/smoke-2.json new file mode 100644 index 00000000000..7fcfac29be4 --- /dev/null +++ b/models/apis/acm/2015-12-08/smoke-2.json @@ -0,0 +1,29 @@ +{ + "version": 2, + "testCases": [ + { + "id": "ListCertificatesSuccess", + "operationName": "ListCertificates", + "input": {}, + "expectation": { + "success": {} + }, + "config": { + "region": "us-west-2" + } + }, + { + "id": "GetCertificateFailure", + "operationName": "GetCertificate", + "input": { + "CertificateArn": "arn:aws:acm:region:123456789012:certificate\/12345678-1234-1234-1234-123456789012" + }, + "expectation": { + "failure": {} + }, + "config": { + "region": "us-west-2" + } + } + ] +} diff --git a/models/apis/bedrock-agent/2023-06-05/api-2.json b/models/apis/bedrock-agent/2023-06-05/api-2.json index 2a2de7c8243..ea46d63c1f1 100644 --- a/models/apis/bedrock-agent/2023-06-05/api-2.json +++ b/models/apis/bedrock-agent/2023-06-05/api-2.json @@ -1156,6 +1156,12 @@ "min":20, "pattern":"^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$" }, + "BedrockEmbeddingModelConfiguration":{ + "type":"structure", + "members":{ + "dimensions":{"shape":"Dimensions"} + } + }, "Boolean":{ "type":"boolean", "box":true @@ -1638,6 +1644,12 @@ "max":200, "min":1 }, + "Dimensions":{ + "type":"integer", + "box":true, + "max":4096, + "min":0 + }, "DisassociateAgentKnowledgeBaseRequest":{ "type":"structure", "required":[ @@ -1674,6 +1686,12 @@ "min":5, "pattern":"^DRAFT$" }, + "EmbeddingModelConfiguration":{ + "type":"structure", + "members":{ + "bedrockEmbeddingModelConfiguration":{"shape":"BedrockEmbeddingModelConfiguration"} + } + }, "FailureReason":{ "type":"string", "max":2048, @@ -3288,7 +3306,8 @@ "type":"structure", "required":["embeddingModelArn"], "members":{ - "embeddingModelArn":{"shape":"BedrockEmbeddingModelArn"} + "embeddingModelArn":{"shape":"BedrockEmbeddingModelArn"}, + "embeddingModelConfiguration":{"shape":"EmbeddingModelConfiguration"} } }, "Version":{ diff --git a/models/apis/bedrock-agent/2023-06-05/docs-2.json b/models/apis/bedrock-agent/2023-06-05/docs-2.json index 3db0377b575..615a1855e49 100644 --- a/models/apis/bedrock-agent/2023-06-05/docs-2.json +++ b/models/apis/bedrock-agent/2023-06-05/docs-2.json @@ -283,6 +283,12 @@ "VectorKnowledgeBaseConfiguration$embeddingModelArn": "

The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.

" } }, + "BedrockEmbeddingModelConfiguration": { + "base": "

The vector configuration details for the Bedrock embeddings model.

", + "refs": { + "EmbeddingModelConfiguration$bedrockEmbeddingModelConfiguration": "

The vector configuration details on the Bedrock embeddings model.

" + } + }, "Boolean": { "base": null, "refs": { @@ -581,6 +587,12 @@ "UpdateKnowledgeBaseRequest$description": "

Specifies a new description for the knowledge base.

" } }, + "Dimensions": { + "base": null, + "refs": { + "BedrockEmbeddingModelConfiguration$dimensions": "

The dimensions details for the vector configuration used on the Bedrock embeddings model.

" + } + }, "DisassociateAgentKnowledgeBaseRequest": { "base": null, "refs": { @@ -603,6 +615,12 @@ "UpdateAgentKnowledgeBaseRequest$agentVersion": "

The version of the agent associated with the knowledge base that you want to update.

" } }, + "EmbeddingModelConfiguration": { + "base": "

The configuration details for the embeddings model.

", + "refs": { + "VectorKnowledgeBaseConfiguration$embeddingModelConfiguration": "

The embeddings model configuration details for the vector model used in Knowledge Base.

" + } + }, "FailureReason": { "base": null, "refs": { diff --git a/models/apis/bedrock-runtime/2023-09-30/api-2.json b/models/apis/bedrock-runtime/2023-09-30/api-2.json index 4589f21dd8c..0db3bc4c9e5 100644 --- a/models/apis/bedrock-runtime/2023-09-30/api-2.json +++ b/models/apis/bedrock-runtime/2023-09-30/api-2.json @@ -1,353 +1,1198 @@ { - "version":"2.0", - "metadata":{ - "apiVersion":"2023-09-30", - "endpointPrefix":"bedrock-runtime", - "jsonVersion":"1.1", - "protocol":"rest-json", - "serviceFullName":"Amazon Bedrock Runtime", - "serviceId":"Bedrock Runtime", - "signatureVersion":"v4", - "signingName":"bedrock", - "uid":"bedrock-runtime-2023-09-30" + "metadata": { + "apiVersion": "2023-09-30", + "endpointPrefix": "bedrock-runtime", + "jsonVersion": "1.1", + "protocol": "rest-json", + "serviceFullName": "Amazon Bedrock Runtime", + "serviceId": "Bedrock Runtime", + "signatureVersion": "v4", + "signingName": "bedrock", + "uid": "bedrock-runtime-2023-09-30" }, - "operations":{ - "InvokeModel":{ - "name":"InvokeModel", - "http":{ - "method":"POST", - "requestUri":"/model/{modelId}/invoke", - "responseCode":200 - }, - "input":{"shape":"InvokeModelRequest"}, - "output":{"shape":"InvokeModelResponse"}, - "errors":[ - {"shape":"AccessDeniedException"}, - {"shape":"ResourceNotFoundException"}, - {"shape":"ThrottlingException"}, - {"shape":"ModelTimeoutException"}, - {"shape":"InternalServerException"}, - {"shape":"ValidationException"}, - {"shape":"ModelNotReadyException"}, - {"shape":"ServiceQuotaExceededException"}, - {"shape":"ModelErrorException"} - ] - }, - "InvokeModelWithResponseStream":{ - "name":"InvokeModelWithResponseStream", - "http":{ - "method":"POST", - "requestUri":"/model/{modelId}/invoke-with-response-stream", - "responseCode":200 - }, - "input":{"shape":"InvokeModelWithResponseStreamRequest"}, - "output":{"shape":"InvokeModelWithResponseStreamResponse"}, - "errors":[ - {"shape":"AccessDeniedException"}, - {"shape":"ResourceNotFoundException"}, - {"shape":"ThrottlingException"}, - {"shape":"ModelTimeoutException"}, - {"shape":"InternalServerException"}, - {"shape":"ModelStreamErrorException"}, - {"shape":"ValidationException"}, - {"shape":"ModelNotReadyException"}, - {"shape":"ServiceQuotaExceededException"}, - {"shape":"ModelErrorException"} - ] + "operations": { + "Converse": { + "errors": [ + { + "shape": "AccessDeniedException" + }, + { + "shape": "ResourceNotFoundException" + }, + { + "shape": "ThrottlingException" + }, + { + "shape": "ModelTimeoutException" + }, + { + "shape": "InternalServerException" + }, + { + "shape": "ValidationException" + }, + { + "shape": "ModelNotReadyException" + }, + { + "shape": "ModelErrorException" + } + ], + "http": { + "method": "POST", + "requestUri": "/model/{modelId}/converse", + "responseCode": 200 + }, + "input": { + "shape": "ConverseRequest" + }, + "name": "Converse", + "output": { + "shape": "ConverseResponse" + } + }, + "ConverseStream": { + "errors": [ + { + "shape": "AccessDeniedException" + }, + { + "shape": "ResourceNotFoundException" + }, + { + "shape": "ThrottlingException" + }, + { + "shape": "ModelTimeoutException" + }, + { + "shape": "InternalServerException" + }, + { + "shape": "ValidationException" + }, + { + "shape": "ModelNotReadyException" + }, + { + "shape": "ModelErrorException" + } + ], + "http": { + "method": "POST", + "requestUri": "/model/{modelId}/converse-stream", + "responseCode": 200 + }, + "input": { + "shape": "ConverseStreamRequest" + }, + "name": "ConverseStream", + "output": { + "shape": "ConverseStreamResponse" + } + }, + "InvokeModel": { + "errors": [ + { + "shape": "AccessDeniedException" + }, + { + "shape": "ResourceNotFoundException" + }, + { + "shape": "ThrottlingException" + }, + { + "shape": "ModelTimeoutException" + }, + { + "shape": "InternalServerException" + }, + { + "shape": "ValidationException" + }, + { + "shape": "ModelNotReadyException" + }, + { + "shape": "ServiceQuotaExceededException" + }, + { + "shape": "ModelErrorException" + } + ], + "http": { + "method": "POST", + "requestUri": "/model/{modelId}/invoke", + "responseCode": 200 + }, + "input": { + "shape": "InvokeModelRequest" + }, + "name": "InvokeModel", + "output": { + "shape": "InvokeModelResponse" + } + }, + "InvokeModelWithResponseStream": { + "errors": [ + { + "shape": "AccessDeniedException" + }, + { + "shape": "ResourceNotFoundException" + }, + { + "shape": "ThrottlingException" + }, + { + "shape": "ModelTimeoutException" + }, + { + "shape": "InternalServerException" + }, + { + "shape": "ModelStreamErrorException" + }, + { + "shape": "ValidationException" + }, + { + "shape": "ModelNotReadyException" + }, + { + "shape": "ServiceQuotaExceededException" + }, + { + "shape": "ModelErrorException" + } + ], + "http": { + "method": "POST", + "requestUri": "/model/{modelId}/invoke-with-response-stream", + "responseCode": 200 + }, + "input": { + "shape": "InvokeModelWithResponseStreamRequest" + }, + "name": "InvokeModelWithResponseStream", + "output": { + "shape": "InvokeModelWithResponseStreamResponse" + } } }, - "shapes":{ - "AccessDeniedException":{ - "type":"structure", - "members":{ - "message":{"shape":"NonBlankString"} - }, - "error":{ - "httpStatusCode":403, - "senderFault":true - }, - "exception":true - }, - "Body":{ - "type":"blob", - "max":25000000, - "min":0, - "sensitive":true - }, - "GuardrailIdentifier":{ - "type":"string", - "max":2048, - "min":0, - "pattern":"(([a-z0-9]+)|(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail/[a-z0-9]+))" - }, - "GuardrailVersion":{ - "type":"string", - "pattern":"(([1-9][0-9]{0,7})|(DRAFT))" - }, - "InternalServerException":{ - "type":"structure", - "members":{ - "message":{"shape":"NonBlankString"} - }, - "error":{"httpStatusCode":500}, - "exception":true, - "fault":true - }, - "InvokeModelIdentifier":{ - "type":"string", - "max":2048, - "min":1, - "pattern":"(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)" - }, - "InvokeModelRequest":{ - "type":"structure", - "required":[ - "body", - "modelId" + "shapes": { + "AccessDeniedException": { + "error": { + "httpStatusCode": 403, + "senderFault": true + }, + "exception": true, + "members": { + "message": { + "shape": "NonBlankString" + } + }, + "type": "structure" + }, + "AnyToolChoice": { + "members": {}, + "type": "structure" + }, + "AutoToolChoice": { + "members": {}, + "type": "structure" + }, + "Body": { + "max": 25000000, + "min": 0, + "sensitive": true, + "type": "blob" + }, + "ContentBlock": { + "members": { + "image": { + "shape": "ImageBlock" + }, + "text": { + "shape": "String" + }, + "toolResult": { + "shape": "ToolResultBlock" + } + }, + "type": "structure", + "union": true + }, + "ContentBlockDelta": { + "members": { + "text": { + "shape": "String" + }, + "toolUse": { + "shape": "ToolUseBlockDelta" + } + }, + "type": "structure", + "union": true + }, + "ContentBlockDeltaEvent": { + "event": true, + "members": { + "contentBlockIndex": { + "shape": "NonNegativeInteger" + }, + "delta": { + "shape": "ContentBlockDelta" + } + }, + "required": [ + "delta", + "contentBlockIndex" + ], + "type": "structure" + }, + "ContentBlockStart": { + "members": { + "toolUse": { + "shape": "ToolUseBlockStart" + } + }, + "type": "structure", + "union": true + }, + "ContentBlockStartEvent": { + "event": true, + "members": { + "contentBlockIndex": { + "shape": "NonNegativeInteger" + }, + "start": { + "shape": "ContentBlockStart" + } + }, + "required": [ + "start", + "contentBlockIndex" + ], + "type": "structure" + }, + "ContentBlockStopEvent": { + "event": true, + "members": { + "contentBlockIndex": { + "shape": "NonNegativeInteger" + } + }, + "required": [ + "contentBlockIndex" + ], + "type": "structure" + }, + "ContentBlocks": { + "member": { + "shape": "ContentBlock" + }, + "type": "list" + }, + "ConversationRole": { + "enum": [ + "user", + "assistant" + ], + "type": "string" + }, + "ConversationalModelId": { + "max": 2048, + "min": 1, + "pattern": "(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)", + "type": "string" + }, + "ConverseMetrics": { + "members": { + "latencyMs": { + "shape": "Long" + } + }, + "required": [ + "latencyMs" ], - "members":{ - "body":{"shape":"Body"}, - "contentType":{ - "shape":"MimeType", - "location":"header", - "locationName":"Content-Type" + "type": "structure" + }, + "ConverseOutput": { + "members": { + "message": { + "shape": "Message" + } + }, + "type": "structure", + "union": true + }, + "ConverseRequest": { + "members": { + "additionalModelResponseFieldPaths": { + "shape": "ConverseRequestAdditionalModelResponseFieldPathsList" }, - "accept":{ - "shape":"MimeType", - "location":"header", - "locationName":"Accept" + "inferenceConfig": { + "shape": "InferenceConfiguration" }, - "modelId":{ - "shape":"InvokeModelIdentifier", - "location":"uri", - "locationName":"modelId" + "messages": { + "shape": "Messages" }, - "trace":{ - "shape":"Trace", - "location":"header", - "locationName":"X-Amzn-Bedrock-Trace" + "modelId": { + "location": "uri", + "locationName": "modelId", + "shape": "ConversationalModelId" }, - "guardrailIdentifier":{ - "shape":"GuardrailIdentifier", - "location":"header", - "locationName":"X-Amzn-Bedrock-GuardrailIdentifier" + "system": { + "shape": "SystemContentBlocks" }, - "guardrailVersion":{ - "shape":"GuardrailVersion", - "location":"header", - "locationName":"X-Amzn-Bedrock-GuardrailVersion" + "toolConfig": { + "shape": "ToolConfiguration" } }, - "payload":"body" + "required": [ + "modelId", + "messages" + ], + "type": "structure" + }, + "ConverseRequestAdditionalModelResponseFieldPathsList": { + "max": 10, + "member": { + "shape": "ConverseRequestAdditionalModelResponseFieldPathsListMemberString" + }, + "min": 0, + "type": "list" }, - "InvokeModelResponse":{ - "type":"structure", - "required":[ - "body", - "contentType" + "ConverseRequestAdditionalModelResponseFieldPathsListMemberString": { + "max": 256, + "min": 1, + "type": "string" + }, + "ConverseResponse": { + "members": { + "metrics": { + "shape": "ConverseMetrics" + }, + "output": { + "shape": "ConverseOutput" + }, + "stopReason": { + "shape": "StopReason" + }, + "usage": { + "shape": "TokenUsage" + } + }, + "required": [ + "output", + "stopReason", + "usage", + "metrics" + ], + "type": "structure" + }, + "ConverseStreamMetadataEvent": { + "event": true, + "members": { + "metrics": { + "shape": "ConverseStreamMetrics" + }, + "usage": { + "shape": "TokenUsage" + } + }, + "required": [ + "usage", + "metrics" ], - "members":{ - "body":{"shape":"Body"}, - "contentType":{ - "shape":"MimeType", - "location":"header", - "locationName":"Content-Type" + "type": "structure" + }, + "ConverseStreamMetrics": { + "members": { + "latencyMs": { + "shape": "Long" } }, - "payload":"body" + "required": [ + "latencyMs" + ], + "type": "structure" }, - "InvokeModelWithResponseStreamRequest":{ - "type":"structure", - "required":[ + "ConverseStreamOutput": { + "eventstream": true, + "members": { + "contentBlockDelta": { + "shape": "ContentBlockDeltaEvent" + }, + "contentBlockStart": { + "shape": "ContentBlockStartEvent" + }, + "contentBlockStop": { + "shape": "ContentBlockStopEvent" + }, + "internalServerException": { + "shape": "InternalServerException" + }, + "messageStart": { + "shape": "MessageStartEvent" + }, + "messageStop": { + "shape": "MessageStopEvent" + }, + "metadata": { + "shape": "ConverseStreamMetadataEvent" + }, + "modelStreamErrorException": { + "shape": "ModelStreamErrorException" + }, + "throttlingException": { + "shape": "ThrottlingException" + }, + "validationException": { + "shape": "ValidationException" + } + }, + "type": "structure" + }, + "ConverseStreamRequest": { + "members": { + "additionalModelResponseFieldPaths": { + "shape": "ConverseStreamRequestAdditionalModelResponseFieldPathsList" + }, + "inferenceConfig": { + "shape": "InferenceConfiguration" + }, + "messages": { + "shape": "Messages" + }, + "modelId": { + "location": "uri", + "locationName": "modelId", + "shape": "ConversationalModelId" + }, + "system": { + "shape": "SystemContentBlocks" + }, + "toolConfig": { + "shape": "ToolConfiguration" + } + }, + "required": [ + "modelId", + "messages" + ], + "type": "structure" + }, + "ConverseStreamRequestAdditionalModelResponseFieldPathsList": { + "max": 10, + "member": { + "shape": "ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString" + }, + "min": 0, + "type": "list" + }, + "ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString": { + "max": 256, + "min": 1, + "type": "string" + }, + "ConverseStreamResponse": { + "members": { + "stream": { + "shape": "ConverseStreamOutput" + } + }, + "payload": "stream", + "type": "structure" + }, + "GuardrailIdentifier": { + "max": 2048, + "min": 0, + "pattern": "(([a-z0-9]+)|(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail/[a-z0-9]+))", + "type": "string" + }, + "GuardrailVersion": { + "pattern": "(([1-9][0-9]{0,7})|(DRAFT))", + "type": "string" + }, + "ImageBlock": { + "members": { + "format": { + "shape": "ImageFormat" + }, + "source": { + "shape": "ImageSource" + } + }, + "required": [ + "format", + "source" + ], + "type": "structure" + }, + "ImageFormat": { + "enum": [ + "png", + "jpeg", + "gif", + "webp" + ], + "type": "string" + }, + "ImageSource": { + "members": { + "bytes": { + "shape": "ImageSourceBytesBlob" + } + }, + "type": "structure", + "union": true + }, + "ImageSourceBytesBlob": { + "min": 1, + "type": "blob" + }, + "InferenceConfiguration": { + "members": { + "maxTokens": { + "shape": "InferenceConfigurationMaxTokensInteger" + }, + "stopSequences": { + "shape": "InferenceConfigurationStopSequencesList" + }, + "temperature": { + "shape": "InferenceConfigurationTemperatureFloat" + }, + "topP": { + "shape": "InferenceConfigurationTopPFloat" + } + }, + "type": "structure" + }, + "InferenceConfigurationMaxTokensInteger": { + "box": true, + "min": 1, + "type": "integer" + }, + "InferenceConfigurationStopSequencesList": { + "max": 4, + "member": { + "shape": "NonEmptyString" + }, + "min": 0, + "type": "list" + }, + "InferenceConfigurationTemperatureFloat": { + "box": true, + "max": 1, + "min": 0, + "type": "float" + }, + "InferenceConfigurationTopPFloat": { + "box": true, + "max": 1, + "min": 0, + "type": "float" + }, + "InternalServerException": { + "error": { + "httpStatusCode": 500 + }, + "exception": true, + "fault": true, + "members": { + "message": { + "shape": "NonBlankString" + } + }, + "type": "structure" + }, + "InvokeModelIdentifier": { + "max": 2048, + "min": 1, + "pattern": "(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)", + "type": "string" + }, + "InvokeModelRequest": { + "members": { + "accept": { + "location": "header", + "locationName": "Accept", + "shape": "MimeType" + }, + "body": { + "shape": "Body" + }, + "contentType": { + "location": "header", + "locationName": "Content-Type", + "shape": "MimeType" + }, + "guardrailIdentifier": { + "location": "header", + "locationName": "X-Amzn-Bedrock-GuardrailIdentifier", + "shape": "GuardrailIdentifier" + }, + "guardrailVersion": { + "location": "header", + "locationName": "X-Amzn-Bedrock-GuardrailVersion", + "shape": "GuardrailVersion" + }, + "modelId": { + "location": "uri", + "locationName": "modelId", + "shape": "InvokeModelIdentifier" + }, + "trace": { + "location": "header", + "locationName": "X-Amzn-Bedrock-Trace", + "shape": "Trace" + } + }, + "payload": "body", + "required": [ "body", "modelId" ], - "members":{ - "body":{"shape":"Body"}, - "contentType":{ - "shape":"MimeType", - "location":"header", - "locationName":"Content-Type" + "type": "structure" + }, + "InvokeModelResponse": { + "members": { + "body": { + "shape": "Body" }, - "accept":{ - "shape":"MimeType", - "location":"header", - "locationName":"X-Amzn-Bedrock-Accept" + "contentType": { + "location": "header", + "locationName": "Content-Type", + "shape": "MimeType" + } + }, + "payload": "body", + "required": [ + "body", + "contentType" + ], + "type": "structure" + }, + "InvokeModelWithResponseStreamRequest": { + "members": { + "accept": { + "location": "header", + "locationName": "X-Amzn-Bedrock-Accept", + "shape": "MimeType" + }, + "body": { + "shape": "Body" }, - "modelId":{ - "shape":"InvokeModelIdentifier", - "location":"uri", - "locationName":"modelId" + "contentType": { + "location": "header", + "locationName": "Content-Type", + "shape": "MimeType" }, - "trace":{ - "shape":"Trace", - "location":"header", - "locationName":"X-Amzn-Bedrock-Trace" + "guardrailIdentifier": { + "location": "header", + "locationName": "X-Amzn-Bedrock-GuardrailIdentifier", + "shape": "GuardrailIdentifier" }, - "guardrailIdentifier":{ - "shape":"GuardrailIdentifier", - "location":"header", - "locationName":"X-Amzn-Bedrock-GuardrailIdentifier" + "guardrailVersion": { + "location": "header", + "locationName": "X-Amzn-Bedrock-GuardrailVersion", + "shape": "GuardrailVersion" }, - "guardrailVersion":{ - "shape":"GuardrailVersion", - "location":"header", - "locationName":"X-Amzn-Bedrock-GuardrailVersion" + "modelId": { + "location": "uri", + "locationName": "modelId", + "shape": "InvokeModelIdentifier" + }, + "trace": { + "location": "header", + "locationName": "X-Amzn-Bedrock-Trace", + "shape": "Trace" } }, - "payload":"body" + "payload": "body", + "required": [ + "body", + "modelId" + ], + "type": "structure" }, - "InvokeModelWithResponseStreamResponse":{ - "type":"structure", - "required":[ + "InvokeModelWithResponseStreamResponse": { + "members": { + "body": { + "shape": "ResponseStream" + }, + "contentType": { + "location": "header", + "locationName": "X-Amzn-Bedrock-Content-Type", + "shape": "MimeType" + } + }, + "payload": "body", + "required": [ "body", "contentType" ], - "members":{ - "body":{"shape":"ResponseStream"}, - "contentType":{ - "shape":"MimeType", - "location":"header", - "locationName":"X-Amzn-Bedrock-Content-Type" - } - }, - "payload":"body" + "type": "structure" }, - "MimeType":{"type":"string"}, - "ModelErrorException":{ - "type":"structure", - "members":{ - "message":{"shape":"NonBlankString"}, - "originalStatusCode":{"shape":"StatusCode"}, - "resourceName":{"shape":"NonBlankString"} + "Long": { + "box": true, + "type": "long" + }, + "Message": { + "members": { + "content": { + "shape": "ContentBlocks" + }, + "role": { + "shape": "ConversationRole" + } }, - "error":{ - "httpStatusCode":424, - "senderFault":true + "required": [ + "role", + "content" + ], + "type": "structure" + }, + "MessageStartEvent": { + "event": true, + "members": { + "role": { + "shape": "ConversationRole" + } }, - "exception":true - }, - "ModelNotReadyException":{ - "type":"structure", - "members":{ - "message":{"shape":"NonBlankString"} + "required": [ + "role" + ], + "type": "structure" + }, + "MessageStopEvent": { + "event": true, + "members": { + "stopReason": { + "shape": "StopReason" + } }, - "error":{ - "httpStatusCode":429, - "senderFault":true - }, - "exception":true - }, - "ModelStreamErrorException":{ - "type":"structure", - "members":{ - "message":{"shape":"NonBlankString"}, - "originalStatusCode":{"shape":"StatusCode"}, - "originalMessage":{"shape":"NonBlankString"} - }, - "error":{ - "httpStatusCode":424, - "senderFault":true - }, - "exception":true - }, - "ModelTimeoutException":{ - "type":"structure", - "members":{ - "message":{"shape":"NonBlankString"} - }, - "error":{ - "httpStatusCode":408, - "senderFault":true - }, - "exception":true - }, - "NonBlankString":{ - "type":"string", - "pattern":"[\\s\\S]*" - }, - "PartBody":{ - "type":"blob", - "max":1000000, - "min":0, - "sensitive":true - }, - "PayloadPart":{ - "type":"structure", - "members":{ - "bytes":{"shape":"PartBody"} - }, - "event":true, - "sensitive":true - }, - "ResourceNotFoundException":{ - "type":"structure", - "members":{ - "message":{"shape":"NonBlankString"} - }, - "error":{ - "httpStatusCode":404, - "senderFault":true - }, - "exception":true - }, - "ResponseStream":{ - "type":"structure", - "members":{ - "chunk":{"shape":"PayloadPart"}, - "internalServerException":{"shape":"InternalServerException"}, - "modelStreamErrorException":{"shape":"ModelStreamErrorException"}, - "validationException":{"shape":"ValidationException"}, - "throttlingException":{"shape":"ThrottlingException"}, - "modelTimeoutException":{"shape":"ModelTimeoutException"} - }, - "eventstream":true - }, - "ServiceQuotaExceededException":{ - "type":"structure", - "members":{ - "message":{"shape":"NonBlankString"} + "required": [ + "stopReason" + ], + "type": "structure" + }, + "Messages": { + "member": { + "shape": "Message" + }, + "type": "list" + }, + "MimeType": { + "type": "string" + }, + "ModelErrorException": { + "error": { + "httpStatusCode": 424, + "senderFault": true + }, + "exception": true, + "members": { + "message": { + "shape": "NonBlankString" + }, + "originalStatusCode": { + "shape": "StatusCode" + }, + "resourceName": { + "shape": "NonBlankString" + } + }, + "type": "structure" + }, + "ModelNotReadyException": { + "error": { + "httpStatusCode": 429, + "senderFault": true + }, + "exception": true, + "members": { + "message": { + "shape": "NonBlankString" + } + }, + "type": "structure" + }, + "ModelStreamErrorException": { + "error": { + "httpStatusCode": 424, + "senderFault": true + }, + "exception": true, + "members": { + "message": { + "shape": "NonBlankString" + }, + "originalMessage": { + "shape": "NonBlankString" + }, + "originalStatusCode": { + "shape": "StatusCode" + } + }, + "type": "structure" + }, + "ModelTimeoutException": { + "error": { + "httpStatusCode": 408, + "senderFault": true }, - "error":{ - "httpStatusCode":400, - "senderFault":true - }, - "exception":true - }, - "StatusCode":{ - "type":"integer", - "box":true, - "max":599, - "min":100 + "exception": true, + "members": { + "message": { + "shape": "NonBlankString" + } + }, + "type": "structure" + }, + "NonBlankString": { + "pattern": "[\\s\\S]*", + "type": "string" + }, + "NonEmptyString": { + "min": 1, + "type": "string" + }, + "NonNegativeInteger": { + "box": true, + "min": 0, + "type": "integer" + }, + "PartBody": { + "max": 1000000, + "min": 0, + "sensitive": true, + "type": "blob" + }, + "PayloadPart": { + "event": true, + "members": { + "bytes": { + "shape": "PartBody" + } + }, + "sensitive": true, + "type": "structure" + }, + "ResourceNotFoundException": { + "error": { + "httpStatusCode": 404, + "senderFault": true + }, + "exception": true, + "members": { + "message": { + "shape": "NonBlankString" + } + }, + "type": "structure" }, - "ThrottlingException":{ - "type":"structure", - "members":{ - "message":{"shape":"NonBlankString"} + "ResponseStream": { + "eventstream": true, + "members": { + "chunk": { + "shape": "PayloadPart" + }, + "internalServerException": { + "shape": "InternalServerException" + }, + "modelStreamErrorException": { + "shape": "ModelStreamErrorException" + }, + "modelTimeoutException": { + "shape": "ModelTimeoutException" + }, + "throttlingException": { + "shape": "ThrottlingException" + }, + "validationException": { + "shape": "ValidationException" + } }, - "error":{ - "httpStatusCode":429, - "senderFault":true - }, - "exception":true - }, - "Trace":{ - "type":"string", - "enum":[ + "type": "structure" + }, + "ServiceQuotaExceededException": { + "error": { + "httpStatusCode": 400, + "senderFault": true + }, + "exception": true, + "members": { + "message": { + "shape": "NonBlankString" + } + }, + "type": "structure" + }, + "SpecificToolChoice": { + "members": { + "name": { + "shape": "ToolName" + } + }, + "required": [ + "name" + ], + "type": "structure" + }, + "StatusCode": { + "box": true, + "max": 599, + "min": 100, + "type": "integer" + }, + "StopReason": { + "enum": [ + "end_turn", + "tool_use", + "max_tokens", + "stop_sequence", + "content_filtered" + ], + "type": "string" + }, + "String": { + "type": "string" + }, + "SystemContentBlock": { + "members": { + "text": { + "shape": "NonEmptyString" + } + }, + "type": "structure", + "union": true + }, + "SystemContentBlocks": { + "member": { + "shape": "SystemContentBlock" + }, + "type": "list" + }, + "ThrottlingException": { + "error": { + "httpStatusCode": 429, + "senderFault": true + }, + "exception": true, + "members": { + "message": { + "shape": "NonBlankString" + } + }, + "type": "structure" + }, + "TokenUsage": { + "members": { + "inputTokens": { + "shape": "TokenUsageInputTokensInteger" + }, + "outputTokens": { + "shape": "TokenUsageOutputTokensInteger" + }, + "totalTokens": { + "shape": "TokenUsageTotalTokensInteger" + } + }, + "required": [ + "inputTokens", + "outputTokens", + "totalTokens" + ], + "type": "structure" + }, + "TokenUsageInputTokensInteger": { + "box": true, + "min": 0, + "type": "integer" + }, + "TokenUsageOutputTokensInteger": { + "box": true, + "min": 0, + "type": "integer" + }, + "TokenUsageTotalTokensInteger": { + "box": true, + "min": 0, + "type": "integer" + }, + "Tool": { + "members": { + "toolSpec": { + "shape": "ToolSpecification" + } + }, + "type": "structure", + "union": true + }, + "ToolChoice": { + "members": { + "any": { + "shape": "AnyToolChoice" + }, + "auto": { + "shape": "AutoToolChoice" + }, + "tool": { + "shape": "SpecificToolChoice" + } + }, + "type": "structure", + "union": true + }, + "ToolConfiguration": { + "members": { + "toolChoice": { + "shape": "ToolChoice" + }, + "tools": { + "shape": "ToolConfigurationToolsList" + } + }, + "required": [ + "tools" + ], + "type": "structure" + }, + "ToolConfigurationToolsList": { + "member": { + "shape": "Tool" + }, + "min": 1, + "type": "list" + }, + "ToolInputSchema": { + "members": {}, + "type": "structure", + "union": true + }, + "ToolName": { + "max": 64, + "min": 1, + "pattern": "[a-zA-Z][a-zA-Z0-9_]*", + "type": "string" + }, + "ToolResultBlock": { + "members": { + "content": { + "shape": "ToolResultContentBlocks" + }, + "status": { + "shape": "ToolResultStatus" + }, + "toolUseId": { + "shape": "ToolUseId" + } + }, + "required": [ + "toolUseId", + "content" + ], + "type": "structure" + }, + "ToolResultContentBlock": { + "members": { + "image": { + "shape": "ImageBlock" + }, + "text": { + "shape": "String" + } + }, + "type": "structure", + "union": true + }, + "ToolResultContentBlocks": { + "member": { + "shape": "ToolResultContentBlock" + }, + "type": "list" + }, + "ToolResultStatus": { + "enum": [ + "success", + "error" + ], + "type": "string" + }, + "ToolSpecification": { + "members": { + "description": { + "shape": "NonEmptyString" + }, + "inputSchema": { + "shape": "ToolInputSchema" + }, + "name": { + "shape": "ToolName" + } + }, + "required": [ + "name", + "inputSchema" + ], + "type": "structure" + }, + "ToolUseBlockDelta": { + "members": { + "input": { + "shape": "String" + } + }, + "required": [ + "input" + ], + "type": "structure" + }, + "ToolUseBlockStart": { + "members": { + "name": { + "shape": "ToolName" + }, + "toolUseId": { + "shape": "ToolUseId" + } + }, + "required": [ + "toolUseId", + "name" + ], + "type": "structure" + }, + "ToolUseId": { + "max": 64, + "min": 1, + "pattern": "[a-zA-Z0-9_-]+", + "type": "string" + }, + "Trace": { + "enum": [ "ENABLED", "DISABLED" - ] + ], + "type": "string" }, - "ValidationException":{ - "type":"structure", - "members":{ - "message":{"shape":"NonBlankString"} + "ValidationException": { + "error": { + "httpStatusCode": 400, + "senderFault": true }, - "error":{ - "httpStatusCode":400, - "senderFault":true + "exception": true, + "members": { + "message": { + "shape": "NonBlankString" + } }, - "exception":true + "type": "structure" } - } -} + }, + "version": "2.0" +} \ No newline at end of file diff --git a/models/apis/bedrock-runtime/2023-09-30/docs-2.json b/models/apis/bedrock-runtime/2023-09-30/docs-2.json index 94a359fb856..00387f85cfc 100644 --- a/models/apis/bedrock-runtime/2023-09-30/docs-2.json +++ b/models/apis/bedrock-runtime/2023-09-30/docs-2.json @@ -2,6 +2,8 @@ "version": "2.0", "service": "

Describes the API operations for running inference using Amazon Bedrock models.

", "operations": { + "Converse": "

Sends messages to the specified Amazon Bedrock model. Converse provides a consistent interface that works with all models that support messages. This allows you to write code once and use it with different models. Should a model have unique inference parameters, you can also pass those unique parameters to the model. For more information, see Run inference in the Bedrock User Guide.

This operation requires permission for the bedrock:InvokeModel action.

", + "ConverseStream": "

Sends messages to the specified Amazon Bedrock model and returns the response in a stream. ConverseStream provides a consistent API that works with all Amazon Bedrock models that support messages. This allows you to write code once and use it with different models. Should a model have unique inference parameters, you can also pass those unique parameters to the model. For more information, see Run inference in the Bedrock User Guide.

To find out if a model supports streaming, call GetFoundationModel and check the responseStreamingSupported field in the response.

For example code, see Invoke model with streaming code example in the Amazon Bedrock User Guide.

This operation requires permission for the bedrock:InvokeModelWithResponseStream action.

", "InvokeModel": "

Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. You use model inference to generate text, images, and embeddings.

For example code, see Invoke model code examples in the Amazon Bedrock User Guide.

This operation requires permission for the bedrock:InvokeModel action.

", "InvokeModelWithResponseStream": "

Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream.

To see if a model supports streaming, call GetFoundationModel and check the responseStreamingSupported field in the response.

The CLI doesn't support InvokeModelWithResponseStream.

For example code, see Invoke model with streaming code example in the Amazon Bedrock User Guide.

This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream action.

" }, @@ -11,6 +13,18 @@ "refs": { } }, + "AnyToolChoice": { + "base": "

The model must request at least one tool (no text is generated).

", + "refs": { + "ToolChoice$any": "

The model must request at least one tool (no text is generated).

" + } + }, + "AutoToolChoice": { + "base": "

The Model automatically decides if a tool should be called or to whether to generate text instead.

", + "refs": { + "ToolChoice$auto": "

The Model automatically decides if a tool should be called or to whether to generate text instead.

" + } + }, "Body": { "base": null, "refs": { @@ -19,6 +33,148 @@ "InvokeModelWithResponseStreamRequest$body": "

The prompt and inference parameters in the format specified in the contentType in the header. To see the format and content of the request and response bodies for different models, refer to Inference parameters. For more information, see Run inference in the Bedrock User Guide.

" } }, + "ContentBlock": { + "base": "

A block of content for a message.

", + "refs": { + "ContentBlocks$member": null + } + }, + "ContentBlockDelta": { + "base": "

A bock of content in a streaming response.

", + "refs": { + "ContentBlockDeltaEvent$delta": "

The delta for a content block delta event.

" + } + }, + "ContentBlockDeltaEvent": { + "base": "

The content block delta event.

", + "refs": { + "ConverseStreamOutput$contentBlockDelta": "

The messages output content block delta.

" + } + }, + "ContentBlockStart": { + "base": "

Content block start information.

", + "refs": { + "ContentBlockStartEvent$start": "

Start information about a content block start event.

" + } + }, + "ContentBlockStartEvent": { + "base": "

Content block start event.

", + "refs": { + "ConverseStreamOutput$contentBlockStart": "

Start information for a content block.

" + } + }, + "ContentBlockStopEvent": { + "base": "

A content block stop event.

", + "refs": { + "ConverseStreamOutput$contentBlockStop": "

Stop information for a content block.

" + } + }, + "ContentBlocks": { + "base": null, + "refs": { + "Message$content": "

The message content.

" + } + }, + "ConversationRole": { + "base": null, + "refs": { + "Message$role": "

The role that the message plays in the message.

", + "MessageStartEvent$role": "

The role for the message.

" + } + }, + "ConversationalModelId": { + "base": null, + "refs": { + "ConverseRequest$modelId": "

The identifier for the model that you want to call.

The modelId to provide depends on the type of model that you use:

", + "ConverseStreamRequest$modelId": "

The ID for the model.

The modelId to provide depends on the type of model that you use:

" + } + }, + "ConverseMetrics": { + "base": "

Metrics for a call to Converse.

", + "refs": { + "ConverseResponse$metrics": "

Metrics for the call to Converse.

" + } + }, + "ConverseOutput": { + "base": "

The output from a call to Converse.

", + "refs": { + "ConverseResponse$output": "

The result from the call to Converse.

" + } + }, + "ConverseRequest": { + "base": null, + "refs": { + } + }, + "ConverseRequestAdditionalModelResponseFieldPathsList": { + "base": null, + "refs": { + "ConverseRequest$additionalModelResponseFieldPaths": "

Additional model parameters field paths to return in the response. Converse returns the requested fields as a JSON Pointer object in the additionalModelResultFields field. The following is example JSON for additionalModelResponseFieldPaths.

[ \"/stop_sequence\" ]

For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation.

Converse rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a 400 error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by Converse.

" + } + }, + "ConverseRequestAdditionalModelResponseFieldPathsListMemberString": { + "base": null, + "refs": { + "ConverseRequestAdditionalModelResponseFieldPathsList$member": null + } + }, + "ConverseResponse": { + "base": null, + "refs": { + } + }, + "ConverseStreamMetadataEvent": { + "base": "

A conversation stream metadata event.

", + "refs": { + "ConverseStreamOutput$metadata": "

Metadata for the converse output stream.

" + } + }, + "ConverseStreamMetrics": { + "base": "

Metrics for the stream.

", + "refs": { + "ConverseStreamMetadataEvent$metrics": "

The metrics for the conversation stream metadata event.

" + } + }, + "ConverseStreamOutput": { + "base": "

The messages output stream

", + "refs": { + "ConverseStreamResponse$stream": "

The output stream that the model generated.

" + } + }, + "ConverseStreamRequest": { + "base": null, + "refs": { + } + }, + "ConverseStreamRequestAdditionalModelResponseFieldPathsList": { + "base": null, + "refs": { + "ConverseStreamRequest$additionalModelResponseFieldPaths": "

Additional model parameters field paths to return in the response. ConverseStream returns the requested fields as a JSON Pointer object in the additionalModelResultFields field. The following is example JSON for additionalModelResponseFieldPaths.

[ \"/stop_sequence\" ]

For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation.

ConverseStream rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a 400 error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by ConverseStream.

" + } + }, + "ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString": { + "base": null, + "refs": { + "ConverseStreamRequestAdditionalModelResponseFieldPathsList$member": null + } + }, + "ConverseStreamResponse": { + "base": null, + "refs": { + } + }, + "Document": { + "base": null, + "refs": { + "ConverseRequest$additionalModelRequestFields": "

Additional inference parameters that the model supports, beyond the base set of inference parameters that Converse supports in the inferenceConfig field. For more information, see Model parameters.

", + "ConverseResponse$additionalModelResponseFields": "

Additional fields in the response that are unique to the model.

", + "ConverseStreamRequest$additionalModelRequestFields": "

Additional inference parameters that the model supports, beyond the base set of inference parameters that ConverseStream supports in the inferenceConfig field.

", + "MessageStopEvent$additionalModelResponseFields": "

The additional model response fields.

", + "ToolInputSchema$json": "

The JSON schema for the tool. For more information, see JSON Schema Reference.

", + "ToolResultContentBlock$json": "

A tool result that is JSON format data.

", + "ToolUseBlock$input": "

The input to pass to the tool.

" + } + }, "GuardrailIdentifier": { "base": null, "refs": { @@ -33,9 +189,66 @@ "InvokeModelWithResponseStreamRequest$guardrailVersion": "

The version number for the guardrail. The value can also be DRAFT.

" } }, + "ImageBlock": { + "base": "

Image content for a message.

", + "refs": { + "ContentBlock$image": "

Image to include in the message.

This field is only supported by Anthropic Claude 3 models.

", + "ToolResultContentBlock$image": "

A tool result that is an image.

This field is only supported by Anthropic Claude 3 models.

" + } + }, + "ImageFormat": { + "base": null, + "refs": { + "ImageBlock$format": "

The format of the image.

" + } + }, + "ImageSource": { + "base": "

The source for an image.

", + "refs": { + "ImageBlock$source": "

The source for the image.

" + } + }, + "ImageSourceBytesBlob": { + "base": null, + "refs": { + "ImageSource$bytes": "

The raw image bytes for the image. If you use an AWS SDK, you don't need to base64 encode the image bytes.

" + } + }, + "InferenceConfiguration": { + "base": "

Base inference parameters to pass to a model in a call to Converse or ConverseStream. For more information, see Inference parameters for foundation models.

If you need to pass additional parameters that the model supports, use the additionalModelRequestFields request field in the call to Converse or ConverseStream. For more information, see Model parameters.

", + "refs": { + "ConverseRequest$inferenceConfig": "

Inference parameters to pass to the model. Converse supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the additionalModelRequestFields request field.

", + "ConverseStreamRequest$inferenceConfig": "

Inference parameters to pass to the model. ConverseStream supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the additionalModelRequestFields request field.

" + } + }, + "InferenceConfigurationMaxTokensInteger": { + "base": null, + "refs": { + "InferenceConfiguration$maxTokens": "

The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see Inference parameters for foundatio{ \"messages\": [ { \"role\": \"user\", \"content\": [ { \"text\": \"what's the weather in Queens, NY and Austin, TX?\" } ] }, { \"role\": \"assistant\", \"content\": [ { \"toolUse\": { \"toolUseId\": \"1\", \"name\": \"get_weather\", \"input\": { \"city\": \"Queens\", \"state\": \"NY\" } } }, { \"toolUse\": { \"toolUseId\": \"2\", \"name\": \"get_weather\", \"input\": { \"city\": \"Austin\", \"state\": \"TX\" } } } ] }, { \"role\": \"user\", \"content\": [ { \"toolResult\": { \"toolUseId\": \"2\", \"content\": [ { \"json\": { \"weather\": \"40\" } } ] } }, { \"text\": \"...\" }, { \"toolResult\": { \"toolUseId\": \"1\", \"content\": [ { \"text\": \"result text\" } ] } } ] } ], \"toolConfig\": { \"tools\": [ { \"name\": \"get_weather\", \"description\": \"Get weather\", \"inputSchema\": { \"type\": \"object\", \"properties\": { \"city\": { \"type\": \"string\", \"description\": \"City of location\" }, \"state\": { \"type\": \"string\", \"description\": \"State of location\" } }, \"required\": [\"city\", \"state\"] } } ] } } n models.

" + } + }, + "InferenceConfigurationStopSequencesList": { + "base": null, + "refs": { + "InferenceConfiguration$stopSequences": "

A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response.

" + } + }, + "InferenceConfigurationTemperatureFloat": { + "base": null, + "refs": { + "InferenceConfiguration$temperature": "

The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.

The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models.

" + } + }, + "InferenceConfigurationTopPFloat": { + "base": null, + "refs": { + "InferenceConfiguration$topP": "

The percentage of most-likely candidates that the model considers for the next token. For example, if you choose a value of 0.8 for topP, the model selects from the top 80% of the probability distribution of tokens that could be next in the sequence.

The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models.

" + } + }, "InternalServerException": { "base": "

An internal server error occurred. Retry your request.

", "refs": { + "ConverseStreamOutput$internalServerException": "

An internal server error occurred. Retry your request.

", "ResponseStream$internalServerException": "

An internal server error occurred. Retry your request.

" } }, @@ -66,6 +279,39 @@ "refs": { } }, + "Long": { + "base": null, + "refs": { + "ConverseMetrics$latencyMs": "

The latency of the call to Converse, in milliseconds.

", + "ConverseStreamMetrics$latencyMs": "

The latency for the streaming request, in milliseconds.

" + } + }, + "Message": { + "base": "

A message in the Message field. Use to send a message in a call to Converse.

", + "refs": { + "ConverseOutput$message": "

The message that the model generates.

", + "Messages$member": null + } + }, + "MessageStartEvent": { + "base": "

The start of a message.

", + "refs": { + "ConverseStreamOutput$messageStart": "

Message start information.

" + } + }, + "MessageStopEvent": { + "base": "

The stop event for a message.

", + "refs": { + "ConverseStreamOutput$messageStop": "

Message stop information.

" + } + }, + "Messages": { + "base": null, + "refs": { + "ConverseRequest$messages": "

The messages that you want to send to the model.

", + "ConverseStreamRequest$messages": "

The messages that you want to send to the model.

" + } + }, "MimeType": { "base": null, "refs": { @@ -90,6 +336,7 @@ "ModelStreamErrorException": { "base": "

An error occurred while streaming the response. Retry your request.

", "refs": { + "ConverseStreamOutput$modelStreamErrorException": "

A streaming error occurred. Retry your request.

", "ResponseStream$modelStreamErrorException": "

An error occurred while streaming the response. Retry your request.

" } }, @@ -116,6 +363,22 @@ "ValidationException$message": null } }, + "NonEmptyString": { + "base": null, + "refs": { + "InferenceConfigurationStopSequencesList$member": null, + "SystemContentBlock$text": "

A system prompt for the model.

", + "ToolSpecification$description": "

The description for the tool.

" + } + }, + "NonNegativeInteger": { + "base": null, + "refs": { + "ContentBlockDeltaEvent$contentBlockIndex": "

The block index for a content block delta event.

", + "ContentBlockStartEvent$contentBlockIndex": "

The index for a content block start event.

", + "ContentBlockStopEvent$contentBlockIndex": "

The index for a content block.

" + } + }, "PartBody": { "base": null, "refs": { @@ -144,6 +407,12 @@ "refs": { } }, + "SpecificToolChoice": { + "base": "

The model must request a specific tool.

This field is only supported by Anthropic Claude 3 models.

", + "refs": { + "ToolChoice$tool": "

The Model must request the specified tool.

" + } + }, "StatusCode": { "base": null, "refs": { @@ -151,12 +420,163 @@ "ModelStreamErrorException$originalStatusCode": "

The original status code.

" } }, + "StopReason": { + "base": null, + "refs": { + "ConverseResponse$stopReason": "

The reason why the model stopped generating output.

", + "MessageStopEvent$stopReason": "

The reason why the model stopped generating output.

" + } + }, + "String": { + "base": null, + "refs": { + "ContentBlock$text": "

Text to include in the message.

", + "ContentBlockDelta$text": "

The content text.

", + "ToolResultContentBlock$text": "

A tool result that is text.

", + "ToolUseBlockDelta$input": "

The input for a requested tool.

" + } + }, + "SystemContentBlock": { + "base": "

A system content block

", + "refs": { + "SystemContentBlocks$member": null + } + }, + "SystemContentBlocks": { + "base": null, + "refs": { + "ConverseRequest$system": "

A system prompt to pass to the model.

", + "ConverseStreamRequest$system": "

A system prompt to send to the model.

" + } + }, "ThrottlingException": { "base": "

The number of requests exceeds the limit. Resubmit your request later.

", "refs": { + "ConverseStreamOutput$throttlingException": "

The number of requests exceeds the limit. Resubmit your request later.

", "ResponseStream$throttlingException": "

The number or frequency of requests exceeds the limit. Resubmit your request later.

" } }, + "TokenUsage": { + "base": "

The tokens used in a message API inference call.

", + "refs": { + "ConverseResponse$usage": "

The total number of tokens used in the call to Converse. The total includes the tokens input to the model and the tokens generated by the model.

", + "ConverseStreamMetadataEvent$usage": "

Usage information for the conversation stream event.

" + } + }, + "TokenUsageInputTokensInteger": { + "base": null, + "refs": { + "TokenUsage$inputTokens": "

The number of tokens sent in the request to the model.

" + } + }, + "TokenUsageOutputTokensInteger": { + "base": null, + "refs": { + "TokenUsage$outputTokens": "

The number of tokens that the model generated for the request.

" + } + }, + "TokenUsageTotalTokensInteger": { + "base": null, + "refs": { + "TokenUsage$totalTokens": "

The total of input tokens and tokens generated by the model.

" + } + }, + "Tool": { + "base": "

Information about a tool that you can use with the Converse API.

", + "refs": { + "ToolConfigurationToolsList$member": null + } + }, + "ToolChoice": { + "base": "

Forces a model to use a tool.

", + "refs": { + "ToolConfiguration$toolChoice": "

If supported by model, forces the model to request a tool.

" + } + }, + "ToolConfiguration": { + "base": "

Configuration information for the tools that you pass to a model.

This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.

", + "refs": { + "ConverseRequest$toolConfig": "

Configuration information for the tools that the model can use when generating a response.

This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.

", + "ConverseStreamRequest$toolConfig": "

Configuration information for the tools that the model can use when generating a response.

This field is only supported by Anthropic Claude 3 models.

" + } + }, + "ToolConfigurationToolsList": { + "base": null, + "refs": { + "ToolConfiguration$tools": "

An array of tools that you want to pass to a model.

" + } + }, + "ToolInputSchema": { + "base": "

The schema for the tool. The top level schema type must be object.

", + "refs": { + "ToolSpecification$inputSchema": "

The input schema for the tool in JSON format.

" + } + }, + "ToolName": { + "base": null, + "refs": { + "SpecificToolChoice$name": "

The name of the tool that the model must request.

", + "ToolSpecification$name": "

The name for the tool.

", + "ToolUseBlock$name": "

The name of the tool that the model wants to use.

", + "ToolUseBlockStart$name": "

The name of the tool that the model is requesting to use.

" + } + }, + "ToolResultBlock": { + "base": "

A tool result block that contains the results for a tool request that the model previously made.

", + "refs": { + "ContentBlock$toolResult": "

The result for a tool request that a model makes.

" + } + }, + "ToolResultContentBlock": { + "base": "

The tool result content block.

", + "refs": { + "ToolResultContentBlocks$member": null + } + }, + "ToolResultContentBlocks": { + "base": null, + "refs": { + "ToolResultBlock$content": "

The content for tool result content block.

" + } + }, + "ToolResultStatus": { + "base": null, + "refs": { + "ToolResultBlock$status": "

The status for the tool result content block.

This field is only supported Anthropic Claude 3 models.

" + } + }, + "ToolSpecification": { + "base": "

The specification for the tool.

", + "refs": { + "Tool$toolSpec": "

The specfication for the tool.

" + } + }, + "ToolUseBlock": { + "base": "

A tool use content block. Contains information about a tool that the model is requesting be run., The model uses the result from the tool to generate a response.

", + "refs": { + "ContentBlock$toolUse": "

Information about a tool use request from a model.

" + } + }, + "ToolUseBlockDelta": { + "base": "

The delta for a tool use block.

", + "refs": { + "ContentBlockDelta$toolUse": "

Information about a tool that the model is requesting to use.

" + } + }, + "ToolUseBlockStart": { + "base": "

The start of a tool use block.

", + "refs": { + "ContentBlockStart$toolUse": "

Information about a tool that the model is requesting to use.

" + } + }, + "ToolUseId": { + "base": null, + "refs": { + "ToolResultBlock$toolUseId": "

The ID of the tool request that this is the result for.

", + "ToolUseBlock$toolUseId": "

The ID for the tool request.

", + "ToolUseBlockStart$toolUseId": "

The ID for the tool request.

" + } + }, "Trace": { "base": null, "refs": { @@ -167,6 +587,7 @@ "ValidationException": { "base": "

Input validation failed. Check your request parameters and retry the request.

", "refs": { + "ConverseStreamOutput$validationException": "

Input validation failed. Check your request parameters and retry the request.

", "ResponseStream$validationException": "

Input validation failed. Check your request parameters and retry the request.

" } } diff --git a/models/apis/cloudtrail/2013-11-01/api-2.json b/models/apis/cloudtrail/2013-11-01/api-2.json index 4a0ad3831eb..528ee2d782e 100644 --- a/models/apis/cloudtrail/2013-11-01/api-2.json +++ b/models/apis/cloudtrail/2013-11-01/api-2.json @@ -5,6 +5,7 @@ "endpointPrefix":"cloudtrail", "jsonVersion":"1.1", "protocol":"json", + "protocols":["json"], "serviceAbbreviation":"CloudTrail", "serviceFullName":"AWS CloudTrail", "serviceId":"CloudTrail", @@ -1834,7 +1835,8 @@ "KmsKeyId":{"shape":"EventDataStoreKmsKeyId"}, "BillingMode":{"shape":"BillingMode"}, "FederationStatus":{"shape":"FederationStatus"}, - "FederationRoleArn":{"shape":"FederationRoleArn"} + "FederationRoleArn":{"shape":"FederationRoleArn"}, + "PartitionKeys":{"shape":"PartitionKeyList"} } }, "GetEventSelectorsRequest":{ @@ -2628,6 +2630,34 @@ "min":4, "pattern":".*" }, + "PartitionKey":{ + "type":"structure", + "required":[ + "Name", + "Type" + ], + "members":{ + "Name":{"shape":"PartitionKeyName"}, + "Type":{"shape":"PartitionKeyType"} + } + }, + "PartitionKeyList":{ + "type":"list", + "member":{"shape":"PartitionKey"}, + "max":2 + }, + "PartitionKeyName":{ + "type":"string", + "max":255, + "min":1, + "pattern":"[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*" + }, + "PartitionKeyType":{ + "type":"string", + "max":255, + "min":0, + "pattern":"[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*" + }, "PublicKey":{ "type":"structure", "members":{ diff --git a/models/apis/cloudtrail/2013-11-01/docs-2.json b/models/apis/cloudtrail/2013-11-01/docs-2.json index 1baeac06722..a8227a42b76 100644 --- a/models/apis/cloudtrail/2013-11-01/docs-2.json +++ b/models/apis/cloudtrail/2013-11-01/docs-2.json @@ -35,14 +35,14 @@ "ListTags": "

Lists the tags for the specified trails, event data stores, or channels in the current Region.

", "ListTrails": "

Lists trails that are in the current account.

", "LookupEvents": "

Looks up management events or CloudTrail Insights events that are captured by CloudTrail. You can look up events that occurred in a Region within the last 90 days.

LookupEvents returns recent Insights events for trails that enable Insights. To view Insights events for an event data store, you can run queries on your Insights event data store, and you can also view the Lake dashboard for Insights.

Lookup supports the following attributes for management events:

Lookup supports the following attributes for Insights events:

All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.

The rate of lookup requests is limited to two per second, per account, per Region. If this limit is exceeded, a throttling error occurs.

", - "PutEventSelectors": "

Configures an event selector or advanced event selectors for your trail. Use event selectors or advanced event selectors to specify management and data event settings for your trail. If you want your trail to log Insights events, be sure the event selector enables logging of the Insights event types you want configured for your trail. For more information about logging Insights events, see Logging Insights events for trails in the CloudTrail User Guide. By default, trails created without specific event selectors are configured to log all read and write management events, and no data events.

When an event occurs in your account, CloudTrail evaluates the event selectors or advanced event selectors in all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event.

Example

  1. You create an event selector for a trail and specify that you want write-only events.

  2. The EC2 GetConsoleOutput and RunInstances API operations occur in your account.

  3. CloudTrail evaluates whether the events match your event selectors.

  4. The RunInstances is a write-only event and it matches your event selector. The trail logs the event.

  5. The GetConsoleOutput is a read-only event that doesn't match your event selector. The trail doesn't log the event.

The PutEventSelectors operation must be called from the Region in which the trail was created; otherwise, an InvalidHomeRegionException exception is thrown.

You can configure up to five event selectors for each trail. For more information, see Logging management events, Logging data events, and Quotas in CloudTrail in the CloudTrail User Guide.

You can add advanced event selectors, and conditions for your advanced event selectors, up to a maximum of 500 values for all conditions and selectors on a trail. You can use either AdvancedEventSelectors or EventSelectors, but not both. If you apply AdvancedEventSelectors to a trail, any existing EventSelectors are overwritten. For more information about advanced event selectors, see Logging data events in the CloudTrail User Guide.

", + "PutEventSelectors": "

Configures an event selector or advanced event selectors for your trail. Use event selectors or advanced event selectors to specify management and data event settings for your trail. If you want your trail to log Insights events, be sure the event selector enables logging of the Insights event types you want configured for your trail. For more information about logging Insights events, see Logging Insights events in the CloudTrail User Guide. By default, trails created without specific event selectors are configured to log all read and write management events, and no data events.

When an event occurs in your account, CloudTrail evaluates the event selectors or advanced event selectors in all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event.

Example

  1. You create an event selector for a trail and specify that you want write-only events.

  2. The EC2 GetConsoleOutput and RunInstances API operations occur in your account.

  3. CloudTrail evaluates whether the events match your event selectors.

  4. The RunInstances is a write-only event and it matches your event selector. The trail logs the event.

  5. The GetConsoleOutput is a read-only event that doesn't match your event selector. The trail doesn't log the event.

The PutEventSelectors operation must be called from the Region in which the trail was created; otherwise, an InvalidHomeRegionException exception is thrown.

You can configure up to five event selectors for each trail. For more information, see Logging management events, Logging data events, and Quotas in CloudTrail in the CloudTrail User Guide.

You can add advanced event selectors, and conditions for your advanced event selectors, up to a maximum of 500 values for all conditions and selectors on a trail. You can use either AdvancedEventSelectors or EventSelectors, but not both. If you apply AdvancedEventSelectors to a trail, any existing EventSelectors are overwritten. For more information about advanced event selectors, see Logging data events in the CloudTrail User Guide.

", "PutInsightSelectors": "

Lets you enable Insights event logging by specifying the Insights selectors that you want to enable on an existing trail or event data store. You also use PutInsightSelectors to turn off Insights event logging, by passing an empty list of Insights types. The valid Insights event types are ApiErrorRateInsight and ApiCallRateInsight.

To enable Insights on an event data store, you must specify the ARNs (or ID suffix of the ARNs) for the source event data store (EventDataStore) and the destination event data store (InsightsDestination). The source event data store logs management events and enables Insights. The destination event data store logs Insights events based upon the management event activity of the source event data store. The source and destination event data stores must belong to the same Amazon Web Services account.

To log Insights events for a trail, you must specify the name (TrailName) of the CloudTrail trail for which you want to change or add Insights selectors.

To log CloudTrail Insights events on API call volume, the trail or event data store must log write management events. To log CloudTrail Insights events on API error rate, the trail or event data store must log read or write management events. You can call GetEventSelectors on a trail to check whether the trail logs management events. You can call GetEventDataStore on an event data store to check whether the event data store logs management events.

For more information, see Logging CloudTrail Insights events in the CloudTrail User Guide.

", "PutResourcePolicy": "

Attaches a resource-based permission policy to a CloudTrail channel that is used for an integration with an event source outside of Amazon Web Services. For more information about resource-based policies, see CloudTrail resource-based policy examples in the CloudTrail User Guide.

", "RegisterOrganizationDelegatedAdmin": "

Registers an organization’s member account as the CloudTrail delegated administrator.

", "RemoveTags": "

Removes the specified tags from a trail, event data store, or channel.

", "RestoreEventDataStore": "

Restores a deleted event data store specified by EventDataStore, which accepts an event data store ARN. You can only restore a deleted event data store within the seven-day wait period after deletion. Restoring an event data store can take several minutes, depending on the size of the event data store.

", "StartEventDataStoreIngestion": "

Starts the ingestion of live events on an event data store specified as either an ARN or the ID portion of the ARN. To start ingestion, the event data store Status must be STOPPED_INGESTION and the eventCategory must be Management, Data, or ConfigurationItem.

", - "StartImport": "

Starts an import of logged trail events from a source S3 bucket to a destination event data store. By default, CloudTrail only imports events contained in the S3 bucket's CloudTrail prefix and the prefixes inside the CloudTrail prefix, and does not check prefixes for other Amazon Web Services services. If you want to import CloudTrail events contained in another prefix, you must include the prefix in the S3LocationUri. For more considerations about importing trail events, see Considerations.

When you start a new import, the Destinations and ImportSource parameters are required. Before starting a new import, disable any access control lists (ACLs) attached to the source S3 bucket. For more information about disabling ACLs, see Controlling ownership of objects and disabling ACLs for your bucket.

When you retry an import, the ImportID parameter is required.

If the destination event data store is for an organization, you must use the management account to import trail events. You cannot use the delegated administrator account for the organization.

", + "StartImport": "

Starts an import of logged trail events from a source S3 bucket to a destination event data store. By default, CloudTrail only imports events contained in the S3 bucket's CloudTrail prefix and the prefixes inside the CloudTrail prefix, and does not check prefixes for other Amazon Web Services services. If you want to import CloudTrail events contained in another prefix, you must include the prefix in the S3LocationUri. For more considerations about importing trail events, see Considerations for copying trail events in the CloudTrail User Guide.

When you start a new import, the Destinations and ImportSource parameters are required. Before starting a new import, disable any access control lists (ACLs) attached to the source S3 bucket. For more information about disabling ACLs, see Controlling ownership of objects and disabling ACLs for your bucket.

When you retry an import, the ImportID parameter is required.

If the destination event data store is for an organization, you must use the management account to import trail events. You cannot use the delegated administrator account for the organization.

", "StartLogging": "

Starts the recording of Amazon Web Services API calls and log file delivery for a trail. For a trail that is enabled in all Regions, this operation must be called from the Region in which the trail was created. This operation cannot be called on the shadow trails (replicated trails in other Regions) of a trail that is enabled in all Regions.

", "StartQuery": "

Starts a CloudTrail Lake query. Use the QueryStatement parameter to provide your SQL query, enclosed in single quotation marks. Use the optional DeliveryS3Uri parameter to deliver the query results to an S3 bucket.

StartQuery requires you specify either the QueryStatement parameter, or a QueryAlias and any QueryParameters. In the current release, the QueryAlias and QueryParameters parameters are used only for the queries that populate the CloudTrail Lake dashboards.

", "StopEventDataStoreIngestion": "

Stops the ingestion of live events on an event data store specified as either an ARN or the ID portion of the ARN. To stop ingestion, the event data store Status must be ENABLED and the eventCategory must be Management, Data, or ConfigurationItem.

", @@ -104,7 +104,7 @@ "AdvancedEventSelectors": { "base": null, "refs": { - "CreateEventDataStoreRequest$AdvancedEventSelectors": "

The advanced event selectors to use to select the events for the data store. You can configure up to five advanced event selectors for each event data store.

For more information about how to use advanced event selectors to log CloudTrail events, see Log events by using advanced event selectors in the CloudTrail User Guide.

For more information about how to use advanced event selectors to include Config configuration items in your event data store, see Create an event data store for Config configuration items in the CloudTrail User Guide.

For more information about how to use advanced event selectors to include non-Amazon Web Services events in your event data store, see Create an integration to log events from outside Amazon Web Services in the CloudTrail User Guide.

", + "CreateEventDataStoreRequest$AdvancedEventSelectors": "

The advanced event selectors to use to select the events for the data store. You can configure up to five advanced event selectors for each event data store.

For more information about how to use advanced event selectors to log CloudTrail events, see Log events by using advanced event selectors in the CloudTrail User Guide.

For more information about how to use advanced event selectors to include Config configuration items in your event data store, see Create an event data store for Config configuration items in the CloudTrail User Guide.

For more information about how to use advanced event selectors to include events outside of Amazon Web Services events in your event data store, see Create an integration to log events from outside Amazon Web Services in the CloudTrail User Guide.

", "CreateEventDataStoreResponse$AdvancedEventSelectors": "

The advanced event selectors that were used to select the events for the data store.

", "EventDataStore$AdvancedEventSelectors": "

The advanced event selectors that were used to select events for the data store.

", "GetEventDataStoreResponse$AdvancedEventSelectors": "

The advanced event selectors used to select events for the data store.

", @@ -273,7 +273,7 @@ } }, "CloudTrailAccessNotEnabledException": { - "base": "

This exception is thrown when trusted access has not been enabled between CloudTrail and Organizations. For more information, see Enabling Trusted Access with Other Amazon Web Services Services and Prepare For Creating a Trail For Your Organization.

", + "base": "

This exception is thrown when trusted access has not been enabled between CloudTrail and Organizations. For more information, see How to enable or disable trusted access in the Organizations User Guide and Prepare For Creating a Trail For Your Organization in the CloudTrail User Guide.

", "refs": { } }, @@ -328,7 +328,7 @@ } }, "DataResource": { - "base": "

The Amazon S3 buckets, Lambda functions, or Amazon DynamoDB tables that you specify in your event selectors for your trail to log data events. Data events provide information about the resource operations performed on or within a resource itself. These are also known as data plane operations. You can specify up to 250 data resources for a trail.

The total number of allowed data resources is 250. This number can be distributed between 1 and 5 event selectors, but the total cannot exceed 250 across all selectors for the trail.

If you are using advanced event selectors, the maximum total number of values for all conditions, across all advanced event selectors for the trail, is 500.

The following example demonstrates how logging works when you configure logging of all data events for an S3 bucket named bucket-1. In this example, the CloudTrail user specified an empty prefix, and the option to log both Read and Write data events.

  1. A user uploads an image file to bucket-1.

  2. The PutObject API operation is an Amazon S3 object-level API. It is recorded as a data event in CloudTrail. Because the CloudTrail user specified an S3 bucket with an empty prefix, events that occur on any object in that bucket are logged. The trail processes and logs the event.

  3. A user uploads an object to an Amazon S3 bucket named arn:aws:s3:::bucket-2.

  4. The PutObject API operation occurred for an object in an S3 bucket that the CloudTrail user didn't specify for the trail. The trail doesn’t log the event.

The following example demonstrates how logging works when you configure logging of Lambda data events for a Lambda function named MyLambdaFunction, but not for all Lambda functions.

  1. A user runs a script that includes a call to the MyLambdaFunction function and the MyOtherLambdaFunction function.

  2. The Invoke API operation on MyLambdaFunction is an Lambda API. It is recorded as a data event in CloudTrail. Because the CloudTrail user specified logging data events for MyLambdaFunction, any invocations of that function are logged. The trail processes and logs the event.

  3. The Invoke API operation on MyOtherLambdaFunction is an Lambda API. Because the CloudTrail user did not specify logging data events for all Lambda functions, the Invoke operation for MyOtherLambdaFunction does not match the function specified for the trail. The trail doesn’t log the event.

", + "base": "

Data events provide information about the resource operations performed on or within a resource itself. These are also known as data plane operations. You can specify up to 250 data resources for a trail.

Configure the DataResource to specify the resource type and resource ARNs for which you want to log data events.

You can specify the following resource types in your event selectors for your trail:

The total number of allowed data resources is 250. This number can be distributed between 1 and 5 event selectors, but the total cannot exceed 250 across all selectors for the trail.

If you are using advanced event selectors, the maximum total number of values for all conditions, across all advanced event selectors for the trail, is 500.

The following example demonstrates how logging works when you configure logging of all data events for an S3 bucket named bucket-1. In this example, the CloudTrail user specified an empty prefix, and the option to log both Read and Write data events.

  1. A user uploads an image file to bucket-1.

  2. The PutObject API operation is an Amazon S3 object-level API. It is recorded as a data event in CloudTrail. Because the CloudTrail user specified an S3 bucket with an empty prefix, events that occur on any object in that bucket are logged. The trail processes and logs the event.

  3. A user uploads an object to an Amazon S3 bucket named arn:aws:s3:::bucket-2.

  4. The PutObject API operation occurred for an object in an S3 bucket that the CloudTrail user didn't specify for the trail. The trail doesn’t log the event.

The following example demonstrates how logging works when you configure logging of Lambda data events for a Lambda function named MyLambdaFunction, but not for all Lambda functions.

  1. A user runs a script that includes a call to the MyLambdaFunction function and the MyOtherLambdaFunction function.

  2. The Invoke API operation on MyLambdaFunction is an Lambda API. It is recorded as a data event in CloudTrail. Because the CloudTrail user specified logging data events for MyLambdaFunction, any invocations of that function are logged. The trail processes and logs the event.

  3. The Invoke API operation on MyOtherLambdaFunction is an Lambda API. Because the CloudTrail user did not specify logging data events for all Lambda functions, the Invoke operation for MyOtherLambdaFunction does not match the function specified for the trail. The trail doesn’t log the event.

", "refs": { "DataResources$member": null } @@ -336,7 +336,7 @@ "DataResourceValues": { "base": null, "refs": { - "DataResource$Values": "

An array of Amazon Resource Name (ARN) strings or partial ARN strings for the specified objects.

" + "DataResource$Values": "

An array of Amazon Resource Name (ARN) strings or partial ARN strings for the specified resource type.

" } }, "DataResources": { @@ -563,7 +563,7 @@ } }, "EventDataStore": { - "base": "

A storage lake of event data against which you can run complex SQL-based queries. An event data store can include events that you have logged on your account. To select events for an event data store, use advanced event selectors.

", + "base": "

A storage lake of event data against which you can run complex SQL-based queries. An event data store can include events that you have logged on your account. To select events for an event data store, use advanced event selectors.

", "refs": { "EventDataStores$member": null } @@ -1355,7 +1355,7 @@ } }, "NotOrganizationMasterAccountException": { - "base": "

This exception is thrown when the Amazon Web Services account making the request to create or update an organization trail or event data store is not the management account for an organization in Organizations. For more information, see Prepare For Creating a Trail For Your Organization or Create an event data store.

", + "base": "

This exception is thrown when the Amazon Web Services account making the request to create or update an organization trail or event data store is not the management account for an organization in Organizations. For more information, see Prepare For Creating a Trail For Your Organization or Organization event data stores.

", "refs": { } }, @@ -1408,6 +1408,30 @@ "ListQueriesResponse$NextToken": "

A token you can use to get the next page of results.

" } }, + "PartitionKey": { + "base": "

Contains information about a partition key for an event data store.

", + "refs": { + "PartitionKeyList$member": null + } + }, + "PartitionKeyList": { + "base": null, + "refs": { + "GetEventDataStoreResponse$PartitionKeys": "

The partition keys for the event data store. To improve query performance and efficiency, CloudTrail Lake organizes event data into partitions based on values derived from partition keys.

" + } + }, + "PartitionKeyName": { + "base": null, + "refs": { + "PartitionKey$Name": "

The name of the partition key.

" + } + }, + "PartitionKeyType": { + "base": null, + "refs": { + "PartitionKey$Type": "

The data type of the partition key. For example, bigint or string.

" + } + }, "PublicKey": { "base": "

Contains information about a returned public key.

", "refs": { @@ -1680,7 +1704,7 @@ "SelectorField": { "base": null, "refs": { - "AdvancedFieldSelector$Field": "

A field in a CloudTrail event record on which to filter events to be logged. For event data stores for CloudTrail Insights events, Config configuration items, Audit Manager evidence, or events outside of Amazon Web Services, the field is used only for selecting events as filtering is not supported.

For CloudTrail management events, supported fields include readOnly, eventCategory, and eventSource.

For CloudTrail data events, supported fields include readOnly, eventCategory, eventName, resources.type, and resources.ARN.

For event data stores for CloudTrail Insights events, Config configuration items, Audit Manager evidence, or events outside of Amazon Web Services, the only supported field is eventCategory.

" + "AdvancedFieldSelector$Field": "

A field in a CloudTrail event record on which to filter events to be logged. For event data stores for CloudTrail Insights events, Config configuration items, Audit Manager evidence, or events outside of Amazon Web Services, the field is used only for selecting events as filtering is not supported.

For CloudTrail management events, supported fields include readOnly, eventCategory, and eventSource.

For CloudTrail data events, supported fields include readOnly, eventCategory, eventName, resources.type, and resources.ARN.

For event data stores for CloudTrail Insights events, Config configuration items, Audit Manager evidence, or events outside of Amazon Web Services, the only supported field is eventCategory.

" } }, "SelectorName": { @@ -1779,15 +1803,15 @@ "refs": { "AddTagsRequest$ResourceId": "

Specifies the ARN of the trail, event data store, or channel to which one or more tags will be added.

The format of a trail ARN is: arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail

The format of an event data store ARN is: arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE

The format of a channel ARN is: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890

", "CreateTrailRequest$Name": "

Specifies the name of the trail. The name must meet the following requirements:

", - "CreateTrailRequest$S3BucketName": "

Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements.

", - "CreateTrailRequest$S3KeyPrefix": "

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.

", + "CreateTrailRequest$S3BucketName": "

Specifies the name of the Amazon S3 bucket designated for publishing log files. For information about bucket naming rules, see Bucket naming rules in the Amazon Simple Storage Service User Guide.

", + "CreateTrailRequest$S3KeyPrefix": "

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.

", "CreateTrailRequest$SnsTopicName": "

Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.

", "CreateTrailRequest$CloudWatchLogsLogGroupArn": "

Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. You must use a log group that exists in your account.

Not required unless you specify CloudWatchLogsRoleArn.

", "CreateTrailRequest$CloudWatchLogsRoleArn": "

Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. You must use a role that exists in your account.

", "CreateTrailRequest$KmsKeyId": "

Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be an alias name prefixed by alias/, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.

CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see Using multi-Region keys in the Key Management Service Developer Guide.

Examples:

", "CreateTrailResponse$Name": "

Specifies the name of the trail.

", "CreateTrailResponse$S3BucketName": "

Specifies the name of the Amazon S3 bucket designated for publishing log files.

", - "CreateTrailResponse$S3KeyPrefix": "

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files.

", + "CreateTrailResponse$S3KeyPrefix": "

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files.

", "CreateTrailResponse$SnsTopicName": "

This field is no longer in use. Use SnsTopicARN.

", "CreateTrailResponse$SnsTopicARN": "

Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The format of a topic ARN is:

arn:aws:sns:us-east-2:123456789012:MyTopic

", "CreateTrailResponse$TrailARN": "

Specifies the ARN of the trail that was created. The format of a trail ARN is:

arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail

", @@ -1811,10 +1835,10 @@ "GetInsightSelectorsResponse$TrailARN": "

The Amazon Resource Name (ARN) of a trail for which you want to get Insights selectors.

", "GetTrailRequest$Name": "

The name or the Amazon Resource Name (ARN) of the trail for which you want to retrieve settings information.

", "GetTrailStatusRequest$Name": "

Specifies the name or the CloudTrail ARN of the trail for which you are requesting status. To get the status of a shadow trail (a replication of the trail in another Region), you must specify its ARN. The following is the format of a trail ARN.

arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail

", - "GetTrailStatusResponse$LatestDeliveryError": "

Displays any Amazon S3 error that CloudTrail encountered when attempting to deliver log files to the designated bucket. For more information, see Error Responses in the Amazon S3 API Reference.

This error occurs only when there is a problem with the destination S3 bucket, and does not occur for requests that time out. To resolve the issue, create a new bucket, and then call UpdateTrail to specify the new bucket; or fix the existing objects so that CloudTrail can again write to the bucket.

", + "GetTrailStatusResponse$LatestDeliveryError": "

Displays any Amazon S3 error that CloudTrail encountered when attempting to deliver log files to the designated bucket. For more information, see Error Responses in the Amazon S3 API Reference.

This error occurs only when there is a problem with the destination S3 bucket, and does not occur for requests that time out. To resolve the issue, fix the bucket policy so that CloudTrail can write to the bucket; or create a new bucket and call UpdateTrail to specify the new bucket.

", "GetTrailStatusResponse$LatestNotificationError": "

Displays any Amazon SNS error that CloudTrail encountered when attempting to send a notification. For more information about Amazon SNS errors, see the Amazon SNS Developer Guide.

", "GetTrailStatusResponse$LatestCloudWatchLogsDeliveryError": "

Displays any CloudWatch Logs error that CloudTrail encountered when attempting to deliver logs to CloudWatch Logs.

", - "GetTrailStatusResponse$LatestDigestDeliveryError": "

Displays any Amazon S3 error that CloudTrail encountered when attempting to deliver a digest file to the designated bucket. For more information, see Error Responses in the Amazon S3 API Reference.

This error occurs only when there is a problem with the destination S3 bucket, and does not occur for requests that time out. To resolve the issue, create a new bucket, and then call UpdateTrail to specify the new bucket; or fix the existing objects so that CloudTrail can again write to the bucket.

", + "GetTrailStatusResponse$LatestDigestDeliveryError": "

Displays any Amazon S3 error that CloudTrail encountered when attempting to deliver a digest file to the designated bucket. For more information, see Error Responses in the Amazon S3 API Reference.

This error occurs only when there is a problem with the destination S3 bucket, and does not occur for requests that time out. To resolve the issue, fix the bucket policy so that CloudTrail can write to the bucket; or create a new bucket and call UpdateTrail to specify the new bucket.

", "GetTrailStatusResponse$LatestDeliveryAttemptTime": "

This field is no longer in use.

", "GetTrailStatusResponse$LatestNotificationAttemptTime": "

This field is no longer in use.

", "GetTrailStatusResponse$LatestNotificationAttemptSucceeded": "

This field is no longer in use.

", @@ -1846,8 +1870,8 @@ "StartLoggingRequest$Name": "

Specifies the name or the CloudTrail ARN of the trail for which CloudTrail logs Amazon Web Services API calls. The following is the format of a trail ARN.

arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail

", "StopLoggingRequest$Name": "

Specifies the name or the CloudTrail ARN of the trail for which CloudTrail will stop logging Amazon Web Services API calls. The following is the format of a trail ARN.

arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail

", "Trail$Name": "

Name of the trail set by calling CreateTrail. The maximum length is 128 characters.

", - "Trail$S3BucketName": "

Name of the Amazon S3 bucket into which CloudTrail delivers your trail files. See Amazon S3 Bucket Naming Requirements.

", - "Trail$S3KeyPrefix": "

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.

", + "Trail$S3BucketName": "

Name of the Amazon S3 bucket into which CloudTrail delivers your trail files. See Amazon S3 Bucket naming rules.

", + "Trail$S3KeyPrefix": "

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.

", "Trail$SnsTopicName": "

This field is no longer in use. Use SnsTopicARN.

", "Trail$SnsTopicARN": "

Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The following is the format of a topic ARN.

arn:aws:sns:us-east-2:123456789012:MyTopic

", "Trail$HomeRegion": "

The Region in which the trail was created.

", @@ -1860,15 +1884,15 @@ "TrailInfo$HomeRegion": "

The Amazon Web Services Region in which a trail was created.

", "TrailNameList$member": null, "UpdateTrailRequest$Name": "

Specifies the name of the trail or trail ARN. If Name is a trail name, the string must meet the following requirements:

If Name is a trail ARN, it must be in the following format.

arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail

", - "UpdateTrailRequest$S3BucketName": "

Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements.

", - "UpdateTrailRequest$S3KeyPrefix": "

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.

", + "UpdateTrailRequest$S3BucketName": "

Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket naming rules.

", + "UpdateTrailRequest$S3KeyPrefix": "

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.

", "UpdateTrailRequest$SnsTopicName": "

Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.

", "UpdateTrailRequest$CloudWatchLogsLogGroupArn": "

Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs are delivered. You must use a log group that exists in your account.

Not required unless you specify CloudWatchLogsRoleArn.

", "UpdateTrailRequest$CloudWatchLogsRoleArn": "

Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. You must use a role that exists in your account.

", "UpdateTrailRequest$KmsKeyId": "

Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be an alias name prefixed by \"alias/\", a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.

CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see Using multi-Region keys in the Key Management Service Developer Guide.

Examples:

", "UpdateTrailResponse$Name": "

Specifies the name of the trail.

", "UpdateTrailResponse$S3BucketName": "

Specifies the name of the Amazon S3 bucket designated for publishing log files.

", - "UpdateTrailResponse$S3KeyPrefix": "

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your IAM Log Files.

", + "UpdateTrailResponse$S3KeyPrefix": "

Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your IAM Log Files.

", "UpdateTrailResponse$SnsTopicName": "

This field is no longer in use. Use SnsTopicARN.

", "UpdateTrailResponse$SnsTopicARN": "

Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The following is the format of a topic ARN.

arn:aws:sns:us-east-2:123456789012:MyTopic

", "UpdateTrailResponse$TrailARN": "

Specifies the ARN of the trail that was updated. The following is the format of a trail ARN.

arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail

", diff --git a/models/apis/connect/2017-08-08/api-2.json b/models/apis/connect/2017-08-08/api-2.json index 9ed3db23378..8560e5b71fd 100644 --- a/models/apis/connect/2017-08-08/api-2.json +++ b/models/apis/connect/2017-08-08/api-2.json @@ -4693,6 +4693,10 @@ "UserProficiencies":{"shape":"UserProficiencyList"} } }, + "AssociatedQueueIdList":{ + "type":"list", + "member":{"shape":"QueueId"} + }, "AssociationId":{ "type":"string", "max":100, @@ -13101,7 +13105,8 @@ "AgentAvailabilityTimer":{"shape":"AgentAvailabilityTimer"}, "LastModifiedTime":{"shape":"Timestamp"}, "LastModifiedRegion":{"shape":"RegionName"}, - "IsDefault":{"shape":"Boolean"} + "IsDefault":{"shape":"Boolean"}, + "AssociatedQueueIds":{"shape":"AssociatedQueueIdList"} } }, "RoutingProfileDescription":{ diff --git a/models/apis/connect/2017-08-08/docs-2.json b/models/apis/connect/2017-08-08/docs-2.json index a09260a3bdc..55c2e99473e 100644 --- a/models/apis/connect/2017-08-08/docs-2.json +++ b/models/apis/connect/2017-08-08/docs-2.json @@ -847,6 +847,12 @@ "refs": { } }, + "AssociatedQueueIdList": { + "base": null, + "refs": { + "RoutingProfile$AssociatedQueueIds": "

The IDs of the associated queue.

" + } + }, "AssociationId": { "base": null, "refs": { @@ -6013,6 +6019,7 @@ "base": null, "refs": { "AssociateQueueQuickConnectsRequest$QueueId": "

The identifier for the queue.

", + "AssociatedQueueIdList$member": null, "ContactDataRequest$QueueId": "

The identifier of the queue associated with the Amazon Connect instance in which contacts that are created will be queued.

", "ContactSearchSummaryQueueInfo$Id": "

The unique identifier for the queue.

", "CreateQueueResponse$QueueId": "

The identifier for the queue.

", @@ -7668,7 +7675,7 @@ "PromptSearchCriteria$StringCondition": "

A leaf node condition which can be used to specify a string condition.

The currently supported values for FieldName are name, description, and resourceID.

", "QueueSearchCriteria$StringCondition": "

A leaf node condition which can be used to specify a string condition.

The currently supported values for FieldName are name, description, and resourceID.

", "QuickConnectSearchCriteria$StringCondition": "

A leaf node condition which can be used to specify a string condition.

The currently supported values for FieldName are name, description, and resourceID.

", - "RoutingProfileSearchCriteria$StringCondition": "

A leaf node condition which can be used to specify a string condition.

The currently supported values for FieldName are name, description, and resourceID.

", + "RoutingProfileSearchCriteria$StringCondition": "

A leaf node condition which can be used to specify a string condition.

The currently supported values for FieldName are associatedQueueIds, name, description, and resourceID.

", "SecurityProfileSearchCriteria$StringCondition": null, "UserSearchCriteria$StringCondition": "

A leaf node condition which can be used to specify a string condition.

The currently supported values for FieldName are Username, FirstName, LastName, RoutingProfileId, SecurityProfileId, ResourceId.

" } diff --git a/models/apis/emr-serverless/2021-07-13/api-2.json b/models/apis/emr-serverless/2021-07-13/api-2.json index aaa5b01a247..913446dc73d 100644 --- a/models/apis/emr-serverless/2021-07-13/api-2.json +++ b/models/apis/emr-serverless/2021-07-13/api-2.json @@ -3,8 +3,8 @@ "metadata":{ "apiVersion":"2021-07-13", "endpointPrefix":"emr-serverless", + "jsonVersion":"1.1", "protocol":"rest-json", - "protocols":["rest-json"], "serviceFullName":"EMR Serverless", "serviceId":"EMR Serverless", "signatureVersion":"v4", @@ -120,6 +120,21 @@ {"shape":"InternalServerException"} ] }, + "ListJobRunAttempts":{ + "name":"ListJobRunAttempts", + "http":{ + "method":"GET", + "requestUri":"/applications/{applicationId}/jobruns/{jobRunId}/attempts", + "responseCode":200 + }, + "input":{"shape":"ListJobRunAttemptsRequest"}, + "output":{"shape":"ListJobRunAttemptsResponse"}, + "errors":[ + {"shape":"ValidationException"}, + {"shape":"ResourceNotFoundException"}, + {"shape":"InternalServerException"} + ] + }, "ListJobRuns":{ "name":"ListJobRuns", "http":{ @@ -353,6 +368,11 @@ "X86_64" ] }, + "AttemptNumber":{ + "type":"integer", + "box":true, + "min":1 + }, "AutoStartConfig":{ "type":"structure", "members":{ @@ -615,6 +635,11 @@ "shape":"JobRunId", "location":"uri", "locationName":"jobRunId" + }, + "attempt":{ + "shape":"AttemptNumber", + "location":"querystring", + "locationName":"attempt" } } }, @@ -640,6 +665,11 @@ "shape":"JobRunId", "location":"uri", "locationName":"jobRunId" + }, + "attempt":{ + "shape":"AttemptNumber", + "location":"querystring", + "locationName":"attempt" } } }, @@ -790,15 +820,64 @@ "shape":"Duration", "box":true }, - "billedResourceUtilization":{"shape":"ResourceUtilization"} + "billedResourceUtilization":{"shape":"ResourceUtilization"}, + "mode":{"shape":"JobRunMode"}, + "retryPolicy":{"shape":"RetryPolicy"}, + "attempt":{"shape":"AttemptNumber"}, + "attemptCreatedAt":{"shape":"Date"}, + "attemptUpdatedAt":{"shape":"Date"} + } + }, + "JobRunAttemptSummary":{ + "type":"structure", + "required":[ + "applicationId", + "id", + "arn", + "createdBy", + "jobCreatedAt", + "createdAt", + "updatedAt", + "executionRole", + "state", + "stateDetails", + "releaseLabel" + ], + "members":{ + "applicationId":{"shape":"ApplicationId"}, + "id":{"shape":"JobRunId"}, + "name":{"shape":"String256"}, + "mode":{"shape":"JobRunMode"}, + "arn":{"shape":"JobArn"}, + "createdBy":{"shape":"RequestIdentityUserArn"}, + "jobCreatedAt":{"shape":"Date"}, + "createdAt":{"shape":"Date"}, + "updatedAt":{"shape":"Date"}, + "executionRole":{"shape":"IAMRoleArn"}, + "state":{"shape":"JobRunState"}, + "stateDetails":{"shape":"String256"}, + "releaseLabel":{"shape":"ReleaseLabel"}, + "type":{"shape":"JobRunType"}, + "attempt":{"shape":"AttemptNumber"} } }, + "JobRunAttempts":{ + "type":"list", + "member":{"shape":"JobRunAttemptSummary"} + }, "JobRunId":{ "type":"string", "max":64, "min":1, "pattern":"[0-9a-z]+" }, + "JobRunMode":{ + "type":"string", + "enum":[ + "BATCH", + "STREAMING" + ] + }, "JobRunState":{ "type":"string", "enum":[ @@ -836,6 +915,7 @@ "applicationId":{"shape":"ApplicationId"}, "id":{"shape":"JobRunId"}, "name":{"shape":"String256"}, + "mode":{"shape":"JobRunMode"}, "arn":{"shape":"JobArn"}, "createdBy":{"shape":"RequestIdentityUserArn"}, "createdAt":{"shape":"Date"}, @@ -844,7 +924,10 @@ "state":{"shape":"JobRunState"}, "stateDetails":{"shape":"String256"}, "releaseLabel":{"shape":"ReleaseLabel"}, - "type":{"shape":"JobRunType"} + "type":{"shape":"JobRunType"}, + "attempt":{"shape":"AttemptNumber"}, + "attemptCreatedAt":{"shape":"Date"}, + "attemptUpdatedAt":{"shape":"Date"} } }, "JobRunType":{"type":"string"}, @@ -886,6 +969,49 @@ "nextToken":{"shape":"NextToken"} } }, + "ListJobRunAttemptsRequest":{ + "type":"structure", + "required":[ + "applicationId", + "jobRunId" + ], + "members":{ + "applicationId":{ + "shape":"ApplicationId", + "location":"uri", + "locationName":"applicationId" + }, + "jobRunId":{ + "shape":"JobRunId", + "location":"uri", + "locationName":"jobRunId" + }, + "nextToken":{ + "shape":"NextToken", + "location":"querystring", + "locationName":"nextToken" + }, + "maxResults":{ + "shape":"ListJobRunAttemptsRequestMaxResultsInteger", + "location":"querystring", + "locationName":"maxResults" + } + } + }, + "ListJobRunAttemptsRequestMaxResultsInteger":{ + "type":"integer", + "box":true, + "max":50, + "min":1 + }, + "ListJobRunAttemptsResponse":{ + "type":"structure", + "required":["jobRunAttempts"], + "members":{ + "jobRunAttempts":{"shape":"JobRunAttempts"}, + "nextToken":{"shape":"NextToken"} + } + }, "ListJobRunsRequest":{ "type":"structure", "required":["applicationId"], @@ -919,6 +1045,11 @@ "shape":"JobRunStateSet", "location":"querystring", "locationName":"states" + }, + "mode":{ + "shape":"JobRunMode", + "location":"querystring", + "locationName":"mode" } } }, @@ -1088,6 +1219,18 @@ "storageGBHour":{"shape":"Double"} } }, + "RetryPolicy":{ + "type":"structure", + "members":{ + "maxAttempts":{"shape":"AttemptNumber"}, + "maxFailedAttemptsPerHour":{"shape":"RetryPolicyMaxFailedAttemptsPerHourInteger"} + } + }, + "RetryPolicyMaxFailedAttemptsPerHourInteger":{ + "type":"integer", + "box":true, + "min":1 + }, "S3MonitoringConfiguration":{ "type":"structure", "members":{ @@ -1184,7 +1327,9 @@ "shape":"Duration", "box":true }, - "name":{"shape":"String256"} + "name":{"shape":"String256"}, + "mode":{"shape":"JobRunMode"}, + "retryPolicy":{"shape":"RetryPolicy"} } }, "StartJobRunResponse":{ diff --git a/models/apis/emr-serverless/2021-07-13/docs-2.json b/models/apis/emr-serverless/2021-07-13/docs-2.json index f33828b6f35..96f36acccbe 100644 --- a/models/apis/emr-serverless/2021-07-13/docs-2.json +++ b/models/apis/emr-serverless/2021-07-13/docs-2.json @@ -9,6 +9,7 @@ "GetDashboardForJobRun": "

Creates and returns a URL that you can use to access the application UIs for a job run.

For jobs in a running state, the application UI is a live user interface such as the Spark or Tez web UI. For completed jobs, the application UI is a persistent application user interface such as the Spark History Server or persistent Tez UI.

The URL is valid for one hour after you generate it. To access the application UI after that hour elapses, you must invoke the API again to generate a new URL.

", "GetJobRun": "

Displays detailed information about a job run.

", "ListApplications": "

Lists applications based on a set of parameters.

", + "ListJobRunAttempts": "

Lists all attempt of a job run.

", "ListJobRuns": "

Lists job runs based on a set of parameters.

", "ListTagsForResource": "

Lists the tags assigned to the resources.

", "StartApplication": "

Starts a specified application and initializes initial capacity if configured.

", @@ -47,7 +48,9 @@ "GetDashboardForJobRunRequest$applicationId": "

The ID of the application.

", "GetJobRunRequest$applicationId": "

The ID of the application on which the job run is submitted.

", "JobRun$applicationId": "

The ID of the application the job is running on.

", + "JobRunAttemptSummary$applicationId": "

The ID of the application the job is running on.

", "JobRunSummary$applicationId": "

The ID of the application the job is running on.

", + "ListJobRunAttemptsRequest$applicationId": "

The ID of the application for which to list job runs.

", "ListJobRunsRequest$applicationId": "

The ID of the application for which to list the job run.

", "StartApplicationRequest$applicationId": "

The ID of the application to start.

", "StartJobRunRequest$applicationId": "

The ID of the application on which to run the job.

", @@ -100,6 +103,17 @@ "UpdateApplicationRequest$architecture": "

The CPU architecture of an application.

" } }, + "AttemptNumber": { + "base": null, + "refs": { + "GetDashboardForJobRunRequest$attempt": "

An optimal parameter that indicates the amount of attempts for the job. If not specified, this value defaults to the attempt of the latest job.

", + "GetJobRunRequest$attempt": "

An optimal parameter that indicates the amount of attempts for the job. If not specified, this value defaults to the attempt of the latest job.

", + "JobRun$attempt": "

The attempt of the job run.

", + "JobRunAttemptSummary$attempt": "

The attempt number of the job run execution.

", + "JobRunSummary$attempt": "

The attempt number of the job run execution.

", + "RetryPolicy$maxAttempts": "

Maximum number of attempts for the job run. This parameter is only applicable for BATCH mode.

" + } + }, "AutoStartConfig": { "base": "

The configuration for an application to automatically start on job submission.

", "refs": { @@ -223,8 +237,15 @@ "ApplicationSummary$updatedAt": "

The date and time when the application was last updated.

", "JobRun$createdAt": "

The date and time when the job run was created.

", "JobRun$updatedAt": "

The date and time when the job run was updated.

", + "JobRun$attemptCreatedAt": "

The date and time of when the job run attempt was created.

", + "JobRun$attemptUpdatedAt": "

The date and time of when the job run attempt was last updated.

", + "JobRunAttemptSummary$jobCreatedAt": "

The date and time of when the job run was created.

", + "JobRunAttemptSummary$createdAt": "

The date and time when the job run attempt was created.

", + "JobRunAttemptSummary$updatedAt": "

The date and time of when the job run attempt was last updated.

", "JobRunSummary$createdAt": "

The date and time when the job run was created.

", "JobRunSummary$updatedAt": "

The date and time when the job run was last updated.

", + "JobRunSummary$attemptCreatedAt": "

The date and time of when the job run attempt was created.

", + "JobRunSummary$attemptUpdatedAt": "

The date and time of when the job run attempt was last updated.

", "ListJobRunsRequest$createdAtAfter": "

The lower bound of the option to filter by creation date and time.

", "ListJobRunsRequest$createdAtBefore": "

The upper bound of the option to filter by creation date and time.

" } @@ -350,6 +371,7 @@ "base": null, "refs": { "JobRun$executionRole": "

The execution role ARN of the job run.

", + "JobRunAttemptSummary$executionRole": "

The Amazon Resource Name (ARN) of the execution role of the job run..

", "JobRunSummary$executionRole": "

The execution role ARN of the job run.

", "StartJobRunRequest$executionRoleArn": "

The execution role ARN for the job run.

" } @@ -425,6 +447,7 @@ "base": null, "refs": { "JobRun$arn": "

The execution role ARN of the job run.

", + "JobRunAttemptSummary$arn": "

The Amazon Resource Name (ARN) of the job run.

", "JobRunSummary$arn": "

The ARN of the job run.

", "StartJobRunResponse$arn": "

This output displays the ARN of the job run..

" } @@ -442,6 +465,18 @@ "GetJobRunResponse$jobRun": "

The output displays information about the job run.

" } }, + "JobRunAttemptSummary": { + "base": "

The summary of attributes associated with a job run attempt.

", + "refs": { + "JobRunAttempts$member": null + } + }, + "JobRunAttempts": { + "base": null, + "refs": { + "ListJobRunAttemptsResponse$jobRunAttempts": "

The array of the listed job run attempt objects.

" + } + }, "JobRunId": { "base": null, "refs": { @@ -450,14 +485,27 @@ "GetDashboardForJobRunRequest$jobRunId": "

The ID of the job run.

", "GetJobRunRequest$jobRunId": "

The ID of the job run.

", "JobRun$jobRunId": "

The ID of the job run.

", + "JobRunAttemptSummary$id": "

The ID of the job run attempt.

", "JobRunSummary$id": "

The ID of the job run.

", + "ListJobRunAttemptsRequest$jobRunId": "

The ID of the job run to list.

", "StartJobRunResponse$jobRunId": "

The output contains the ID of the started job run.

" } }, + "JobRunMode": { + "base": null, + "refs": { + "JobRun$mode": "

The mode of the job run.

", + "JobRunAttemptSummary$mode": "

The mode of the job run attempt.

", + "JobRunSummary$mode": "

The mode of the job run.

", + "ListJobRunsRequest$mode": "

The mode of the job runs to list.

", + "StartJobRunRequest$mode": "

The mode of the job run when it starts.

" + } + }, "JobRunState": { "base": null, "refs": { "JobRun$state": "

The state of the job run.

", + "JobRunAttemptSummary$state": "

The state of the job run attempt.

", "JobRunStateSet$member": null, "JobRunSummary$state": "

The state of the job run.

" } @@ -477,6 +525,7 @@ "JobRunType": { "base": null, "refs": { + "JobRunAttemptSummary$type": "

The type of the job run, such as Spark or Hive.

", "JobRunSummary$type": "

The type of job run, such as Spark or Hive.

" } }, @@ -502,6 +551,22 @@ "refs": { } }, + "ListJobRunAttemptsRequest": { + "base": null, + "refs": { + } + }, + "ListJobRunAttemptsRequestMaxResultsInteger": { + "base": null, + "refs": { + "ListJobRunAttemptsRequest$maxResults": "

The maximum number of job run attempts to list.

" + } + }, + "ListJobRunAttemptsResponse": { + "base": null, + "refs": { + } + }, "ListJobRunsRequest": { "base": null, "refs": { @@ -602,6 +667,8 @@ "refs": { "ListApplicationsRequest$nextToken": "

The token for the next set of application results.

", "ListApplicationsResponse$nextToken": "

The output displays the token for the next set of application results. This is required for pagination and is available as a response of the previous request.

", + "ListJobRunAttemptsRequest$nextToken": "

The token for the next set of job run attempt results.

", + "ListJobRunAttemptsResponse$nextToken": "

The output displays the token for the next set of application results. This is required for pagination and is available as a response of the previous request.

", "ListJobRunsRequest$nextToken": "

The token for the next set of job run results.

", "ListJobRunsResponse$nextToken": "

The output displays the token for the next set of job run results. This is required for pagination and is available as a response of the previous request.

" } @@ -631,6 +698,7 @@ "ApplicationSummary$releaseLabel": "

The Amazon EMR release associated with the application.

", "CreateApplicationRequest$releaseLabel": "

The Amazon EMR release associated with the application.

", "JobRun$releaseLabel": "

The Amazon EMR release associated with the application your job is running on.

", + "JobRunAttemptSummary$releaseLabel": "

The Amazon EMR release label of the job run attempt.

", "JobRunSummary$releaseLabel": "

The Amazon EMR release associated with the application your job is running on.

", "UpdateApplicationRequest$releaseLabel": "

The Amazon EMR release label for the application. You can change the release label to use a different release of Amazon EMR.

" } @@ -639,6 +707,7 @@ "base": null, "refs": { "JobRun$createdBy": "

The user who created the job run.

", + "JobRunAttemptSummary$createdBy": "

The user who created the job run.

", "JobRunSummary$createdBy": "

The user who created the job run.

" } }, @@ -661,6 +730,19 @@ "JobRun$billedResourceUtilization": "

The aggregate vCPU, memory, and storage that Amazon Web Services has billed for the job run. The billed resources include a 1-minute minimum usage for workers, plus additional storage over 20 GB per worker. Note that billed resources do not include usage for idle pre-initialized workers.

" } }, + "RetryPolicy": { + "base": "

The retry policy to use for a job run.

", + "refs": { + "JobRun$retryPolicy": "

The retry policy of the job run.

", + "StartJobRunRequest$retryPolicy": "

The retry policy when job run starts.

" + } + }, + "RetryPolicyMaxFailedAttemptsPerHourInteger": { + "base": null, + "refs": { + "RetryPolicy$maxFailedAttemptsPerHour": "

Maximum number of failed attempts per hour. This [arameter is only applicable for STREAMING mode.

" + } + }, "S3MonitoringConfiguration": { "base": "

The Amazon S3 configuration for monitoring log publishing. You can configure your jobs to send log information to Amazon S3.

", "refs": { @@ -750,6 +832,8 @@ "ApplicationSummary$stateDetails": "

The state details of the application.

", "JobRun$name": "

The optional job run name. This doesn't have to be unique.

", "JobRun$stateDetails": "

The state details of the job run.

", + "JobRunAttemptSummary$name": "

The name of the job run attempt.

", + "JobRunAttemptSummary$stateDetails": "

The state details of the job run attempt.

", "JobRunSummary$name": "

The optional job run name. This doesn't have to be unique.

", "JobRunSummary$stateDetails": "

The state details of the job run.

", "StartJobRunRequest$name": "

The optional job run name. This doesn't have to be unique.

" diff --git a/models/apis/emr-serverless/2021-07-13/paginators-1.json b/models/apis/emr-serverless/2021-07-13/paginators-1.json index 7193d8550a8..b049e73ea84 100644 --- a/models/apis/emr-serverless/2021-07-13/paginators-1.json +++ b/models/apis/emr-serverless/2021-07-13/paginators-1.json @@ -6,6 +6,12 @@ "limit_key": "maxResults", "result_key": "applications" }, + "ListJobRunAttempts": { + "input_token": "nextToken", + "output_token": "nextToken", + "limit_key": "maxResults", + "result_key": "jobRunAttempts" + }, "ListJobRuns": { "input_token": "nextToken", "output_token": "nextToken", diff --git a/models/apis/rds/2014-10-31/docs-2.json b/models/apis/rds/2014-10-31/docs-2.json index 02e9b51e8c5..9f2bdd334aa 100644 --- a/models/apis/rds/2014-10-31/docs-2.json +++ b/models/apis/rds/2014-10-31/docs-2.json @@ -5,7 +5,7 @@ "AddRoleToDBCluster": "

Associates an Identity and Access Management (IAM) role with a DB cluster.

", "AddRoleToDBInstance": "

Associates an Amazon Web Services Identity and Access Management (IAM) role with a DB instance.

To add a role to a DB instance, the status of the DB instance must be available.

This command doesn't apply to RDS Custom.

", "AddSourceIdentifierToSubscription": "

Adds a source identifier to an existing RDS event notification subscription.

", - "AddTagsToResource": "

Adds metadata tags to an Amazon RDS resource. These tags can also be used with cost allocation reporting to track cost associated with Amazon RDS resources, or used in a Condition statement in an IAM policy for Amazon RDS.

For an overview on tagging Amazon RDS resources, see Tagging Amazon RDS Resources.

", + "AddTagsToResource": "

Adds metadata tags to an Amazon RDS resource. These tags can also be used with cost allocation reporting to track cost associated with Amazon RDS resources, or used in a Condition statement in an IAM policy for Amazon RDS.

For an overview on tagging your relational database resources, see Tagging Amazon RDS Resources or Tagging Amazon Aurora and Amazon RDS Resources.

", "ApplyPendingMaintenanceAction": "

Applies a pending maintenance action to a resource (for example, to a DB instance).

", "AuthorizeDBSecurityGroupIngress": "

Enables ingress to a DBSecurityGroup using one of two forms of authorization. First, EC2 or VPC security groups can be added to the DBSecurityGroup if the application using the database is running on EC2 or VPC instances. Second, IP ranges are available if the application accessing your database is running on the internet. Required parameters for this API are one of CIDR range, EC2SecurityGroupId for VPC, or (EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId for non-VPC).

You can't authorize ingress from an EC2 security group in one Amazon Web Services Region to an Amazon RDS DB instance in another. You can't authorize ingress from a VPC security group in one VPC to an Amazon RDS DB instance in another.

For an overview of CIDR ranges, go to the Wikipedia Tutorial.

EC2-Classic was retired on August 15, 2022. If you haven't migrated from EC2-Classic to a VPC, we recommend that you migrate as soon as possible. For more information, see Migrate from EC2-Classic to a VPC in the Amazon EC2 User Guide, the blog EC2-Classic Networking is Retiring – Here’s How to Prepare, and Moving a DB instance not in a VPC into a VPC in the Amazon RDS User Guide.

", "BacktrackDBCluster": "

Backtracks a DB cluster to a specific time, without creating a new DB cluster.

For more information on backtracking, see Backtracking an Aurora DB Cluster in the Amazon Aurora User Guide.

This action applies only to Aurora MySQL DB clusters.

", @@ -4678,7 +4678,7 @@ "CreateDBClusterEndpointMessage$DBClusterEndpointIdentifier": "

The identifier to use for the new endpoint. This parameter is stored as a lowercase string.

", "CreateDBClusterEndpointMessage$EndpointType": "

The type of the endpoint, one of: READER, WRITER, ANY.

", "CreateDBClusterMessage$CharacterSetName": "

The name of the character set (CharacterSet) to associate the DB cluster with.

Valid for Cluster Type: Aurora DB clusters only

", - "CreateDBClusterMessage$DatabaseName": "

The name for your database of up to 64 alphanumeric characters. If you don't provide a name, Amazon RDS doesn't create a database in the DB cluster you are creating.

Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters

", + "CreateDBClusterMessage$DatabaseName": "

The name for your database of up to 64 alphanumeric characters. A database named postgres is always created. If this parameter is specified, an additional database with this name is created.

Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters

", "CreateDBClusterMessage$DBClusterIdentifier": "

The identifier for this DB cluster. This parameter is stored as a lowercase string.

Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters

Constraints:

Example: my-cluster1

", "CreateDBClusterMessage$DBClusterParameterGroupName": "

The name of the DB cluster parameter group to associate with this DB cluster. If you don't specify a value, then the default DB cluster parameter group for the specified DB engine and version is used.

Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters

Constraints:

", "CreateDBClusterMessage$DBSubnetGroupName": "

A DB subnet group to associate with this DB cluster.

This setting is required to create a Multi-AZ DB cluster.

Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters

Constraints:

Example: mydbsubnetgroup

", @@ -4710,7 +4710,7 @@ "CreateDBClusterParameterGroupMessage$Description": "

The description for the DB cluster parameter group.

", "CreateDBClusterSnapshotMessage$DBClusterSnapshotIdentifier": "

The identifier of the DB cluster snapshot. This parameter is stored as a lowercase string.

Constraints:

Example: my-cluster1-snapshot1

", "CreateDBClusterSnapshotMessage$DBClusterIdentifier": "

The identifier of the DB cluster to create a snapshot for. This parameter isn't case-sensitive.

Constraints:

Example: my-cluster1

", - "CreateDBInstanceMessage$DBName": "

The meaning of this parameter differs according to the database engine you use.

Amazon Aurora MySQL

The name of the database to create when the primary DB instance of the Aurora MySQL DB cluster is created. If this parameter isn't specified for an Aurora MySQL DB cluster, no database is created in the DB cluster.

Constraints:

Amazon Aurora PostgreSQL

The name of the database to create when the primary DB instance of the Aurora PostgreSQL DB cluster is created. If this parameter isn't specified for an Aurora PostgreSQL DB cluster, a database named postgres is created in the DB cluster.

Constraints:

Amazon RDS Custom for Oracle

The Oracle System ID (SID) of the created RDS Custom DB instance. If you don't specify a value, the default value is ORCL for non-CDBs and RDSCDB for CDBs.

Default: ORCL

Constraints:

Amazon RDS Custom for SQL Server

Not applicable. Must be null.

RDS for Db2

The name of the database to create when the DB instance is created. If this parameter isn't specified, no database is created in the DB instance. In some cases, we recommend that you don't add a database name. For more information, see Additional considerations in the Amazon RDS User Guide.

Constraints:

RDS for MariaDB

The name of the database to create when the DB instance is created. If this parameter isn't specified, no database is created in the DB instance.

Constraints:

RDS for MySQL

The name of the database to create when the DB instance is created. If this parameter isn't specified, no database is created in the DB instance.

Constraints:

RDS for Oracle

The Oracle System ID (SID) of the created DB instance. If you don't specify a value, the default value is ORCL. You can't specify the string null, or any other reserved word, for DBName.

Default: ORCL

Constraints:

RDS for PostgreSQL

The name of the database to create when the DB instance is created. If this parameter isn't specified, a database named postgres is created in the DB instance.

Constraints:

RDS for SQL Server

Not applicable. Must be null.

", + "CreateDBInstanceMessage$DBName": "

The meaning of this parameter differs according to the database engine you use.

Amazon Aurora MySQL

The name of the database to create when the primary DB instance of the Aurora MySQL DB cluster is created. If this parameter isn't specified for an Aurora MySQL DB cluster, no database is created in the DB cluster.

Constraints:

Amazon Aurora PostgreSQL

The name of the database to create when the primary DB instance of the Aurora PostgreSQL DB cluster is created. A database named postgres is always created. If this parameter is specified, an additional database with this name is created.

Constraints:

Amazon RDS Custom for Oracle

The Oracle System ID (SID) of the created RDS Custom DB instance. If you don't specify a value, the default value is ORCL for non-CDBs and RDSCDB for CDBs.

Default: ORCL

Constraints:

Amazon RDS Custom for SQL Server

Not applicable. Must be null.

RDS for Db2

The name of the database to create when the DB instance is created. If this parameter isn't specified, no database is created in the DB instance. In some cases, we recommend that you don't add a database name. For more information, see Additional considerations in the Amazon RDS User Guide.

Constraints:

RDS for MariaDB

The name of the database to create when the DB instance is created. If this parameter isn't specified, no database is created in the DB instance.

Constraints:

RDS for MySQL

The name of the database to create when the DB instance is created. If this parameter isn't specified, no database is created in the DB instance.

Constraints:

RDS for Oracle

The Oracle System ID (SID) of the created DB instance. If you don't specify a value, the default value is ORCL. You can't specify the string null, or any other reserved word, for DBName.

Default: ORCL

Constraints:

RDS for PostgreSQL

The name of the database to create when the DB instance is created. A database named postgres is always created. If this parameter is specified, an additional database with this name is created.

Constraints:

RDS for SQL Server

Not applicable. Must be null.

", "CreateDBInstanceMessage$DBInstanceIdentifier": "

The identifier for this DB instance. This parameter is stored as a lowercase string.

Constraints:

Example: mydbinstance

", "CreateDBInstanceMessage$DBInstanceClass": "

The compute and memory capacity of the DB instance, for example db.m5.large. Not all DB instance classes are available in all Amazon Web Services Regions, or for all database engines. For the full list of DB instance classes, and availability for your engine, see DB instance classes in the Amazon RDS User Guide or Aurora DB instance classes in the Amazon Aurora User Guide.

", "CreateDBInstanceMessage$Engine": "

The database engine to use for this DB instance.

Not every database engine is available in every Amazon Web Services Region.

Valid Values:

", @@ -5620,7 +5620,7 @@ "RestoreDBInstanceFromS3Message$SourceEngineVersion": "

The version of the database that the backup files were created from.

MySQL versions 5.6 and 5.7 are supported.

Example: 5.6.40

", "RestoreDBInstanceFromS3Message$S3BucketName": "

The name of your Amazon S3 bucket that contains your database backup file.

", "RestoreDBInstanceFromS3Message$S3Prefix": "

The prefix of your Amazon S3 bucket.

", - "RestoreDBInstanceFromS3Message$S3IngestionRoleArn": "

An Amazon Web Services Identity and Access Management (IAM) role to allow Amazon RDS to access your Amazon S3 bucket.

", + "RestoreDBInstanceFromS3Message$S3IngestionRoleArn": "

An Amazon Web Services Identity and Access Management (IAM) role with a trust policy and a permissions policy that allows Amazon RDS to access your Amazon S3 bucket. For information about this role, see Creating an IAM role manually in the Amazon RDS User Guide.

", "RestoreDBInstanceFromS3Message$PerformanceInsightsKMSKeyId": "

The Amazon Web Services KMS key identifier for encryption of Performance Insights data.

The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.

If you do not specify a value for PerformanceInsightsKMSKeyId, then Amazon RDS uses your default KMS key. There is a default KMS key for your Amazon Web Services account. Your Amazon Web Services account has a different default KMS key for each Amazon Web Services Region.

", "RestoreDBInstanceFromS3Message$NetworkType": "

The network type of the DB instance.

Valid Values:

The network type is determined by the DBSubnetGroup specified for the DB instance. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the IPv6 protocols (DUAL).

For more information, see Working with a DB instance in a VPC in the Amazon RDS User Guide.

", "RestoreDBInstanceFromS3Message$MasterUserSecretKmsKeyId": "

The Amazon Web Services KMS key identifier to encrypt a secret that is automatically generated and managed in Amazon Web Services Secrets Manager.

This setting is valid only if the master user password is managed by RDS in Amazon Web Services Secrets Manager for the DB instance.

The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. To use a KMS key in a different Amazon Web Services account, specify the key ARN or alias ARN.

If you don't specify MasterUserSecretKmsKeyId, then the aws/secretsmanager KMS key is used to encrypt the secret. If the secret is in a different Amazon Web Services account, then you can't use the aws/secretsmanager KMS key to encrypt the secret, and you must use a customer managed KMS key.

There is a default KMS key for your Amazon Web Services account. Your Amazon Web Services account has a different default KMS key for each Amazon Web Services Region.

", @@ -5939,7 +5939,7 @@ } }, "Tag": { - "base": "

Metadata assigned to an Amazon RDS resource consisting of a key-value pair.

For more information, see Tagging Amazon RDS Resources in the Amazon RDS User Guide.

", + "base": "

Metadata assigned to an Amazon RDS resource consisting of a key-value pair.

For more information, see Tagging Amazon RDS Resources in the Amazon RDS User Guide or Tagging Amazon Aurora and Amazon RDS Resources in the Amazon Aurora User Guide.

", "refs": { "TagList$member": null } diff --git a/models/apis/sagemaker/2017-07-24/api-2.json b/models/apis/sagemaker/2017-07-24/api-2.json index 80ab7a45b45..2eba80bc440 100644 --- a/models/apis/sagemaker/2017-07-24/api-2.json +++ b/models/apis/sagemaker/2017-07-24/api-2.json @@ -4455,7 +4455,13 @@ "randomforest", "extra-trees", "nn-torch", - "fastai" + "fastai", + "cnn-qr", + "deepar", + "prophet", + "npts", + "arima", + "ets" ] }, "AutoMLAlgorithmConfig":{ @@ -7198,7 +7204,9 @@ "DriftCheckBaselines":{"shape":"DriftCheckBaselines"}, "AdditionalInferenceSpecifications":{"shape":"AdditionalInferenceSpecifications"}, "SkipModelValidation":{"shape":"SkipModelValidation"}, - "SourceUri":{"shape":"ModelPackageSourceUri"} + "SourceUri":{"shape":"ModelPackageSourceUri"}, + "SecurityConfig":{"shape":"ModelPackageSecurityConfig"}, + "ModelCard":{"shape":"ModelPackageModelCard"} } }, "CreateModelPackageOutput":{ @@ -9878,7 +9886,9 @@ "DriftCheckBaselines":{"shape":"DriftCheckBaselines"}, "AdditionalInferenceSpecifications":{"shape":"AdditionalInferenceSpecifications"}, "SkipModelValidation":{"shape":"SkipModelValidation"}, - "SourceUri":{"shape":"ModelPackageSourceUri"} + "SourceUri":{"shape":"ModelPackageSourceUri"}, + "SecurityConfig":{"shape":"ModelPackageSecurityConfig"}, + "ModelCard":{"shape":"ModelPackageModelCard"} } }, "DescribeModelQualityJobDefinitionRequest":{ @@ -16576,6 +16586,8 @@ "SamplePayloadUrl":{"shape":"String"}, "AdditionalInferenceSpecifications":{"shape":"AdditionalInferenceSpecifications"}, "SourceUri":{"shape":"ModelPackageSourceUri"}, + "SecurityConfig":{"shape":"ModelPackageSecurityConfig"}, + "ModelCard":{"shape":"ModelPackageModelCard"}, "Tags":{"shape":"TagList"}, "CustomerMetadataProperties":{"shape":"CustomerMetadataMap"}, "DriftCheckBaselines":{"shape":"DriftCheckBaselines"}, @@ -16680,6 +16692,20 @@ "type":"list", "member":{"shape":"ModelPackageGroupSummary"} }, + "ModelPackageModelCard":{ + "type":"structure", + "members":{ + "ModelCardContent":{"shape":"ModelCardContent"}, + "ModelCardStatus":{"shape":"ModelCardStatus"} + } + }, + "ModelPackageSecurityConfig":{ + "type":"structure", + "required":["KmsKeyId"], + "members":{ + "KmsKeyId":{"shape":"KmsKeyId"} + } + }, "ModelPackageSortBy":{ "type":"string", "enum":[ @@ -21410,7 +21436,8 @@ "ForecastQuantiles":{"shape":"ForecastQuantiles"}, "Transformations":{"shape":"TimeSeriesTransformations"}, "TimeSeriesConfig":{"shape":"TimeSeriesConfig"}, - "HolidayConfig":{"shape":"HolidayConfig"} + "HolidayConfig":{"shape":"HolidayConfig"}, + "CandidateGenerationConfig":{"shape":"CandidateGenerationConfig"} } }, "TimeSeriesForecastingSettings":{ @@ -22741,7 +22768,8 @@ "CustomerMetadataPropertiesToRemove":{"shape":"CustomerMetadataKeyList"}, "AdditionalInferenceSpecificationsToAdd":{"shape":"AdditionalInferenceSpecifications"}, "InferenceSpecification":{"shape":"InferenceSpecification"}, - "SourceUri":{"shape":"ModelPackageSourceUri"} + "SourceUri":{"shape":"ModelPackageSourceUri"}, + "ModelCard":{"shape":"ModelPackageModelCard"} } }, "UpdateModelPackageOutput":{ diff --git a/models/apis/sagemaker/2017-07-24/docs-2.json b/models/apis/sagemaker/2017-07-24/docs-2.json index 4f762676cf1..03b34f34361 100644 --- a/models/apis/sagemaker/2017-07-24/docs-2.json +++ b/models/apis/sagemaker/2017-07-24/docs-2.json @@ -152,7 +152,7 @@ "DescribeModelCard": "

Describes the content, creation time, and security configuration of an Amazon SageMaker Model Card.

", "DescribeModelCardExportJob": "

Describes an Amazon SageMaker Model Card export job.

", "DescribeModelExplainabilityJobDefinition": "

Returns a description of a model explainability job definition.

", - "DescribeModelPackage": "

Returns a description of the specified model package, which is used to create SageMaker models or list them on Amazon Web Services Marketplace.

To create models in SageMaker, buyers can subscribe to model packages listed on Amazon Web Services Marketplace.

", + "DescribeModelPackage": "

Returns a description of the specified model package, which is used to create SageMaker models or list them on Amazon Web Services Marketplace.

If you provided a KMS Key ID when you created your model package, you will see the KMS Decrypt API call in your CloudTrail logs when you use this API.

To create models in SageMaker, buyers can subscribe to model packages listed on Amazon Web Services Marketplace.

", "DescribeModelPackageGroup": "

Gets a description for the specified model group.

", "DescribeModelQualityJobDefinition": "

Returns a description of a model quality job definition.

", "DescribeMonitoringSchedule": "

Describes the schedule for a monitoring job.

", @@ -968,7 +968,7 @@ } }, "AutoMLAlgorithmConfig": { - "base": "

The collection of algorithms run on a dataset for training the model candidates of an Autopilot job.

", + "base": "

The selection of algorithms trained on your dataset to generate the model candidates for an Autopilot job.

", "refs": { "AutoMLAlgorithmsConfig$member": null } @@ -976,14 +976,14 @@ "AutoMLAlgorithms": { "base": null, "refs": { - "AutoMLAlgorithmConfig$AutoMLAlgorithms": "

The selection of algorithms run on a dataset to train the model candidates of an Autopilot job.

Selected algorithms must belong to the list corresponding to the training mode set in AutoMLJobConfig.Mode (ENSEMBLING or HYPERPARAMETER_TUNING). Choose a minimum of 1 algorithm.

" + "AutoMLAlgorithmConfig$AutoMLAlgorithms": "

The selection of algorithms trained on your dataset to generate the model candidates for an Autopilot job.

" } }, "AutoMLAlgorithmsConfig": { "base": null, "refs": { - "AutoMLCandidateGenerationConfig$AlgorithmsConfig": "

Stores the configuration information for the selection of algorithms used to train the model candidates.

The list of available algorithms to choose from depends on the training mode set in AutoMLJobConfig.Mode .

For the list of all algorithms per training mode, see AutoMLAlgorithmConfig.

For more information on each algorithm, see the Algorithm support section in Autopilot developer guide.

", - "CandidateGenerationConfig$AlgorithmsConfig": "

Stores the configuration information for the selection of algorithms used to train model candidates on tabular data.

The list of available algorithms to choose from depends on the training mode set in TabularJobConfig.Mode .

For the list of all algorithms per problem type and training mode, see AutoMLAlgorithmConfig.

For more information on each algorithm, see the Algorithm support section in Autopilot developer guide.

" + "AutoMLCandidateGenerationConfig$AlgorithmsConfig": "

Stores the configuration information for the selection of algorithms trained on tabular data.

The list of available algorithms to choose from depends on the training mode set in TabularJobConfig.Mode .

For the list of all algorithms per problem type and training mode, see AutoMLAlgorithmConfig.

For more information on each algorithm, see the Algorithm support section in Autopilot developer guide.

", + "CandidateGenerationConfig$AlgorithmsConfig": "

Your Autopilot job trains a default set of algorithms on your dataset. For tabular and time-series data, you can customize the algorithm list by selecting a subset of algorithms for your problem type.

AlgorithmsConfig stores the customized selection of algorithms to train on your data.

" } }, "AutoMLCandidate": { @@ -1562,7 +1562,8 @@ "CandidateGenerationConfig": { "base": "

Stores the configuration information for how model candidates are generated using an AutoML job V2.

", "refs": { - "TabularJobConfig$CandidateGenerationConfig": "

The configuration information of how model candidates are generated.

" + "TabularJobConfig$CandidateGenerationConfig": "

The configuration information of how model candidates are generated.

", + "TimeSeriesForecastingJobConfig$CandidateGenerationConfig": null } }, "CandidateName": { @@ -7867,6 +7868,7 @@ "LabelingJobOutputConfig$KmsKeyId": "

The Amazon Web Services Key Management Service ID of the key used to encrypt the output data, if any.

If you provide your own KMS key ID, you must add the required permissions to your KMS key described in Encrypt Output Data and Storage Volume with Amazon Web Services KMS.

If you don't provide a KMS key ID, Amazon SageMaker uses the default Amazon Web Services KMS key for Amazon S3 for your role's account to encrypt your output data.

If you use a bucket policy with an s3:PutObject permission that only allows objects with server-side encryption, set the condition key of s3:x-amz-server-side-encryption to \"aws:kms\". For more information, see KMS-Managed Encryption Keys in the Amazon Simple Storage Service Developer Guide.

", "LabelingJobResourceConfig$VolumeKmsKeyId": "

The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training and inference jobs used for automated data labeling.

You can only specify a VolumeKmsKeyId when you create a labeling job with automated data labeling enabled using the API operation CreateLabelingJob. You cannot specify an Amazon Web Services KMS key to encrypt the storage volume used for automated data labeling model training and inference when you create a labeling job using the console. To learn more, see Output Data and Storage Volume Encryption.

The VolumeKmsKeyId can be any of the following formats:

", "ModelCardSecurityConfig$KmsKeyId": "

A Key Management Service key ID to use for encrypting a model card.

", + "ModelPackageSecurityConfig$KmsKeyId": "

The KMS Key ID (KMSKeyId) used for encryption of model package information.

", "MonitoringClusterConfig$VolumeKmsKeyId": "

The Key Management Service (KMS) key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the model monitoring job.

", "MonitoringOutputConfig$KmsKeyId": "

The Key Management Service (KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.

", "OnlineStoreSecurityConfig$KmsKeyId": "

The Amazon Web Services Key Management Service (KMS) key ARN that SageMaker Feature Store uses to encrypt the Amazon S3 objects at rest using Amazon S3 server-side encryption.

The caller (either user or IAM role) of CreateFeatureGroup must have below permissions to the OnlineStore KmsKeyId:

The caller (either user or IAM role) to all DataPlane operations (PutRecord, GetRecord, DeleteRecord) must have the following permissions to the KmsKeyId:

", @@ -9144,7 +9146,7 @@ "ListAlgorithmsInput$MaxResults": "

The maximum number of algorithms to return in the response.

", "ListAliasesRequest$MaxResults": "

The maximum number of aliases to return.

", "ListAppImageConfigsRequest$MaxResults": "

The total number of items to return in the response. If the total number of items available is more than the value specified, a NextToken is provided in the response. To resume pagination, provide the NextToken value in the as part of a subsequent call. The default value is 10.

", - "ListAppsRequest$MaxResults": "

This parameter defines the maximum number of results that can be returned in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

", + "ListAppsRequest$MaxResults": "

This parameter defines the maximum number of results that can be return in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

", "ListArtifactsRequest$MaxResults": "

The maximum number of artifacts to return in the response. The default value is 10.

", "ListAssociationsRequest$MaxResults": "

The maximum number of associations to return in the response. The default value is 10.

", "ListClusterNodesRequest$MaxResults": "

The maximum number of nodes to return in the response.

", @@ -9153,7 +9155,7 @@ "ListCompilationJobsRequest$MaxResults": "

The maximum number of model compilation jobs to return in the response.

", "ListContextsRequest$MaxResults": "

The maximum number of contexts to return in the response. The default value is 10.

", "ListDataQualityJobDefinitionsRequest$MaxResults": "

The maximum number of data quality monitoring job definitions to return in the response.

", - "ListDomainsRequest$MaxResults": "

This parameter defines the maximum number of results that can be returned in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

", + "ListDomainsRequest$MaxResults": "

This parameter defines the maximum number of results that can be return in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

", "ListEndpointConfigsInput$MaxResults": "

The maximum number of training jobs to return in the response.

", "ListEndpointsInput$MaxResults": "

The maximum number of endpoints to return in the response. This value defaults to 10.

", "ListExperimentsRequest$MaxResults": "

The maximum number of experiments to return in the response. The default value is 10.

", @@ -9195,7 +9197,7 @@ "ListProcessingJobsRequest$MaxResults": "

The maximum number of processing jobs to return in the response.

", "ListProjectsInput$MaxResults": "

The maximum number of projects to return in the response.

", "ListResourceCatalogsRequest$MaxResults": "

The maximum number of results returned by ListResourceCatalogs.

", - "ListSpacesRequest$MaxResults": "

This parameter defines the maximum number of results that can be returned in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

", + "ListSpacesRequest$MaxResults": "

This parameter defines the maximum number of results that can be return in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

", "ListStudioLifecycleConfigsRequest$MaxResults": "

The total number of items to return in the response. If the total number of items available is more than the value specified, a NextToken is provided in the response. To resume pagination, provide the NextToken value in the as part of a subsequent call. The default value is 10.

", "ListSubscribedWorkteamsRequest$MaxResults": "

The maximum number of work teams to return in each page of the response.

", "ListTrainingJobsForHyperParameterTuningJobRequest$MaxResults": "

The maximum number of training jobs to return. The default value is 10.

", @@ -9203,7 +9205,7 @@ "ListTransformJobsRequest$MaxResults": "

The maximum number of transform jobs to return in the response. The default value is 10.

", "ListTrialComponentsRequest$MaxResults": "

The maximum number of components to return in the response. The default value is 10.

", "ListTrialsRequest$MaxResults": "

The maximum number of trials to return in the response. The default value is 10.

", - "ListUserProfilesRequest$MaxResults": "

This parameter defines the maximum number of results that can be returned in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

", + "ListUserProfilesRequest$MaxResults": "

This parameter defines the maximum number of results that can be return in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

", "ListWorkforcesRequest$MaxResults": "

The maximum number of workforces returned in the response.

", "ListWorkteamsRequest$MaxResults": "

The maximum number of work teams to return in each page of the response.

", "SearchRequest$MaxResults": "

The maximum number of results to return.

" @@ -9482,6 +9484,7 @@ "CreateModelCardRequest$Content": "

The content of the model card. Content must be in model card JSON schema and provided as a string.

", "DescribeModelCardResponse$Content": "

The content of the model card.

", "ModelCard$Content": "

The content of the model card. Content uses the model card JSON schema and provided as a string.

", + "ModelPackageModelCard$ModelCardContent": "

The content of the model card.

", "UpdateModelCardRequest$Content": "

The updated model card content. Content must be in model card JSON schema and provided as a string.

When updating model card content, be sure to include the full content and not just updated content.

" } }, @@ -9587,6 +9590,7 @@ "ModelCardSummary$ModelCardStatus": "

The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.

", "ModelCardVersionSummary$ModelCardStatus": "

The approval status of the model card version within your organization. Different organizations might have different criteria for model card review and approval.

", "ModelDashboardModelCard$ModelCardStatus": "

The model card status.

", + "ModelPackageModelCard$ModelCardStatus": "

The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.

", "UpdateModelCardRequest$ModelCardStatus": "

The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.

" } }, @@ -9942,6 +9946,23 @@ "ListModelPackageGroupsOutput$ModelPackageGroupSummaryList": "

A list of summaries of the model groups in your Amazon Web Services account.

" } }, + "ModelPackageModelCard": { + "base": "

The model card associated with the model package. Since ModelPackageModelCard is tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard schema does not include model_package_details, and model_overview is composed of the model_creator and model_artifact properties. For more information about the model card associated with the model package, see View the Details of a Model Version.

", + "refs": { + "CreateModelPackageInput$ModelCard": "

The model card associated with the model package. Since ModelPackageModelCard is tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard schema does not include model_package_details, and model_overview is composed of the model_creator and model_artifact properties. For more information about the model card associated with the model package, see View the Details of a Model Version.

", + "DescribeModelPackageOutput$ModelCard": "

The model card associated with the model package. Since ModelPackageModelCard is tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard schema does not include model_package_details, and model_overview is composed of the model_creator and model_artifact properties. For more information about the model card associated with the model package, see View the Details of a Model Version.

", + "ModelPackage$ModelCard": null, + "UpdateModelPackageInput$ModelCard": "

The model card associated with the model package. Since ModelPackageModelCard is tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard schema does not include model_package_details, and model_overview is composed of the model_creator and model_artifact properties. For more information about the model card associated with the model package, see View the Details of a Model Version.

" + } + }, + "ModelPackageSecurityConfig": { + "base": "

An optional Key Management Service key to encrypt, decrypt, and re-encrypt model package information for regulated workloads with highly sensitive data.

", + "refs": { + "CreateModelPackageInput$SecurityConfig": "

The KMS Key ID (KMSKeyId) used for encryption of model package information.

", + "DescribeModelPackageOutput$SecurityConfig": "

The KMS Key ID (KMSKeyId) used for encryption of model package information.

", + "ModelPackage$SecurityConfig": null + } + }, "ModelPackageSortBy": { "base": null, "refs": { diff --git a/models/endpoints/endpoints.json b/models/endpoints/endpoints.json index 06ea8df845f..20db4ac34e3 100644 --- a/models/endpoints/endpoints.json +++ b/models/endpoints/endpoints.json @@ -112,11 +112,6 @@ } }, "services" : { - "a4b" : { - "endpoints" : { - "us-east-1" : { } - } - }, "access-analyzer" : { "endpoints" : { "af-south-1" : { }, diff --git a/service/bedrockagent/api.go b/service/bedrockagent/api.go index 95bfa0cdd7b..d1b808dc92f 100644 --- a/service/bedrockagent/api.go +++ b/service/bedrockagent/api.go @@ -6073,6 +6073,39 @@ func (s *AssociateAgentKnowledgeBaseOutput) SetAgentKnowledgeBase(v *AgentKnowle return s } +// The vector configuration details for the Bedrock embeddings model. +type BedrockEmbeddingModelConfiguration struct { + _ struct{} `type:"structure"` + + // The dimensions details for the vector configuration used on the Bedrock embeddings + // model. + Dimensions *int64 `locationName:"dimensions" type:"integer"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s BedrockEmbeddingModelConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s BedrockEmbeddingModelConfiguration) GoString() string { + return s.String() +} + +// SetDimensions sets the Dimensions field's value. +func (s *BedrockEmbeddingModelConfiguration) SetDimensions(v int64) *BedrockEmbeddingModelConfiguration { + s.Dimensions = &v + return s +} + // Details about how to chunk the documents in the data source. A chunk refers // to an excerpt from a data source that is returned when the knowledge base // that it belongs to is queried. @@ -8228,6 +8261,38 @@ func (s DisassociateAgentKnowledgeBaseOutput) GoString() string { return s.String() } +// The configuration details for the embeddings model. +type EmbeddingModelConfiguration struct { + _ struct{} `type:"structure"` + + // The vector configuration details on the Bedrock embeddings model. + BedrockEmbeddingModelConfiguration *BedrockEmbeddingModelConfiguration `locationName:"bedrockEmbeddingModelConfiguration" type:"structure"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s EmbeddingModelConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s EmbeddingModelConfiguration) GoString() string { + return s.String() +} + +// SetBedrockEmbeddingModelConfiguration sets the BedrockEmbeddingModelConfiguration field's value. +func (s *EmbeddingModelConfiguration) SetBedrockEmbeddingModelConfiguration(v *BedrockEmbeddingModelConfiguration) *EmbeddingModelConfiguration { + s.BedrockEmbeddingModelConfiguration = v + return s +} + // Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy // as NONE, exclude this field. type FixedSizeChunkingConfiguration struct { @@ -14636,6 +14701,10 @@ type VectorKnowledgeBaseConfiguration struct { // // EmbeddingModelArn is a required field EmbeddingModelArn *string `locationName:"embeddingModelArn" min:"20" type:"string" required:"true"` + + // The embeddings model configuration details for the vector model used in Knowledge + // Base. + EmbeddingModelConfiguration *EmbeddingModelConfiguration `locationName:"embeddingModelConfiguration" type:"structure"` } // String returns the string representation. @@ -14678,6 +14747,12 @@ func (s *VectorKnowledgeBaseConfiguration) SetEmbeddingModelArn(v string) *Vecto return s } +// SetEmbeddingModelConfiguration sets the EmbeddingModelConfiguration field's value. +func (s *VectorKnowledgeBaseConfiguration) SetEmbeddingModelConfiguration(v *EmbeddingModelConfiguration) *VectorKnowledgeBaseConfiguration { + s.EmbeddingModelConfiguration = v + return s +} + const ( // ActionGroupSignatureAmazonUserInput is a ActionGroupSignature enum value ActionGroupSignatureAmazonUserInput = "AMAZON.UserInput" diff --git a/service/bedrockruntime/api.go b/service/bedrockruntime/api.go index b5b88636c44..67b87a1b4ba 100644 --- a/service/bedrockruntime/api.go +++ b/service/bedrockruntime/api.go @@ -21,55 +21,55 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/restjson" ) -const opInvokeModel = "InvokeModel" +const opConverse = "Converse" -// InvokeModelRequest generates a "aws/request.Request" representing the -// client's request for the InvokeModel operation. The "output" return +// ConverseRequest generates a "aws/request.Request" representing the +// client's request for the Converse operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See InvokeModel for more information on using the InvokeModel +// See Converse for more information on using the Converse // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // -// // Example sending a request using the InvokeModelRequest method. -// req, resp := client.InvokeModelRequest(params) +// // Example sending a request using the ConverseRequest method. +// req, resp := client.ConverseRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModel -func (c *BedrockRuntime) InvokeModelRequest(input *InvokeModelInput) (req *request.Request, output *InvokeModelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/Converse +func (c *BedrockRuntime) ConverseRequest(input *ConverseInput) (req *request.Request, output *ConverseOutput) { op := &request.Operation{ - Name: opInvokeModel, + Name: opConverse, HTTPMethod: "POST", - HTTPPath: "/model/{modelId}/invoke", + HTTPPath: "/model/{modelId}/converse", } if input == nil { - input = &InvokeModelInput{} + input = &ConverseInput{} } - output = &InvokeModelOutput{} + output = &ConverseOutput{} req = c.newRequest(op, input, output) return } -// InvokeModel API operation for Amazon Bedrock Runtime. -// -// Invokes the specified Amazon Bedrock model to run inference using the prompt -// and inference parameters provided in the request body. You use model inference -// to generate text, images, and embeddings. +// Converse API operation for Amazon Bedrock Runtime. // -// For example code, see Invoke model code examples in the Amazon Bedrock User -// Guide. +// Sends messages to the specified Amazon Bedrock model. Converse provides a +// consistent interface that works with all models that support messages. This +// allows you to write code once and use it with different models. Should a +// model have unique inference parameters, you can also pass those unique parameters +// to the model. For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) +// in the Bedrock User Guide. // // This operation requires permission for the bedrock:InvokeModel action. // @@ -78,7 +78,7 @@ func (c *BedrockRuntime) InvokeModelRequest(input *InvokeModelInput) (req *reque // the error. // // See the AWS API reference guide for Amazon Bedrock Runtime's -// API operation InvokeModel for usage and error information. +// API operation Converse for usage and error information. // // Returned Error Types: // @@ -105,74 +105,71 @@ func (c *BedrockRuntime) InvokeModelRequest(input *InvokeModelInput) (req *reque // - ModelNotReadyException // The model specified in the request is not ready to serve inference requests. // -// - ServiceQuotaExceededException -// The number of requests exceeds the service quota. Resubmit your request later. -// // - ModelErrorException // The request failed due to an error while processing the model. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModel -func (c *BedrockRuntime) InvokeModel(input *InvokeModelInput) (*InvokeModelOutput, error) { - req, out := c.InvokeModelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/Converse +func (c *BedrockRuntime) Converse(input *ConverseInput) (*ConverseOutput, error) { + req, out := c.ConverseRequest(input) return out, req.Send() } -// InvokeModelWithContext is the same as InvokeModel with the addition of +// ConverseWithContext is the same as Converse with the addition of // the ability to pass a context and additional request options. // -// See InvokeModel for details on how to use this API operation. +// See Converse for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *BedrockRuntime) InvokeModelWithContext(ctx aws.Context, input *InvokeModelInput, opts ...request.Option) (*InvokeModelOutput, error) { - req, out := c.InvokeModelRequest(input) +func (c *BedrockRuntime) ConverseWithContext(ctx aws.Context, input *ConverseInput, opts ...request.Option) (*ConverseOutput, error) { + req, out := c.ConverseRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opInvokeModelWithResponseStream = "InvokeModelWithResponseStream" +const opConverseStream = "ConverseStream" -// InvokeModelWithResponseStreamRequest generates a "aws/request.Request" representing the -// client's request for the InvokeModelWithResponseStream operation. The "output" return +// ConverseStreamRequest generates a "aws/request.Request" representing the +// client's request for the ConverseStream operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See InvokeModelWithResponseStream for more information on using the InvokeModelWithResponseStream +// See ConverseStream for more information on using the ConverseStream // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // -// // Example sending a request using the InvokeModelWithResponseStreamRequest method. -// req, resp := client.InvokeModelWithResponseStreamRequest(params) +// // Example sending a request using the ConverseStreamRequest method. +// req, resp := client.ConverseStreamRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithResponseStream -func (c *BedrockRuntime) InvokeModelWithResponseStreamRequest(input *InvokeModelWithResponseStreamInput) (req *request.Request, output *InvokeModelWithResponseStreamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ConverseStream +func (c *BedrockRuntime) ConverseStreamRequest(input *ConverseStreamInput) (req *request.Request, output *ConverseStreamOutput) { op := &request.Operation{ - Name: opInvokeModelWithResponseStream, + Name: opConverseStream, HTTPMethod: "POST", - HTTPPath: "/model/{modelId}/invoke-with-response-stream", + HTTPPath: "/model/{modelId}/converse-stream", } if input == nil { - input = &InvokeModelWithResponseStreamInput{} + input = &ConverseStreamInput{} } - output = &InvokeModelWithResponseStreamOutput{} + output = &ConverseStreamOutput{} req = c.newRequest(op, input, output) - es := NewInvokeModelWithResponseStreamEventStream() + es := NewConverseStreamEventStream() output.eventStream = es req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler) @@ -182,21 +179,23 @@ func (c *BedrockRuntime) InvokeModelWithResponseStreamRequest(input *InvokeModel return } -// InvokeModelWithResponseStream API operation for Amazon Bedrock Runtime. +// ConverseStream API operation for Amazon Bedrock Runtime. // -// Invoke the specified Amazon Bedrock model to run inference using the prompt -// and inference parameters provided in the request body. The response is returned -// in a stream. +// Sends messages to the specified Amazon Bedrock model and returns the response +// in a stream. ConverseStream provides a consistent API that works with all +// Amazon Bedrock models that support messages. This allows you to write code +// once and use it with different models. Should a model have unique inference +// parameters, you can also pass those unique parameters to the model. For more +// information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) +// in the Bedrock User Guide. // -// To see if a model supports streaming, call GetFoundationModel (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html) +// To find out if a model supports streaming, call GetFoundationModel (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html) // and check the responseStreamingSupported field in the response. // -// The CLI doesn't support InvokeModelWithResponseStream. -// // For example code, see Invoke model with streaming code example in the Amazon // Bedrock User Guide. // -// This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream +// This operation requires permission for the bedrock:InvokeModelWithResponseStream // action. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -204,7 +203,7 @@ func (c *BedrockRuntime) InvokeModelWithResponseStreamRequest(input *InvokeModel // the error. // // See the AWS API reference guide for Amazon Bedrock Runtime's -// API operation InvokeModelWithResponseStream for usage and error information. +// API operation ConverseStream for usage and error information. // // Returned Error Types: // @@ -225,38 +224,32 @@ func (c *BedrockRuntime) InvokeModelWithResponseStreamRequest(input *InvokeModel // - InternalServerException // An internal server error occurred. Retry your request. // -// - ModelStreamErrorException -// An error occurred while streaming the response. Retry your request. -// // - ValidationException // Input validation failed. Check your request parameters and retry the request. // // - ModelNotReadyException // The model specified in the request is not ready to serve inference requests. // -// - ServiceQuotaExceededException -// The number of requests exceeds the service quota. Resubmit your request later. -// // - ModelErrorException // The request failed due to an error while processing the model. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithResponseStream -func (c *BedrockRuntime) InvokeModelWithResponseStream(input *InvokeModelWithResponseStreamInput) (*InvokeModelWithResponseStreamOutput, error) { - req, out := c.InvokeModelWithResponseStreamRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ConverseStream +func (c *BedrockRuntime) ConverseStream(input *ConverseStreamInput) (*ConverseStreamOutput, error) { + req, out := c.ConverseStreamRequest(input) return out, req.Send() } -// InvokeModelWithResponseStreamWithContext is the same as InvokeModelWithResponseStream with the addition of +// ConverseStreamWithContext is the same as ConverseStream with the addition of // the ability to pass a context and additional request options. // -// See InvokeModelWithResponseStream for details on how to use this API operation. +// See ConverseStream for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *BedrockRuntime) InvokeModelWithResponseStreamWithContext(ctx aws.Context, input *InvokeModelWithResponseStreamInput, opts ...request.Option) (*InvokeModelWithResponseStreamOutput, error) { - req, out := c.InvokeModelWithResponseStreamRequest(input) +func (c *BedrockRuntime) ConverseStreamWithContext(ctx aws.Context, input *ConverseStreamInput, opts ...request.Option) (*ConverseStreamOutput, error) { + req, out := c.ConverseStreamRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() @@ -265,20 +258,20 @@ func (c *BedrockRuntime) InvokeModelWithResponseStreamWithContext(ctx aws.Contex var _ awserr.Error var _ time.Time -// InvokeModelWithResponseStreamEventStream provides the event stream handling for the InvokeModelWithResponseStream. +// ConverseStreamEventStream provides the event stream handling for the ConverseStream. // // For testing and mocking the event stream this type should be initialized via -// the NewInvokeModelWithResponseStreamEventStream constructor function. Using the functional options +// the NewConverseStreamEventStream constructor function. Using the functional options // to pass in nested mock behavior. -type InvokeModelWithResponseStreamEventStream struct { +type ConverseStreamEventStream struct { - // Reader is the EventStream reader for the ResponseStream + // Reader is the EventStream reader for the ConverseStreamOutput_ // events. This value is automatically set by the SDK when the API call is made // Use this member when unit testing your code with the SDK to mock out the // EventStream Reader. // // Must not be nil. - Reader ResponseStreamReader + Reader ConverseStreamOutput_Reader outputReader io.ReadCloser @@ -287,17 +280,17 @@ type InvokeModelWithResponseStreamEventStream struct { err *eventstreamapi.OnceError } -// NewInvokeModelWithResponseStreamEventStream initializes an InvokeModelWithResponseStreamEventStream. -// This function should only be used for testing and mocking the InvokeModelWithResponseStreamEventStream +// NewConverseStreamEventStream initializes an ConverseStreamEventStream. +// This function should only be used for testing and mocking the ConverseStreamEventStream // stream within your application. // // The Reader member must be set before reading events from the stream. // -// es := NewInvokeModelWithResponseStreamEventStream(func(o *InvokeModelWithResponseStreamEventStream){ +// es := NewConverseStreamEventStream(func(o *ConverseStreamEventStream){ // es.Reader = myMockStreamReader // }) -func NewInvokeModelWithResponseStreamEventStream(opts ...func(*InvokeModelWithResponseStreamEventStream)) *InvokeModelWithResponseStreamEventStream { - es := &InvokeModelWithResponseStreamEventStream{ +func NewConverseStreamEventStream(opts ...func(*ConverseStreamEventStream)) *ConverseStreamEventStream { + es := &ConverseStreamEventStream{ done: make(chan struct{}), err: eventstreamapi.NewOnceError(), } @@ -309,7 +302,7 @@ func NewInvokeModelWithResponseStreamEventStream(opts ...func(*InvokeModelWithRe return es } -func (es *InvokeModelWithResponseStreamEventStream) runOnStreamPartClose(r *request.Request) { +func (es *ConverseStreamEventStream) runOnStreamPartClose(r *request.Request) { if es.done == nil { return } @@ -317,7 +310,7 @@ func (es *InvokeModelWithResponseStreamEventStream) runOnStreamPartClose(r *requ } -func (es *InvokeModelWithResponseStreamEventStream) waitStreamPartClose() { +func (es *ConverseStreamEventStream) waitStreamPartClose() { var outputErrCh <-chan struct{} if v, ok := es.Reader.(interface{ ErrorSet() <-chan struct{} }); ok { outputErrCh = v.ErrorSet() @@ -344,19 +337,24 @@ func (es *InvokeModelWithResponseStreamEventStream) waitStreamPartClose() { // // These events are: // -// - PayloadPart -// - ResponseStreamUnknownEvent -func (es *InvokeModelWithResponseStreamEventStream) Events() <-chan ResponseStreamEvent { +// - ContentBlockDeltaEvent +// - ContentBlockStartEvent +// - ContentBlockStopEvent +// - MessageStartEvent +// - MessageStopEvent +// - ConverseStreamMetadataEvent +// - ConverseStreamOutput_UnknownEvent +func (es *ConverseStreamEventStream) Events() <-chan ConverseStreamOutput_Event { return es.Reader.Events() } -func (es *InvokeModelWithResponseStreamEventStream) runOutputStream(r *request.Request) { +func (es *ConverseStreamEventStream) runOutputStream(r *request.Request) { var opts []func(*eventstream.Decoder) if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) { opts = append(opts, eventstream.DecodeWithLogger(r.Config.Logger)) } - unmarshalerForEvent := unmarshalerForResponseStreamEvent{ + unmarshalerForEvent := unmarshalerForConverseStreamOutput_Event{ metadata: protocol.ResponseMetadata{ StatusCode: r.HTTPResponse.StatusCode, RequestID: r.RequestID, @@ -372,7 +370,7 @@ func (es *InvokeModelWithResponseStreamEventStream) runOutputStream(r *request.R ) es.outputReader = r.HTTPResponse.Body - es.Reader = newReadResponseStream(eventReader) + es.Reader = newReadConverseStreamOutput_(eventReader) } // Close closes the stream. This will also cause the stream to be closed. @@ -381,12 +379,12 @@ func (es *InvokeModelWithResponseStreamEventStream) runOutputStream(r *request.R // // You can use the closing of the Reader's Events channel to terminate your // application's read from the API's stream. -func (es *InvokeModelWithResponseStreamEventStream) Close() (err error) { +func (es *ConverseStreamEventStream) Close() (err error) { es.closeOnce.Do(es.safeClose) return es.Err() } -func (es *InvokeModelWithResponseStreamEventStream) safeClose() { +func (es *ConverseStreamEventStream) safeClose() { if es.done != nil { close(es.done) } @@ -399,7 +397,7 @@ func (es *InvokeModelWithResponseStreamEventStream) safeClose() { // Err returns any error that occurred while reading or writing EventStream // Events from the service API's response. Returns nil if there were no errors. -func (es *InvokeModelWithResponseStreamEventStream) Err() error { +func (es *ConverseStreamEventStream) Err() error { if err := es.err.Err(); err != nil { return err } @@ -410,102 +408,2704 @@ func (es *InvokeModelWithResponseStreamEventStream) Err() error { return nil } -// The request is denied because of missing access permissions. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} +const opInvokeModel = "InvokeModel" -// String returns the string representation. +// InvokeModelRequest generates a "aws/request.Request" representing the +// client's request for the InvokeModel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessDeniedException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. // -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, +// See InvokeModel for more information on using the InvokeModel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// // Example sending a request using the InvokeModelRequest method. +// req, resp := client.InvokeModelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModel +func (c *BedrockRuntime) InvokeModelRequest(input *InvokeModelInput) (req *request.Request, output *InvokeModelOutput) { + op := &request.Operation{ + Name: opInvokeModel, + HTTPMethod: "POST", + HTTPPath: "/model/{modelId}/invoke", } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ + if input == nil { + input = &InvokeModelInput{} } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) + output = &InvokeModelOutput{} + req = c.newRequest(op, input, output) + return } -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode +// InvokeModel API operation for Amazon Bedrock Runtime. +// +// Invokes the specified Amazon Bedrock model to run inference using the prompt +// and inference parameters provided in the request body. You use model inference +// to generate text, images, and embeddings. +// +// For example code, see Invoke model code examples in the Amazon Bedrock User +// Guide. +// +// This operation requires permission for the bedrock:InvokeModel action. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Bedrock Runtime's +// API operation InvokeModel for usage and error information. +// +// Returned Error Types: +// +// - AccessDeniedException +// The request is denied because of missing access permissions. +// +// - ResourceNotFoundException +// The specified resource ARN was not found. Check the ARN and try your request +// again. +// +// - ThrottlingException +// The number of requests exceeds the limit. Resubmit your request later. +// +// - ModelTimeoutException +// The request took too long to process. Processing time exceeded the model +// timeout length. +// +// - InternalServerException +// An internal server error occurred. Retry your request. +// +// - ValidationException +// Input validation failed. Check your request parameters and retry the request. +// +// - ModelNotReadyException +// The model specified in the request is not ready to serve inference requests. +// +// - ServiceQuotaExceededException +// The number of requests exceeds the service quota. Resubmit your request later. +// +// - ModelErrorException +// The request failed due to an error while processing the model. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModel +func (c *BedrockRuntime) InvokeModel(input *InvokeModelInput) (*InvokeModelOutput, error) { + req, out := c.InvokeModelRequest(input) + return out, req.Send() } -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID +// InvokeModelWithContext is the same as InvokeModel with the addition of +// the ability to pass a context and additional request options. +// +// See InvokeModel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *BedrockRuntime) InvokeModelWithContext(ctx aws.Context, input *InvokeModelInput, opts ...request.Option) (*InvokeModelOutput, error) { + req, out := c.InvokeModelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -// An internal server error occurred. Retry your request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} +const opInvokeModelWithResponseStream = "InvokeModelWithResponseStream" -// String returns the string representation. +// InvokeModelWithResponseStreamRequest generates a "aws/request.Request" representing the +// client's request for the InvokeModelWithResponseStream operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InternalServerException) String() string { - return awsutil.Prettify(s) -} - +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See InvokeModelWithResponseStream for more information on using the InvokeModelWithResponseStream +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// // Example sending a request using the InvokeModelWithResponseStreamRequest method. +// req, resp := client.InvokeModelWithResponseStreamRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithResponseStream +func (c *BedrockRuntime) InvokeModelWithResponseStreamRequest(input *InvokeModelWithResponseStreamInput) (req *request.Request, output *InvokeModelWithResponseStreamOutput) { + op := &request.Operation{ + Name: opInvokeModelWithResponseStream, + HTTPMethod: "POST", + HTTPPath: "/model/{modelId}/invoke-with-response-stream", + } + + if input == nil { + input = &InvokeModelWithResponseStreamInput{} + } + + output = &InvokeModelWithResponseStreamOutput{} + req = c.newRequest(op, input, output) + + es := NewInvokeModelWithResponseStreamEventStream() + output.eventStream = es + + req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, rest.UnmarshalHandler) + req.Handlers.Unmarshal.PushBack(es.runOutputStream) + req.Handlers.Unmarshal.PushBack(es.runOnStreamPartClose) + return +} + +// InvokeModelWithResponseStream API operation for Amazon Bedrock Runtime. +// +// Invoke the specified Amazon Bedrock model to run inference using the prompt +// and inference parameters provided in the request body. The response is returned +// in a stream. +// +// To see if a model supports streaming, call GetFoundationModel (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html) +// and check the responseStreamingSupported field in the response. +// +// The CLI doesn't support InvokeModelWithResponseStream. +// +// For example code, see Invoke model with streaming code example in the Amazon +// Bedrock User Guide. +// +// This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream +// action. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Bedrock Runtime's +// API operation InvokeModelWithResponseStream for usage and error information. +// +// Returned Error Types: +// +// - AccessDeniedException +// The request is denied because of missing access permissions. +// +// - ResourceNotFoundException +// The specified resource ARN was not found. Check the ARN and try your request +// again. +// +// - ThrottlingException +// The number of requests exceeds the limit. Resubmit your request later. +// +// - ModelTimeoutException +// The request took too long to process. Processing time exceeded the model +// timeout length. +// +// - InternalServerException +// An internal server error occurred. Retry your request. +// +// - ModelStreamErrorException +// An error occurred while streaming the response. Retry your request. +// +// - ValidationException +// Input validation failed. Check your request parameters and retry the request. +// +// - ModelNotReadyException +// The model specified in the request is not ready to serve inference requests. +// +// - ServiceQuotaExceededException +// The number of requests exceeds the service quota. Resubmit your request later. +// +// - ModelErrorException +// The request failed due to an error while processing the model. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithResponseStream +func (c *BedrockRuntime) InvokeModelWithResponseStream(input *InvokeModelWithResponseStreamInput) (*InvokeModelWithResponseStreamOutput, error) { + req, out := c.InvokeModelWithResponseStreamRequest(input) + return out, req.Send() +} + +// InvokeModelWithResponseStreamWithContext is the same as InvokeModelWithResponseStream with the addition of +// the ability to pass a context and additional request options. +// +// See InvokeModelWithResponseStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *BedrockRuntime) InvokeModelWithResponseStreamWithContext(ctx aws.Context, input *InvokeModelWithResponseStreamInput, opts ...request.Option) (*InvokeModelWithResponseStreamOutput, error) { + req, out := c.InvokeModelWithResponseStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +var _ awserr.Error +var _ time.Time + +// InvokeModelWithResponseStreamEventStream provides the event stream handling for the InvokeModelWithResponseStream. +// +// For testing and mocking the event stream this type should be initialized via +// the NewInvokeModelWithResponseStreamEventStream constructor function. Using the functional options +// to pass in nested mock behavior. +type InvokeModelWithResponseStreamEventStream struct { + + // Reader is the EventStream reader for the ResponseStream + // events. This value is automatically set by the SDK when the API call is made + // Use this member when unit testing your code with the SDK to mock out the + // EventStream Reader. + // + // Must not be nil. + Reader ResponseStreamReader + + outputReader io.ReadCloser + + done chan struct{} + closeOnce sync.Once + err *eventstreamapi.OnceError +} + +// NewInvokeModelWithResponseStreamEventStream initializes an InvokeModelWithResponseStreamEventStream. +// This function should only be used for testing and mocking the InvokeModelWithResponseStreamEventStream +// stream within your application. +// +// The Reader member must be set before reading events from the stream. +// +// es := NewInvokeModelWithResponseStreamEventStream(func(o *InvokeModelWithResponseStreamEventStream){ +// es.Reader = myMockStreamReader +// }) +func NewInvokeModelWithResponseStreamEventStream(opts ...func(*InvokeModelWithResponseStreamEventStream)) *InvokeModelWithResponseStreamEventStream { + es := &InvokeModelWithResponseStreamEventStream{ + done: make(chan struct{}), + err: eventstreamapi.NewOnceError(), + } + + for _, fn := range opts { + fn(es) + } + + return es +} + +func (es *InvokeModelWithResponseStreamEventStream) runOnStreamPartClose(r *request.Request) { + if es.done == nil { + return + } + go es.waitStreamPartClose() + +} + +func (es *InvokeModelWithResponseStreamEventStream) waitStreamPartClose() { + var outputErrCh <-chan struct{} + if v, ok := es.Reader.(interface{ ErrorSet() <-chan struct{} }); ok { + outputErrCh = v.ErrorSet() + } + var outputClosedCh <-chan struct{} + if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok { + outputClosedCh = v.Closed() + } + + select { + case <-es.done: + case <-outputErrCh: + es.err.SetError(es.Reader.Err()) + es.Close() + case <-outputClosedCh: + if err := es.Reader.Err(); err != nil { + es.err.SetError(es.Reader.Err()) + } + es.Close() + } +} + +// Events returns a channel to read events from. +// +// These events are: +// +// - PayloadPart +// - ResponseStreamUnknownEvent +func (es *InvokeModelWithResponseStreamEventStream) Events() <-chan ResponseStreamEvent { + return es.Reader.Events() +} + +func (es *InvokeModelWithResponseStreamEventStream) runOutputStream(r *request.Request) { + var opts []func(*eventstream.Decoder) + if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) { + opts = append(opts, eventstream.DecodeWithLogger(r.Config.Logger)) + } + + unmarshalerForEvent := unmarshalerForResponseStreamEvent{ + metadata: protocol.ResponseMetadata{ + StatusCode: r.HTTPResponse.StatusCode, + RequestID: r.RequestID, + }, + }.UnmarshalerForEventName + + decoder := eventstream.NewDecoder(r.HTTPResponse.Body, opts...) + eventReader := eventstreamapi.NewEventReader(decoder, + protocol.HandlerPayloadUnmarshal{ + Unmarshalers: r.Handlers.UnmarshalStream, + }, + unmarshalerForEvent, + ) + + es.outputReader = r.HTTPResponse.Body + es.Reader = newReadResponseStream(eventReader) +} + +// Close closes the stream. This will also cause the stream to be closed. +// Close must be called when done using the stream API. Not calling Close +// may result in resource leaks. +// +// You can use the closing of the Reader's Events channel to terminate your +// application's read from the API's stream. +func (es *InvokeModelWithResponseStreamEventStream) Close() (err error) { + es.closeOnce.Do(es.safeClose) + return es.Err() +} + +func (es *InvokeModelWithResponseStreamEventStream) safeClose() { + if es.done != nil { + close(es.done) + } + + es.Reader.Close() + if es.outputReader != nil { + es.outputReader.Close() + } +} + +// Err returns any error that occurred while reading or writing EventStream +// Events from the service API's response. Returns nil if there were no errors. +func (es *InvokeModelWithResponseStreamEventStream) Err() error { + if err := es.err.Err(); err != nil { + return err + } + if err := es.Reader.Err(); err != nil { + return err + } + + return nil +} + +// The request is denied because of missing access permissions. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s *AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *AccessDeniedException) OrigErr() error { + return nil +} + +func (s *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *AccessDeniedException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *AccessDeniedException) RequestID() string { + return s.RespMetadata.RequestID +} + +// The model must request at least one tool (no text is generated). +type AnyToolChoice struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s AnyToolChoice) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s AnyToolChoice) GoString() string { + return s.String() +} + +// The Model automatically decides if a tool should be called or to whether +// to generate text instead. +type AutoToolChoice struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s AutoToolChoice) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s AutoToolChoice) GoString() string { + return s.String() +} + +// A block of content for a message. +type ContentBlock struct { + _ struct{} `type:"structure"` + + // Image to include in the message. + // + // This field is only supported by Anthropic Claude 3 models. + Image *ImageBlock `locationName:"image" type:"structure"` + + // Text to include in the message. + Text *string `locationName:"text" type:"string"` + + // The result for a tool request that a model makes. + ToolResult *ToolResultBlock `locationName:"toolResult" type:"structure"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlock) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlock) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ContentBlock) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ContentBlock"} + if s.Image != nil { + if err := s.Image.Validate(); err != nil { + invalidParams.AddNested("Image", err.(request.ErrInvalidParams)) + } + } + if s.ToolResult != nil { + if err := s.ToolResult.Validate(); err != nil { + invalidParams.AddNested("ToolResult", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImage sets the Image field's value. +func (s *ContentBlock) SetImage(v *ImageBlock) *ContentBlock { + s.Image = v + return s +} + +// SetText sets the Text field's value. +func (s *ContentBlock) SetText(v string) *ContentBlock { + s.Text = &v + return s +} + +// SetToolResult sets the ToolResult field's value. +func (s *ContentBlock) SetToolResult(v *ToolResultBlock) *ContentBlock { + s.ToolResult = v + return s +} + +// A bock of content in a streaming response. +type ContentBlockDelta struct { + _ struct{} `type:"structure"` + + // The content text. + Text *string `locationName:"text" type:"string"` + + // Information about a tool that the model is requesting to use. + ToolUse *ToolUseBlockDelta `locationName:"toolUse" type:"structure"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlockDelta) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlockDelta) GoString() string { + return s.String() +} + +// SetText sets the Text field's value. +func (s *ContentBlockDelta) SetText(v string) *ContentBlockDelta { + s.Text = &v + return s +} + +// SetToolUse sets the ToolUse field's value. +func (s *ContentBlockDelta) SetToolUse(v *ToolUseBlockDelta) *ContentBlockDelta { + s.ToolUse = v + return s +} + +// The content block delta event. +type ContentBlockDeltaEvent struct { + _ struct{} `type:"structure"` + + // The block index for a content block delta event. + // + // ContentBlockIndex is a required field + ContentBlockIndex *int64 `locationName:"contentBlockIndex" type:"integer" required:"true"` + + // The delta for a content block delta event. + // + // Delta is a required field + Delta *ContentBlockDelta `locationName:"delta" type:"structure" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlockDeltaEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlockDeltaEvent) GoString() string { + return s.String() +} + +// SetContentBlockIndex sets the ContentBlockIndex field's value. +func (s *ContentBlockDeltaEvent) SetContentBlockIndex(v int64) *ContentBlockDeltaEvent { + s.ContentBlockIndex = &v + return s +} + +// SetDelta sets the Delta field's value. +func (s *ContentBlockDeltaEvent) SetDelta(v *ContentBlockDelta) *ContentBlockDeltaEvent { + s.Delta = v + return s +} + +// The ContentBlockDeltaEvent is and event in the ConverseStreamOutput_ group of events. +func (s *ContentBlockDeltaEvent) eventConverseStreamOutput_() {} + +// UnmarshalEvent unmarshals the EventStream Message into the ContentBlockDeltaEvent value. +// This method is only used internally within the SDK's EventStream handling. +func (s *ContentBlockDeltaEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + if err := payloadUnmarshaler.UnmarshalPayload( + bytes.NewReader(msg.Payload), s, + ); err != nil { + return err + } + return nil +} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (s *ContentBlockDeltaEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +// Content block start information. +type ContentBlockStart struct { + _ struct{} `type:"structure"` + + // Information about a tool that the model is requesting to use. + ToolUse *ToolUseBlockStart `locationName:"toolUse" type:"structure"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlockStart) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlockStart) GoString() string { + return s.String() +} + +// SetToolUse sets the ToolUse field's value. +func (s *ContentBlockStart) SetToolUse(v *ToolUseBlockStart) *ContentBlockStart { + s.ToolUse = v + return s +} + +// Content block start event. +type ContentBlockStartEvent struct { + _ struct{} `type:"structure"` + + // The index for a content block start event. + // + // ContentBlockIndex is a required field + ContentBlockIndex *int64 `locationName:"contentBlockIndex" type:"integer" required:"true"` + + // Start information about a content block start event. + // + // Start is a required field + Start *ContentBlockStart `locationName:"start" type:"structure" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlockStartEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlockStartEvent) GoString() string { + return s.String() +} + +// SetContentBlockIndex sets the ContentBlockIndex field's value. +func (s *ContentBlockStartEvent) SetContentBlockIndex(v int64) *ContentBlockStartEvent { + s.ContentBlockIndex = &v + return s +} + +// SetStart sets the Start field's value. +func (s *ContentBlockStartEvent) SetStart(v *ContentBlockStart) *ContentBlockStartEvent { + s.Start = v + return s +} + +// The ContentBlockStartEvent is and event in the ConverseStreamOutput_ group of events. +func (s *ContentBlockStartEvent) eventConverseStreamOutput_() {} + +// UnmarshalEvent unmarshals the EventStream Message into the ContentBlockStartEvent value. +// This method is only used internally within the SDK's EventStream handling. +func (s *ContentBlockStartEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + if err := payloadUnmarshaler.UnmarshalPayload( + bytes.NewReader(msg.Payload), s, + ); err != nil { + return err + } + return nil +} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (s *ContentBlockStartEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +// A content block stop event. +type ContentBlockStopEvent struct { + _ struct{} `type:"structure"` + + // The index for a content block. + // + // ContentBlockIndex is a required field + ContentBlockIndex *int64 `locationName:"contentBlockIndex" type:"integer" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlockStopEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ContentBlockStopEvent) GoString() string { + return s.String() +} + +// SetContentBlockIndex sets the ContentBlockIndex field's value. +func (s *ContentBlockStopEvent) SetContentBlockIndex(v int64) *ContentBlockStopEvent { + s.ContentBlockIndex = &v + return s +} + +// The ContentBlockStopEvent is and event in the ConverseStreamOutput_ group of events. +func (s *ContentBlockStopEvent) eventConverseStreamOutput_() {} + +// UnmarshalEvent unmarshals the EventStream Message into the ContentBlockStopEvent value. +// This method is only used internally within the SDK's EventStream handling. +func (s *ContentBlockStopEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + if err := payloadUnmarshaler.UnmarshalPayload( + bytes.NewReader(msg.Payload), s, + ); err != nil { + return err + } + return nil +} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (s *ContentBlockStopEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +type ConverseInput struct { + _ struct{} `type:"structure"` + + // Additional model parameters field paths to return in the response. Converse + // returns the requested fields as a JSON Pointer object in the additionalModelResultFields + // field. The following is example JSON for additionalModelResponseFieldPaths. + // + // [ "/stop_sequence" ] + // + // For information about the JSON Pointer syntax, see the Internet Engineering + // Task Force (IETF) (https://datatracker.ietf.org/doc/html/rfc6901) documentation. + // + // Converse rejects an empty JSON Pointer or incorrectly structured JSON Pointer + // with a 400 error code. if the JSON Pointer is valid, but the requested field + // is not in the model response, it is ignored by Converse. + AdditionalModelResponseFieldPaths []*string `locationName:"additionalModelResponseFieldPaths" type:"list"` + + // Inference parameters to pass to the model. Converse supports a base set of + // inference parameters. If you need to pass additional parameters that the + // model supports, use the additionalModelRequestFields request field. + InferenceConfig *InferenceConfiguration `locationName:"inferenceConfig" type:"structure"` + + // The messages that you want to send to the model. + // + // Messages is a required field + Messages []*Message `locationName:"messages" type:"list" required:"true"` + + // The identifier for the model that you want to call. + // + // The modelId to provide depends on the type of model that you use: + // + // * If you use a base model, specify the model ID or its ARN. For a list + // of model IDs for base models, see Amazon Bedrock base model IDs (on-demand + // throughput) (https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) + // in the Amazon Bedrock User Guide. + // + // * If you use a provisioned model, specify the ARN of the Provisioned Throughput. + // For more information, see Run inference using a Provisioned Throughput + // (https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) + // in the Amazon Bedrock User Guide. + // + // * If you use a custom model, first purchase Provisioned Throughput for + // it. Then specify the ARN of the resulting provisioned model. For more + // information, see Use a custom model in Amazon Bedrock (https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) + // in the Amazon Bedrock User Guide. + // + // ModelId is a required field + ModelId *string `location:"uri" locationName:"modelId" min:"1" type:"string" required:"true"` + + // A system prompt to pass to the model. + System []*SystemContentBlock `locationName:"system" type:"list"` + + // Configuration information for the tools that the model can use when generating + // a response. + // + // This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere + // Command R+, and Mistral Large models. + ToolConfig *ToolConfiguration `locationName:"toolConfig" type:"structure"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConverseInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConverseInput"} + if s.Messages == nil { + invalidParams.Add(request.NewErrParamRequired("Messages")) + } + if s.ModelId == nil { + invalidParams.Add(request.NewErrParamRequired("ModelId")) + } + if s.ModelId != nil && len(*s.ModelId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ModelId", 1)) + } + if s.InferenceConfig != nil { + if err := s.InferenceConfig.Validate(); err != nil { + invalidParams.AddNested("InferenceConfig", err.(request.ErrInvalidParams)) + } + } + if s.Messages != nil { + for i, v := range s.Messages { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Messages", i), err.(request.ErrInvalidParams)) + } + } + } + if s.System != nil { + for i, v := range s.System { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "System", i), err.(request.ErrInvalidParams)) + } + } + } + if s.ToolConfig != nil { + if err := s.ToolConfig.Validate(); err != nil { + invalidParams.AddNested("ToolConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAdditionalModelResponseFieldPaths sets the AdditionalModelResponseFieldPaths field's value. +func (s *ConverseInput) SetAdditionalModelResponseFieldPaths(v []*string) *ConverseInput { + s.AdditionalModelResponseFieldPaths = v + return s +} + +// SetInferenceConfig sets the InferenceConfig field's value. +func (s *ConverseInput) SetInferenceConfig(v *InferenceConfiguration) *ConverseInput { + s.InferenceConfig = v + return s +} + +// SetMessages sets the Messages field's value. +func (s *ConverseInput) SetMessages(v []*Message) *ConverseInput { + s.Messages = v + return s +} + +// SetModelId sets the ModelId field's value. +func (s *ConverseInput) SetModelId(v string) *ConverseInput { + s.ModelId = &v + return s +} + +// SetSystem sets the System field's value. +func (s *ConverseInput) SetSystem(v []*SystemContentBlock) *ConverseInput { + s.System = v + return s +} + +// SetToolConfig sets the ToolConfig field's value. +func (s *ConverseInput) SetToolConfig(v *ToolConfiguration) *ConverseInput { + s.ToolConfig = v + return s +} + +// Metrics for a call to Converse (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html). +type ConverseMetrics struct { + _ struct{} `type:"structure"` + + // The latency of the call to Converse, in milliseconds. + // + // LatencyMs is a required field + LatencyMs *int64 `locationName:"latencyMs" type:"long" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseMetrics) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseMetrics) GoString() string { + return s.String() +} + +// SetLatencyMs sets the LatencyMs field's value. +func (s *ConverseMetrics) SetLatencyMs(v int64) *ConverseMetrics { + s.LatencyMs = &v + return s +} + +type ConverseOutput struct { + _ struct{} `type:"structure"` + + // Metrics for the call to Converse. + // + // Metrics is a required field + Metrics *ConverseMetrics `locationName:"metrics" type:"structure" required:"true"` + + // The result from the call to Converse. + // + // Output is a required field + Output *ConverseOutput_ `locationName:"output" type:"structure" required:"true"` + + // The reason why the model stopped generating output. + // + // StopReason is a required field + StopReason *string `locationName:"stopReason" type:"string" required:"true" enum:"StopReason"` + + // The total number of tokens used in the call to Converse. The total includes + // the tokens input to the model and the tokens generated by the model. + // + // Usage is a required field + Usage *TokenUsage `locationName:"usage" type:"structure" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseOutput) GoString() string { + return s.String() +} + +// SetMetrics sets the Metrics field's value. +func (s *ConverseOutput) SetMetrics(v *ConverseMetrics) *ConverseOutput { + s.Metrics = v + return s +} + +// SetOutput sets the Output field's value. +func (s *ConverseOutput) SetOutput(v *ConverseOutput_) *ConverseOutput { + s.Output = v + return s +} + +// SetStopReason sets the StopReason field's value. +func (s *ConverseOutput) SetStopReason(v string) *ConverseOutput { + s.StopReason = &v + return s +} + +// SetUsage sets the Usage field's value. +func (s *ConverseOutput) SetUsage(v *TokenUsage) *ConverseOutput { + s.Usage = v + return s +} + +// The output from a call to Converse (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html). +type ConverseOutput_ struct { + _ struct{} `type:"structure"` + + // The message that the model generates. + Message *Message `locationName:"message" type:"structure"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseOutput_) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseOutput_) GoString() string { + return s.String() +} + +// SetMessage sets the Message field's value. +func (s *ConverseOutput_) SetMessage(v *Message) *ConverseOutput_ { + s.Message = v + return s +} + +type ConverseStreamInput struct { + _ struct{} `type:"structure"` + + // Additional model parameters field paths to return in the response. ConverseStream + // returns the requested fields as a JSON Pointer object in the additionalModelResultFields + // field. The following is example JSON for additionalModelResponseFieldPaths. + // + // [ "/stop_sequence" ] + // + // For information about the JSON Pointer syntax, see the Internet Engineering + // Task Force (IETF) (https://datatracker.ietf.org/doc/html/rfc6901) documentation. + // + // ConverseStream rejects an empty JSON Pointer or incorrectly structured JSON + // Pointer with a 400 error code. if the JSON Pointer is valid, but the requested + // field is not in the model response, it is ignored by ConverseStream. + AdditionalModelResponseFieldPaths []*string `locationName:"additionalModelResponseFieldPaths" type:"list"` + + // Inference parameters to pass to the model. ConverseStream supports a base + // set of inference parameters. If you need to pass additional parameters that + // the model supports, use the additionalModelRequestFields request field. + InferenceConfig *InferenceConfiguration `locationName:"inferenceConfig" type:"structure"` + + // The messages that you want to send to the model. + // + // Messages is a required field + Messages []*Message `locationName:"messages" type:"list" required:"true"` + + // The ID for the model. + // + // The modelId to provide depends on the type of model that you use: + // + // * If you use a base model, specify the model ID or its ARN. For a list + // of model IDs for base models, see Amazon Bedrock base model IDs (on-demand + // throughput) (https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) + // in the Amazon Bedrock User Guide. + // + // * If you use a provisioned model, specify the ARN of the Provisioned Throughput. + // For more information, see Run inference using a Provisioned Throughput + // (https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) + // in the Amazon Bedrock User Guide. + // + // * If you use a custom model, first purchase Provisioned Throughput for + // it. Then specify the ARN of the resulting provisioned model. For more + // information, see Use a custom model in Amazon Bedrock (https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) + // in the Amazon Bedrock User Guide. + // + // ModelId is a required field + ModelId *string `location:"uri" locationName:"modelId" min:"1" type:"string" required:"true"` + + // A system prompt to send to the model. + System []*SystemContentBlock `locationName:"system" type:"list"` + + // Configuration information for the tools that the model can use when generating + // a response. + // + // This field is only supported by Anthropic Claude 3 models. + ToolConfig *ToolConfiguration `locationName:"toolConfig" type:"structure"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseStreamInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseStreamInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConverseStreamInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConverseStreamInput"} + if s.Messages == nil { + invalidParams.Add(request.NewErrParamRequired("Messages")) + } + if s.ModelId == nil { + invalidParams.Add(request.NewErrParamRequired("ModelId")) + } + if s.ModelId != nil && len(*s.ModelId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ModelId", 1)) + } + if s.InferenceConfig != nil { + if err := s.InferenceConfig.Validate(); err != nil { + invalidParams.AddNested("InferenceConfig", err.(request.ErrInvalidParams)) + } + } + if s.Messages != nil { + for i, v := range s.Messages { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Messages", i), err.(request.ErrInvalidParams)) + } + } + } + if s.System != nil { + for i, v := range s.System { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "System", i), err.(request.ErrInvalidParams)) + } + } + } + if s.ToolConfig != nil { + if err := s.ToolConfig.Validate(); err != nil { + invalidParams.AddNested("ToolConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAdditionalModelResponseFieldPaths sets the AdditionalModelResponseFieldPaths field's value. +func (s *ConverseStreamInput) SetAdditionalModelResponseFieldPaths(v []*string) *ConverseStreamInput { + s.AdditionalModelResponseFieldPaths = v + return s +} + +// SetInferenceConfig sets the InferenceConfig field's value. +func (s *ConverseStreamInput) SetInferenceConfig(v *InferenceConfiguration) *ConverseStreamInput { + s.InferenceConfig = v + return s +} + +// SetMessages sets the Messages field's value. +func (s *ConverseStreamInput) SetMessages(v []*Message) *ConverseStreamInput { + s.Messages = v + return s +} + +// SetModelId sets the ModelId field's value. +func (s *ConverseStreamInput) SetModelId(v string) *ConverseStreamInput { + s.ModelId = &v + return s +} + +// SetSystem sets the System field's value. +func (s *ConverseStreamInput) SetSystem(v []*SystemContentBlock) *ConverseStreamInput { + s.System = v + return s +} + +// SetToolConfig sets the ToolConfig field's value. +func (s *ConverseStreamInput) SetToolConfig(v *ToolConfiguration) *ConverseStreamInput { + s.ToolConfig = v + return s +} + +// A conversation stream metadata event. +type ConverseStreamMetadataEvent struct { + _ struct{} `type:"structure"` + + // The metrics for the conversation stream metadata event. + // + // Metrics is a required field + Metrics *ConverseStreamMetrics `locationName:"metrics" type:"structure" required:"true"` + + // Usage information for the conversation stream event. + // + // Usage is a required field + Usage *TokenUsage `locationName:"usage" type:"structure" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseStreamMetadataEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseStreamMetadataEvent) GoString() string { + return s.String() +} + +// SetMetrics sets the Metrics field's value. +func (s *ConverseStreamMetadataEvent) SetMetrics(v *ConverseStreamMetrics) *ConverseStreamMetadataEvent { + s.Metrics = v + return s +} + +// SetUsage sets the Usage field's value. +func (s *ConverseStreamMetadataEvent) SetUsage(v *TokenUsage) *ConverseStreamMetadataEvent { + s.Usage = v + return s +} + +// The ConverseStreamMetadataEvent is and event in the ConverseStreamOutput_ group of events. +func (s *ConverseStreamMetadataEvent) eventConverseStreamOutput_() {} + +// UnmarshalEvent unmarshals the EventStream Message into the ConverseStreamMetadataEvent value. +// This method is only used internally within the SDK's EventStream handling. +func (s *ConverseStreamMetadataEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + if err := payloadUnmarshaler.UnmarshalPayload( + bytes.NewReader(msg.Payload), s, + ); err != nil { + return err + } + return nil +} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (s *ConverseStreamMetadataEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +// Metrics for the stream. +type ConverseStreamMetrics struct { + _ struct{} `type:"structure"` + + // The latency for the streaming request, in milliseconds. + // + // LatencyMs is a required field + LatencyMs *int64 `locationName:"latencyMs" type:"long" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseStreamMetrics) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseStreamMetrics) GoString() string { + return s.String() +} + +// SetLatencyMs sets the LatencyMs field's value. +func (s *ConverseStreamMetrics) SetLatencyMs(v int64) *ConverseStreamMetrics { + s.LatencyMs = &v + return s +} + +type ConverseStreamOutput struct { + _ struct{} `type:"structure" payload:"Stream"` + + eventStream *ConverseStreamEventStream +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseStreamOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ConverseStreamOutput) GoString() string { + return s.String() +} + +// GetStream returns the type to interact with the event stream. +func (s *ConverseStreamOutput) GetStream() *ConverseStreamEventStream { + return s.eventStream +} + +// ConverseStreamOutput_Event groups together all EventStream +// events writes for ConverseStreamOutput_. +// +// These events are: +// +// - ContentBlockDeltaEvent +// - ContentBlockStartEvent +// - ContentBlockStopEvent +// - MessageStartEvent +// - MessageStopEvent +// - ConverseStreamMetadataEvent +type ConverseStreamOutput_Event interface { + eventConverseStreamOutput_() + eventstreamapi.Marshaler + eventstreamapi.Unmarshaler +} + +// ConverseStreamOutput_Reader provides the interface for reading to the stream. The +// default implementation for this interface will be ConverseStreamOutput_. +// +// The reader's Close method must allow multiple concurrent calls. +// +// These events are: +// +// - ContentBlockDeltaEvent +// - ContentBlockStartEvent +// - ContentBlockStopEvent +// - MessageStartEvent +// - MessageStopEvent +// - ConverseStreamMetadataEvent +// - ConverseStreamOutput_UnknownEvent +type ConverseStreamOutput_Reader interface { + // Returns a channel of events as they are read from the event stream. + Events() <-chan ConverseStreamOutput_Event + + // Close will stop the reader reading events from the stream. + Close() error + + // Returns any error that has occurred while reading from the event stream. + Err() error +} + +type readConverseStreamOutput_ struct { + eventReader *eventstreamapi.EventReader + stream chan ConverseStreamOutput_Event + err *eventstreamapi.OnceError + + done chan struct{} + closeOnce sync.Once +} + +func newReadConverseStreamOutput_(eventReader *eventstreamapi.EventReader) *readConverseStreamOutput_ { + r := &readConverseStreamOutput_{ + eventReader: eventReader, + stream: make(chan ConverseStreamOutput_Event), + done: make(chan struct{}), + err: eventstreamapi.NewOnceError(), + } + go r.readEventStream() + + return r +} + +// Close will close the underlying event stream reader. +func (r *readConverseStreamOutput_) Close() error { + r.closeOnce.Do(r.safeClose) + return r.Err() +} + +func (r *readConverseStreamOutput_) ErrorSet() <-chan struct{} { + return r.err.ErrorSet() +} + +func (r *readConverseStreamOutput_) Closed() <-chan struct{} { + return r.done +} + +func (r *readConverseStreamOutput_) safeClose() { + close(r.done) +} + +func (r *readConverseStreamOutput_) Err() error { + return r.err.Err() +} + +func (r *readConverseStreamOutput_) Events() <-chan ConverseStreamOutput_Event { + return r.stream +} + +func (r *readConverseStreamOutput_) readEventStream() { + defer r.Close() + defer close(r.stream) + + for { + event, err := r.eventReader.ReadEvent() + if err != nil { + if err == io.EOF { + return + } + select { + case <-r.done: + // If closed already ignore the error + return + default: + } + if _, ok := err.(*eventstreamapi.UnknownMessageTypeError); ok { + continue + } + r.err.SetError(err) + return + } + + select { + case r.stream <- event.(ConverseStreamOutput_Event): + case <-r.done: + return + } + } +} + +type unmarshalerForConverseStreamOutput_Event struct { + metadata protocol.ResponseMetadata +} + +func (u unmarshalerForConverseStreamOutput_Event) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) { + switch eventType { + case "contentBlockDelta": + return &ContentBlockDeltaEvent{}, nil + case "contentBlockStart": + return &ContentBlockStartEvent{}, nil + case "contentBlockStop": + return &ContentBlockStopEvent{}, nil + case "messageStart": + return &MessageStartEvent{}, nil + case "messageStop": + return &MessageStopEvent{}, nil + case "metadata": + return &ConverseStreamMetadataEvent{}, nil + case "internalServerException": + return newErrorInternalServerException(u.metadata).(eventstreamapi.Unmarshaler), nil + case "modelStreamErrorException": + return newErrorModelStreamErrorException(u.metadata).(eventstreamapi.Unmarshaler), nil + case "throttlingException": + return newErrorThrottlingException(u.metadata).(eventstreamapi.Unmarshaler), nil + case "validationException": + return newErrorValidationException(u.metadata).(eventstreamapi.Unmarshaler), nil + default: + return &ConverseStreamOutput_UnknownEvent{Type: eventType}, nil + } +} + +// ConverseStreamOutput_UnknownEvent provides a failsafe event for the +// ConverseStreamOutput_ group of events when an unknown event is received. +type ConverseStreamOutput_UnknownEvent struct { + Type string + Message eventstream.Message +} + +// The ConverseStreamOutput_UnknownEvent is and event in the ConverseStreamOutput_ +// group of events. +func (s *ConverseStreamOutput_UnknownEvent) eventConverseStreamOutput_() {} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (e *ConverseStreamOutput_UnknownEvent) MarshalEvent(pm protocol.PayloadMarshaler) ( + msg eventstream.Message, err error, +) { + return e.Message.Clone(), nil +} + +// UnmarshalEvent unmarshals the EventStream Message into the ConverseStreamOutput_ value. +// This method is only used internally within the SDK's EventStream handling. +func (e *ConverseStreamOutput_UnknownEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + e.Message = msg.Clone() + return nil +} + +// Image content for a message. +type ImageBlock struct { + _ struct{} `type:"structure"` + + // The format of the image. + // + // Format is a required field + Format *string `locationName:"format" type:"string" required:"true" enum:"ImageFormat"` + + // The source for the image. + // + // Source is a required field + Source *ImageSource `locationName:"source" type:"structure" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ImageBlock) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ImageBlock) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ImageBlock) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ImageBlock"} + if s.Format == nil { + invalidParams.Add(request.NewErrParamRequired("Format")) + } + if s.Source == nil { + invalidParams.Add(request.NewErrParamRequired("Source")) + } + if s.Source != nil { + if err := s.Source.Validate(); err != nil { + invalidParams.AddNested("Source", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFormat sets the Format field's value. +func (s *ImageBlock) SetFormat(v string) *ImageBlock { + s.Format = &v + return s +} + +// SetSource sets the Source field's value. +func (s *ImageBlock) SetSource(v *ImageSource) *ImageBlock { + s.Source = v + return s +} + +// The source for an image. +type ImageSource struct { + _ struct{} `type:"structure"` + + // The raw image bytes for the image. If you use an AWS SDK, you don't need + // to base64 encode the image bytes. + // Bytes is automatically base64 encoded/decoded by the SDK. + Bytes []byte `locationName:"bytes" min:"1" type:"blob"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ImageSource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ImageSource) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ImageSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ImageSource"} + if s.Bytes != nil && len(s.Bytes) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Bytes", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBytes sets the Bytes field's value. +func (s *ImageSource) SetBytes(v []byte) *ImageSource { + s.Bytes = v + return s +} + +// Base inference parameters to pass to a model in a call to Converse (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) +// or ConverseStream (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html). +// For more information, see Inference parameters for foundation models (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). +// +// If you need to pass additional parameters that the model supports, use the +// additionalModelRequestFields request field in the call to Converse or ConverseStream. +// For more information, see Model parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). +type InferenceConfiguration struct { + _ struct{} `type:"structure"` + + // The maximum number of tokens to allow in the generated response. The default + // value is the maximum allowed value for the model that you are using. For + // more information, see Inference parameters for foundatio{ "messages": [ { + // "role": "user", "content": [ { "text": "what's the weather in Queens, NY + // and Austin, TX?" } ] }, { "role": "assistant", "content": [ { "toolUse": + // { "toolUseId": "1", "name": "get_weather", "input": { "city": "Queens", "state": + // "NY" } } }, { "toolUse": { "toolUseId": "2", "name": "get_weather", "input": + // { "city": "Austin", "state": "TX" } } } ] }, { "role": "user", "content": + // [ { "toolResult": { "toolUseId": "2", "content": [ { "json": { "weather": + // "40" } } ] } }, { "text": "..." }, { "toolResult": { "toolUseId": "1", "content": + // [ { "text": "result text" } ] } } ] } ], "toolConfig": { "tools": [ { "name": + // "get_weather", "description": "Get weather", "inputSchema": { "type": "object", + // "properties": { "city": { "type": "string", "description": "City of location" + // }, "state": { "type": "string", "description": "State of location" } }, "required": + // ["city", "state"] } } ] } } n models (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + MaxTokens *int64 `locationName:"maxTokens" min:"1" type:"integer"` + + // A list of stop sequences. A stop sequence is a sequence of characters that + // causes the model to stop generating the response. + StopSequences []*string `locationName:"stopSequences" type:"list"` + + // The likelihood of the model selecting higher-probability options while generating + // a response. A lower value makes the model more likely to choose higher-probability + // options, while a higher value makes the model more likely to choose lower-probability + // options. + // + // The default value is the default value for the model that you are using. + // For more information, see Inference parameters for foundation models (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + Temperature *float64 `locationName:"temperature" type:"float"` + + // The percentage of most-likely candidates that the model considers for the + // next token. For example, if you choose a value of 0.8 for topP, the model + // selects from the top 80% of the probability distribution of tokens that could + // be next in the sequence. + // + // The default value is the default value for the model that you are using. + // For more information, see Inference parameters for foundation models (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + TopP *float64 `locationName:"topP" type:"float"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InferenceConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InferenceConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InferenceConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InferenceConfiguration"} + if s.MaxTokens != nil && *s.MaxTokens < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxTokens", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxTokens sets the MaxTokens field's value. +func (s *InferenceConfiguration) SetMaxTokens(v int64) *InferenceConfiguration { + s.MaxTokens = &v + return s +} + +// SetStopSequences sets the StopSequences field's value. +func (s *InferenceConfiguration) SetStopSequences(v []*string) *InferenceConfiguration { + s.StopSequences = v + return s +} + +// SetTemperature sets the Temperature field's value. +func (s *InferenceConfiguration) SetTemperature(v float64) *InferenceConfiguration { + s.Temperature = &v + return s +} + +// SetTopP sets the TopP field's value. +func (s *InferenceConfiguration) SetTopP(v float64) *InferenceConfiguration { + s.TopP = &v + return s +} + +// An internal server error occurred. Retry your request. +type InternalServerException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InternalServerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InternalServerException) GoString() string { + return s.String() +} + +// The InternalServerException is and event in the ConverseStreamOutput_ group of events. +func (s *InternalServerException) eventConverseStreamOutput_() {} + +// The InternalServerException is and event in the ResponseStream group of events. +func (s *InternalServerException) eventResponseStream() {} + +// UnmarshalEvent unmarshals the EventStream Message into the InternalServerException value. +// This method is only used internally within the SDK's EventStream handling. +func (s *InternalServerException) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + if err := payloadUnmarshaler.UnmarshalPayload( + bytes.NewReader(msg.Payload), s, + ); err != nil { + return err + } + return nil +} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (s *InternalServerException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +func newErrorInternalServerException(v protocol.ResponseMetadata) error { + return &InternalServerException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InternalServerException) Code() string { + return "InternalServerException" +} + +// Message returns the exception's message. +func (s *InternalServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InternalServerException) OrigErr() error { + return nil +} + +func (s *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *InternalServerException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InternalServerException) RequestID() string { + return s.RespMetadata.RequestID +} + +type InvokeModelInput struct { + _ struct{} `type:"structure" payload:"Body"` + + // The desired MIME type of the inference body in the response. The default + // value is application/json. + Accept *string `location:"header" locationName:"Accept" type:"string"` + + // The prompt and inference parameters in the format specified in the contentType + // in the header. To see the format and content of the request and response + // bodies for different models, refer to Inference parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + // For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) + // in the Bedrock User Guide. + // + // Body is a sensitive parameter and its value will be + // replaced with "sensitive" in string returned by InvokeModelInput's + // String and GoString methods. + // + // Body is a required field + Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"` + + // The MIME type of the input data in the request. The default value is application/json. + ContentType *string `location:"header" locationName:"Content-Type" type:"string"` + + // The unique identifier of the guardrail that you want to use. If you don't + // provide a value, no guardrail is applied to the invocation. + // + // An error will be thrown in the following situations. + // + // * You don't provide a guardrail identifier but you specify the amazon-bedrock-guardrailConfig + // field in the request body. + // + // * You enable the guardrail but the contentType isn't application/json. + // + // * You provide a guardrail identifier, but guardrailVersion isn't specified. + GuardrailIdentifier *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailIdentifier" type:"string"` + + // The version number for the guardrail. The value can also be DRAFT. + GuardrailVersion *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailVersion" type:"string"` + + // The unique identifier of the model to invoke to run inference. + // + // The modelId to provide depends on the type of model that you use: + // + // * If you use a base model, specify the model ID or its ARN. For a list + // of model IDs for base models, see Amazon Bedrock base model IDs (on-demand + // throughput) (https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) + // in the Amazon Bedrock User Guide. + // + // * If you use a provisioned model, specify the ARN of the Provisioned Throughput. + // For more information, see Run inference using a Provisioned Throughput + // (https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) + // in the Amazon Bedrock User Guide. + // + // * If you use a custom model, first purchase Provisioned Throughput for + // it. Then specify the ARN of the resulting provisioned model. For more + // information, see Use a custom model in Amazon Bedrock (https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) + // in the Amazon Bedrock User Guide. + // + // ModelId is a required field + ModelId *string `location:"uri" locationName:"modelId" min:"1" type:"string" required:"true"` + + // Specifies whether to enable or disable the Bedrock trace. If enabled, you + // can see the full Bedrock trace. + Trace *string `location:"header" locationName:"X-Amzn-Bedrock-Trace" type:"string" enum:"Trace"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InvokeModelInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InvokeModelInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InvokeModelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InvokeModelInput"} + if s.Body == nil { + invalidParams.Add(request.NewErrParamRequired("Body")) + } + if s.ModelId == nil { + invalidParams.Add(request.NewErrParamRequired("ModelId")) + } + if s.ModelId != nil && len(*s.ModelId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ModelId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccept sets the Accept field's value. +func (s *InvokeModelInput) SetAccept(v string) *InvokeModelInput { + s.Accept = &v + return s +} + +// SetBody sets the Body field's value. +func (s *InvokeModelInput) SetBody(v []byte) *InvokeModelInput { + s.Body = v + return s +} + +// SetContentType sets the ContentType field's value. +func (s *InvokeModelInput) SetContentType(v string) *InvokeModelInput { + s.ContentType = &v + return s +} + +// SetGuardrailIdentifier sets the GuardrailIdentifier field's value. +func (s *InvokeModelInput) SetGuardrailIdentifier(v string) *InvokeModelInput { + s.GuardrailIdentifier = &v + return s +} + +// SetGuardrailVersion sets the GuardrailVersion field's value. +func (s *InvokeModelInput) SetGuardrailVersion(v string) *InvokeModelInput { + s.GuardrailVersion = &v + return s +} + +// SetModelId sets the ModelId field's value. +func (s *InvokeModelInput) SetModelId(v string) *InvokeModelInput { + s.ModelId = &v + return s +} + +// SetTrace sets the Trace field's value. +func (s *InvokeModelInput) SetTrace(v string) *InvokeModelInput { + s.Trace = &v + return s +} + +type InvokeModelOutput struct { + _ struct{} `type:"structure" payload:"Body"` + + // Inference response from the model in the format specified in the contentType + // header. To see the format and content of the request and response bodies + // for different models, refer to Inference parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + // + // Body is a sensitive parameter and its value will be + // replaced with "sensitive" in string returned by InvokeModelOutput's + // String and GoString methods. + // + // Body is a required field + Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"` + + // The MIME type of the inference result. + // + // ContentType is a required field + ContentType *string `location:"header" locationName:"Content-Type" type:"string" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InvokeModelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InvokeModelOutput) GoString() string { + return s.String() +} + +// SetBody sets the Body field's value. +func (s *InvokeModelOutput) SetBody(v []byte) *InvokeModelOutput { + s.Body = v + return s +} + +// SetContentType sets the ContentType field's value. +func (s *InvokeModelOutput) SetContentType(v string) *InvokeModelOutput { + s.ContentType = &v + return s +} + +type InvokeModelWithResponseStreamInput struct { + _ struct{} `type:"structure" payload:"Body"` + + // The desired MIME type of the inference body in the response. The default + // value is application/json. + Accept *string `location:"header" locationName:"X-Amzn-Bedrock-Accept" type:"string"` + + // The prompt and inference parameters in the format specified in the contentType + // in the header. To see the format and content of the request and response + // bodies for different models, refer to Inference parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + // For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) + // in the Bedrock User Guide. + // + // Body is a sensitive parameter and its value will be + // replaced with "sensitive" in string returned by InvokeModelWithResponseStreamInput's + // String and GoString methods. + // + // Body is a required field + Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"` + + // The MIME type of the input data in the request. The default value is application/json. + ContentType *string `location:"header" locationName:"Content-Type" type:"string"` + + // The unique identifier of the guardrail that you want to use. If you don't + // provide a value, no guardrail is applied to the invocation. + // + // An error is thrown in the following situations. + // + // * You don't provide a guardrail identifier but you specify the amazon-bedrock-guardrailConfig + // field in the request body. + // + // * You enable the guardrail but the contentType isn't application/json. + // + // * You provide a guardrail identifier, but guardrailVersion isn't specified. + GuardrailIdentifier *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailIdentifier" type:"string"` + + // The version number for the guardrail. The value can also be DRAFT. + GuardrailVersion *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailVersion" type:"string"` + + // The unique identifier of the model to invoke to run inference. + // + // The modelId to provide depends on the type of model that you use: + // + // * If you use a base model, specify the model ID or its ARN. For a list + // of model IDs for base models, see Amazon Bedrock base model IDs (on-demand + // throughput) (https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) + // in the Amazon Bedrock User Guide. + // + // * If you use a provisioned model, specify the ARN of the Provisioned Throughput. + // For more information, see Run inference using a Provisioned Throughput + // (https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) + // in the Amazon Bedrock User Guide. + // + // * If you use a custom model, first purchase Provisioned Throughput for + // it. Then specify the ARN of the resulting provisioned model. For more + // information, see Use a custom model in Amazon Bedrock (https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) + // in the Amazon Bedrock User Guide. + // + // ModelId is a required field + ModelId *string `location:"uri" locationName:"modelId" min:"1" type:"string" required:"true"` + + // Specifies whether to enable or disable the Bedrock trace. If enabled, you + // can see the full Bedrock trace. + Trace *string `location:"header" locationName:"X-Amzn-Bedrock-Trace" type:"string" enum:"Trace"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InvokeModelWithResponseStreamInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InvokeModelWithResponseStreamInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InvokeModelWithResponseStreamInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InvokeModelWithResponseStreamInput"} + if s.Body == nil { + invalidParams.Add(request.NewErrParamRequired("Body")) + } + if s.ModelId == nil { + invalidParams.Add(request.NewErrParamRequired("ModelId")) + } + if s.ModelId != nil && len(*s.ModelId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ModelId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccept sets the Accept field's value. +func (s *InvokeModelWithResponseStreamInput) SetAccept(v string) *InvokeModelWithResponseStreamInput { + s.Accept = &v + return s +} + +// SetBody sets the Body field's value. +func (s *InvokeModelWithResponseStreamInput) SetBody(v []byte) *InvokeModelWithResponseStreamInput { + s.Body = v + return s +} + +// SetContentType sets the ContentType field's value. +func (s *InvokeModelWithResponseStreamInput) SetContentType(v string) *InvokeModelWithResponseStreamInput { + s.ContentType = &v + return s +} + +// SetGuardrailIdentifier sets the GuardrailIdentifier field's value. +func (s *InvokeModelWithResponseStreamInput) SetGuardrailIdentifier(v string) *InvokeModelWithResponseStreamInput { + s.GuardrailIdentifier = &v + return s +} + +// SetGuardrailVersion sets the GuardrailVersion field's value. +func (s *InvokeModelWithResponseStreamInput) SetGuardrailVersion(v string) *InvokeModelWithResponseStreamInput { + s.GuardrailVersion = &v + return s +} + +// SetModelId sets the ModelId field's value. +func (s *InvokeModelWithResponseStreamInput) SetModelId(v string) *InvokeModelWithResponseStreamInput { + s.ModelId = &v + return s +} + +// SetTrace sets the Trace field's value. +func (s *InvokeModelWithResponseStreamInput) SetTrace(v string) *InvokeModelWithResponseStreamInput { + s.Trace = &v + return s +} + +type InvokeModelWithResponseStreamOutput struct { + _ struct{} `type:"structure" payload:"Body"` + + eventStream *InvokeModelWithResponseStreamEventStream + + // The MIME type of the inference result. + // + // ContentType is a required field + ContentType *string `location:"header" locationName:"X-Amzn-Bedrock-Content-Type" type:"string" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InvokeModelWithResponseStreamOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s InvokeModelWithResponseStreamOutput) GoString() string { + return s.String() +} + +// SetContentType sets the ContentType field's value. +func (s *InvokeModelWithResponseStreamOutput) SetContentType(v string) *InvokeModelWithResponseStreamOutput { + s.ContentType = &v + return s +} + +// GetStream returns the type to interact with the event stream. +func (s *InvokeModelWithResponseStreamOutput) GetStream() *InvokeModelWithResponseStreamEventStream { + return s.eventStream +} + +// A message in the Message (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Message.html) +// field. Use to send a message in a call to Converse (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html). +type Message struct { + _ struct{} `type:"structure"` + + // The message content. + // + // Content is a required field + Content []*ContentBlock `locationName:"content" type:"list" required:"true"` + + // The role that the message plays in the message. + // + // Role is a required field + Role *string `locationName:"role" type:"string" required:"true" enum:"ConversationRole"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s Message) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s Message) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Message) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Message"} + if s.Content == nil { + invalidParams.Add(request.NewErrParamRequired("Content")) + } + if s.Role == nil { + invalidParams.Add(request.NewErrParamRequired("Role")) + } + if s.Content != nil { + for i, v := range s.Content { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Content", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContent sets the Content field's value. +func (s *Message) SetContent(v []*ContentBlock) *Message { + s.Content = v + return s +} + +// SetRole sets the Role field's value. +func (s *Message) SetRole(v string) *Message { + s.Role = &v + return s +} + +// The start of a message. +type MessageStartEvent struct { + _ struct{} `type:"structure"` + + // The role for the message. + // + // Role is a required field + Role *string `locationName:"role" type:"string" required:"true" enum:"ConversationRole"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s MessageStartEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s MessageStartEvent) GoString() string { + return s.String() +} + +// SetRole sets the Role field's value. +func (s *MessageStartEvent) SetRole(v string) *MessageStartEvent { + s.Role = &v + return s +} + +// The MessageStartEvent is and event in the ConverseStreamOutput_ group of events. +func (s *MessageStartEvent) eventConverseStreamOutput_() {} + +// UnmarshalEvent unmarshals the EventStream Message into the MessageStartEvent value. +// This method is only used internally within the SDK's EventStream handling. +func (s *MessageStartEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + if err := payloadUnmarshaler.UnmarshalPayload( + bytes.NewReader(msg.Payload), s, + ); err != nil { + return err + } + return nil +} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (s *MessageStartEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +// The stop event for a message. +type MessageStopEvent struct { + _ struct{} `type:"structure"` + + // The reason why the model stopped generating output. + // + // StopReason is a required field + StopReason *string `locationName:"stopReason" type:"string" required:"true" enum:"StopReason"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s MessageStopEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s MessageStopEvent) GoString() string { + return s.String() +} + +// SetStopReason sets the StopReason field's value. +func (s *MessageStopEvent) SetStopReason(v string) *MessageStopEvent { + s.StopReason = &v + return s +} + +// The MessageStopEvent is and event in the ConverseStreamOutput_ group of events. +func (s *MessageStopEvent) eventConverseStreamOutput_() {} + +// UnmarshalEvent unmarshals the EventStream Message into the MessageStopEvent value. +// This method is only used internally within the SDK's EventStream handling. +func (s *MessageStopEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + if err := payloadUnmarshaler.UnmarshalPayload( + bytes.NewReader(msg.Payload), s, + ); err != nil { + return err + } + return nil +} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (s *MessageStopEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +// The request failed due to an error while processing the model. +type ModelErrorException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` + + // The original status code. + OriginalStatusCode *int64 `locationName:"originalStatusCode" min:"100" type:"integer"` + + // The resource name. + ResourceName *string `locationName:"resourceName" type:"string"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ModelErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ModelErrorException) GoString() string { + return s.String() +} + +func newErrorModelErrorException(v protocol.ResponseMetadata) error { + return &ModelErrorException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *ModelErrorException) Code() string { + return "ModelErrorException" +} + +// Message returns the exception's message. +func (s *ModelErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ModelErrorException) OrigErr() error { + return nil +} + +func (s *ModelErrorException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *ModelErrorException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *ModelErrorException) RequestID() string { + return s.RespMetadata.RequestID +} + +// The model specified in the request is not ready to serve inference requests. +type ModelNotReadyException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ModelNotReadyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ModelNotReadyException) GoString() string { + return s.String() +} + +func newErrorModelNotReadyException(v protocol.ResponseMetadata) error { + return &ModelNotReadyException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *ModelNotReadyException) Code() string { + return "ModelNotReadyException" +} + +// Message returns the exception's message. +func (s *ModelNotReadyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ModelNotReadyException) OrigErr() error { + return nil +} + +func (s *ModelNotReadyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *ModelNotReadyException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *ModelNotReadyException) RequestID() string { + return s.RespMetadata.RequestID +} + +// An error occurred while streaming the response. Retry your request. +type ModelStreamErrorException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` + + // The original message. + OriginalMessage *string `locationName:"originalMessage" type:"string"` + + // The original status code. + OriginalStatusCode *int64 `locationName:"originalStatusCode" min:"100" type:"integer"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ModelStreamErrorException) String() string { + return awsutil.Prettify(s) +} + // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s InternalServerException) GoString() string { +func (s ModelStreamErrorException) GoString() string { return s.String() } -// The InternalServerException is and event in the ResponseStream group of events. -func (s *InternalServerException) eventResponseStream() {} +// The ModelStreamErrorException is and event in the ConverseStreamOutput_ group of events. +func (s *ModelStreamErrorException) eventConverseStreamOutput_() {} -// UnmarshalEvent unmarshals the EventStream Message into the InternalServerException value. +// The ModelStreamErrorException is and event in the ResponseStream group of events. +func (s *ModelStreamErrorException) eventResponseStream() {} + +// UnmarshalEvent unmarshals the EventStream Message into the ModelStreamErrorException value. // This method is only used internally within the SDK's EventStream handling. -func (s *InternalServerException) UnmarshalEvent( +func (s *ModelStreamErrorException) UnmarshalEvent( payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message, ) error { @@ -519,7 +3119,7 @@ func (s *InternalServerException) UnmarshalEvent( // MarshalEvent marshals the type into an stream event value. This method // should only used internally within the SDK's EventStream handling. -func (s *InternalServerException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { +func (s *ModelStreamErrorException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) var buf bytes.Buffer if err = pm.MarshalPayload(&buf, s); err != nil { @@ -529,19 +3129,19 @@ func (s *InternalServerException) MarshalEvent(pm protocol.PayloadMarshaler) (ms return msg, err } -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ +func newErrorModelStreamErrorException(v protocol.ResponseMetadata) error { + return &ModelStreamErrorException{ RespMetadata: v, } } // Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" +func (s *ModelStreamErrorException) Code() string { + return "ModelStreamErrorException" } // Message returns the exception's message. -func (s *InternalServerException) Message() string { +func (s *ModelStreamErrorException) Message() string { if s.Message_ != nil { return *s.Message_ } @@ -549,88 +3149,31 @@ func (s *InternalServerException) Message() string { } // OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { +func (s *ModelStreamErrorException) OrigErr() error { return nil } -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +func (s *ModelStreamErrorException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } // Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { +func (s *ModelStreamErrorException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { +func (s *ModelStreamErrorException) RequestID() string { return s.RespMetadata.RequestID } -type InvokeModelInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The desired MIME type of the inference body in the response. The default - // value is application/json. - Accept *string `location:"header" locationName:"Accept" type:"string"` - - // The prompt and inference parameters in the format specified in the contentType - // in the header. To see the format and content of the request and response - // bodies for different models, refer to Inference parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - // For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) - // in the Bedrock User Guide. - // - // Body is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by InvokeModelInput's - // String and GoString methods. - // - // Body is a required field - Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"` - - // The MIME type of the input data in the request. The default value is application/json. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // The unique identifier of the guardrail that you want to use. If you don't - // provide a value, no guardrail is applied to the invocation. - // - // An error will be thrown in the following situations. - // - // * You don't provide a guardrail identifier but you specify the amazon-bedrock-guardrailConfig - // field in the request body. - // - // * You enable the guardrail but the contentType isn't application/json. - // - // * You provide a guardrail identifier, but guardrailVersion isn't specified. - GuardrailIdentifier *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailIdentifier" type:"string"` - - // The version number for the guardrail. The value can also be DRAFT. - GuardrailVersion *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailVersion" type:"string"` - - // The unique identifier of the model to invoke to run inference. - // - // The modelId to provide depends on the type of model that you use: - // - // * If you use a base model, specify the model ID or its ARN. For a list - // of model IDs for base models, see Amazon Bedrock base model IDs (on-demand - // throughput) (https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) - // in the Amazon Bedrock User Guide. - // - // * If you use a provisioned model, specify the ARN of the Provisioned Throughput. - // For more information, see Run inference using a Provisioned Throughput - // (https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) - // in the Amazon Bedrock User Guide. - // - // * If you use a custom model, first purchase Provisioned Throughput for - // it. Then specify the ARN of the resulting provisioned model. For more - // information, see Use a custom model in Amazon Bedrock (https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) - // in the Amazon Bedrock User Guide. - // - // ModelId is a required field - ModelId *string `location:"uri" locationName:"modelId" min:"1" type:"string" required:"true"` +// The request took too long to process. Processing time exceeded the model +// timeout length. +type ModelTimeoutException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - // Specifies whether to enable or disable the Bedrock trace. If enabled, you - // can see the full Bedrock trace. - Trace *string `location:"header" locationName:"X-Amzn-Bedrock-Trace" type:"string" enum:"Trace"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. @@ -638,7 +3181,7 @@ type InvokeModelInput struct { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s InvokeModelInput) String() string { +func (s ModelTimeoutException) String() string { return awsutil.Prettify(s) } @@ -647,89 +3190,151 @@ func (s InvokeModelInput) String() string { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s InvokeModelInput) GoString() string { +func (s ModelTimeoutException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *InvokeModelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InvokeModelInput"} - if s.Body == nil { - invalidParams.Add(request.NewErrParamRequired("Body")) +// The ModelTimeoutException is and event in the ResponseStream group of events. +func (s *ModelTimeoutException) eventResponseStream() {} + +// UnmarshalEvent unmarshals the EventStream Message into the ModelTimeoutException value. +// This method is only used internally within the SDK's EventStream handling. +func (s *ModelTimeoutException) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + if err := payloadUnmarshaler.UnmarshalPayload( + bytes.NewReader(msg.Payload), s, + ); err != nil { + return err } - if s.ModelId == nil { - invalidParams.Add(request.NewErrParamRequired("ModelId")) + return nil +} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (s *ModelTimeoutException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err } - if s.ModelId != nil && len(*s.ModelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelId", 1)) + msg.Payload = buf.Bytes() + return msg, err +} + +func newErrorModelTimeoutException(v protocol.ResponseMetadata) error { + return &ModelTimeoutException{ + RespMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s *ModelTimeoutException) Code() string { + return "ModelTimeoutException" +} + +// Message returns the exception's message. +func (s *ModelTimeoutException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ModelTimeoutException) OrigErr() error { return nil } -// SetAccept sets the Accept field's value. -func (s *InvokeModelInput) SetAccept(v string) *InvokeModelInput { - s.Accept = &v - return s +func (s *ModelTimeoutException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetBody sets the Body field's value. -func (s *InvokeModelInput) SetBody(v []byte) *InvokeModelInput { - s.Body = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s *ModelTimeoutException) StatusCode() int { + return s.RespMetadata.StatusCode } -// SetContentType sets the ContentType field's value. -func (s *InvokeModelInput) SetContentType(v string) *InvokeModelInput { - s.ContentType = &v - return s +// RequestID returns the service's response RequestID for request. +func (s *ModelTimeoutException) RequestID() string { + return s.RespMetadata.RequestID } -// SetGuardrailIdentifier sets the GuardrailIdentifier field's value. -func (s *InvokeModelInput) SetGuardrailIdentifier(v string) *InvokeModelInput { - s.GuardrailIdentifier = &v - return s +// Payload content included in the response. +type PayloadPart struct { + _ struct{} `type:"structure" sensitive:"true"` + + // Base64-encoded bytes of payload data. + // + // Bytes is a sensitive parameter and its value will be + // replaced with "sensitive" in string returned by PayloadPart's + // String and GoString methods. + // + // Bytes is automatically base64 encoded/decoded by the SDK. + Bytes []byte `locationName:"bytes" type:"blob" sensitive:"true"` } -// SetGuardrailVersion sets the GuardrailVersion field's value. -func (s *InvokeModelInput) SetGuardrailVersion(v string) *InvokeModelInput { - s.GuardrailVersion = &v - return s +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PayloadPart) String() string { + return awsutil.Prettify(s) } -// SetModelId sets the ModelId field's value. -func (s *InvokeModelInput) SetModelId(v string) *InvokeModelInput { - s.ModelId = &v - return s +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PayloadPart) GoString() string { + return s.String() } -// SetTrace sets the Trace field's value. -func (s *InvokeModelInput) SetTrace(v string) *InvokeModelInput { - s.Trace = &v +// SetBytes sets the Bytes field's value. +func (s *PayloadPart) SetBytes(v []byte) *PayloadPart { + s.Bytes = v return s } -type InvokeModelOutput struct { - _ struct{} `type:"structure" payload:"Body"` - - // Inference response from the model in the format specified in the contentType - // header. To see the format and content of the request and response bodies - // for different models, refer to Inference parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - // - // Body is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by InvokeModelOutput's - // String and GoString methods. - // - // Body is a required field - Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"` +// The PayloadPart is and event in the ResponseStream group of events. +func (s *PayloadPart) eventResponseStream() {} + +// UnmarshalEvent unmarshals the EventStream Message into the PayloadPart value. +// This method is only used internally within the SDK's EventStream handling. +func (s *PayloadPart) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + if err := payloadUnmarshaler.UnmarshalPayload( + bytes.NewReader(msg.Payload), s, + ); err != nil { + return err + } + return nil +} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (s *PayloadPart) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +// The specified resource ARN was not found. Check the ARN and try your request +// again. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - // The MIME type of the inference result. - // - // ContentType is a required field - ContentType *string `location:"header" locationName:"Content-Type" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. @@ -737,7 +3342,7 @@ type InvokeModelOutput struct { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s InvokeModelOutput) String() string { +func (s ResourceNotFoundException) String() string { return awsutil.Prettify(s) } @@ -746,219 +3351,216 @@ func (s InvokeModelOutput) String() string { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s InvokeModelOutput) GoString() string { +func (s ResourceNotFoundException) GoString() string { return s.String() } -// SetBody sets the Body field's value. -func (s *InvokeModelOutput) SetBody(v []byte) *InvokeModelOutput { - s.Body = v - return s +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + RespMetadata: v, + } } -// SetContentType sets the ContentType field's value. -func (s *InvokeModelOutput) SetContentType(v string) *InvokeModelOutput { - s.ContentType = &v - return s +// Code returns the exception type name. +func (s *ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" } -type InvokeModelWithResponseStreamInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The desired MIME type of the inference body in the response. The default - // value is application/json. - Accept *string `location:"header" locationName:"X-Amzn-Bedrock-Accept" type:"string"` - - // The prompt and inference parameters in the format specified in the contentType - // in the header. To see the format and content of the request and response - // bodies for different models, refer to Inference parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - // For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) - // in the Bedrock User Guide. - // - // Body is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by InvokeModelWithResponseStreamInput's - // String and GoString methods. - // - // Body is a required field - Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"` - - // The MIME type of the input data in the request. The default value is application/json. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` +// Message returns the exception's message. +func (s *ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The unique identifier of the guardrail that you want to use. If you don't - // provide a value, no guardrail is applied to the invocation. - // - // An error is thrown in the following situations. - // - // * You don't provide a guardrail identifier but you specify the amazon-bedrock-guardrailConfig - // field in the request body. - // - // * You enable the guardrail but the contentType isn't application/json. - // - // * You provide a guardrail identifier, but guardrailVersion isn't specified. - GuardrailIdentifier *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailIdentifier" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ResourceNotFoundException) OrigErr() error { + return nil +} - // The version number for the guardrail. The value can also be DRAFT. - GuardrailVersion *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailVersion" type:"string"` +func (s *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The unique identifier of the model to invoke to run inference. - // - // The modelId to provide depends on the type of model that you use: - // - // * If you use a base model, specify the model ID or its ARN. For a list - // of model IDs for base models, see Amazon Bedrock base model IDs (on-demand - // throughput) (https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) - // in the Amazon Bedrock User Guide. - // - // * If you use a provisioned model, specify the ARN of the Provisioned Throughput. - // For more information, see Run inference using a Provisioned Throughput - // (https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) - // in the Amazon Bedrock User Guide. - // - // * If you use a custom model, first purchase Provisioned Throughput for - // it. Then specify the ARN of the resulting provisioned model. For more - // information, see Use a custom model in Amazon Bedrock (https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) - // in the Amazon Bedrock User Guide. - // - // ModelId is a required field - ModelId *string `location:"uri" locationName:"modelId" min:"1" type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s *ResourceNotFoundException) StatusCode() int { + return s.RespMetadata.StatusCode +} - // Specifies whether to enable or disable the Bedrock trace. If enabled, you - // can see the full Bedrock trace. - Trace *string `location:"header" locationName:"X-Amzn-Bedrock-Trace" type:"string" enum:"Trace"` +// RequestID returns the service's response RequestID for request. +func (s *ResourceNotFoundException) RequestID() string { + return s.RespMetadata.RequestID } -// String returns the string representation. +// ResponseStreamEvent groups together all EventStream +// events writes for ResponseStream. // -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvokeModelWithResponseStreamInput) String() string { - return awsutil.Prettify(s) +// These events are: +// +// - PayloadPart +type ResponseStreamEvent interface { + eventResponseStream() + eventstreamapi.Marshaler + eventstreamapi.Unmarshaler } -// GoString returns the string representation. +// ResponseStreamReader provides the interface for reading to the stream. The +// default implementation for this interface will be ResponseStream. // -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvokeModelWithResponseStreamInput) GoString() string { - return s.String() +// The reader's Close method must allow multiple concurrent calls. +// +// These events are: +// +// - PayloadPart +// - ResponseStreamUnknownEvent +type ResponseStreamReader interface { + // Returns a channel of events as they are read from the event stream. + Events() <-chan ResponseStreamEvent + + // Close will stop the reader reading events from the stream. + Close() error + + // Returns any error that has occurred while reading from the event stream. + Err() error } -// Validate inspects the fields of the type to determine if they are valid. -func (s *InvokeModelWithResponseStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InvokeModelWithResponseStreamInput"} - if s.Body == nil { - invalidParams.Add(request.NewErrParamRequired("Body")) - } - if s.ModelId == nil { - invalidParams.Add(request.NewErrParamRequired("ModelId")) - } - if s.ModelId != nil && len(*s.ModelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelId", 1)) - } +type readResponseStream struct { + eventReader *eventstreamapi.EventReader + stream chan ResponseStreamEvent + err *eventstreamapi.OnceError - if invalidParams.Len() > 0 { - return invalidParams + done chan struct{} + closeOnce sync.Once +} + +func newReadResponseStream(eventReader *eventstreamapi.EventReader) *readResponseStream { + r := &readResponseStream{ + eventReader: eventReader, + stream: make(chan ResponseStreamEvent), + done: make(chan struct{}), + err: eventstreamapi.NewOnceError(), } - return nil + go r.readEventStream() + + return r } -// SetAccept sets the Accept field's value. -func (s *InvokeModelWithResponseStreamInput) SetAccept(v string) *InvokeModelWithResponseStreamInput { - s.Accept = &v - return s +// Close will close the underlying event stream reader. +func (r *readResponseStream) Close() error { + r.closeOnce.Do(r.safeClose) + return r.Err() } -// SetBody sets the Body field's value. -func (s *InvokeModelWithResponseStreamInput) SetBody(v []byte) *InvokeModelWithResponseStreamInput { - s.Body = v - return s +func (r *readResponseStream) ErrorSet() <-chan struct{} { + return r.err.ErrorSet() } -// SetContentType sets the ContentType field's value. -func (s *InvokeModelWithResponseStreamInput) SetContentType(v string) *InvokeModelWithResponseStreamInput { - s.ContentType = &v - return s +func (r *readResponseStream) Closed() <-chan struct{} { + return r.done } -// SetGuardrailIdentifier sets the GuardrailIdentifier field's value. -func (s *InvokeModelWithResponseStreamInput) SetGuardrailIdentifier(v string) *InvokeModelWithResponseStreamInput { - s.GuardrailIdentifier = &v - return s +func (r *readResponseStream) safeClose() { + close(r.done) } -// SetGuardrailVersion sets the GuardrailVersion field's value. -func (s *InvokeModelWithResponseStreamInput) SetGuardrailVersion(v string) *InvokeModelWithResponseStreamInput { - s.GuardrailVersion = &v - return s +func (r *readResponseStream) Err() error { + return r.err.Err() } -// SetModelId sets the ModelId field's value. -func (s *InvokeModelWithResponseStreamInput) SetModelId(v string) *InvokeModelWithResponseStreamInput { - s.ModelId = &v - return s +func (r *readResponseStream) Events() <-chan ResponseStreamEvent { + return r.stream } -// SetTrace sets the Trace field's value. -func (s *InvokeModelWithResponseStreamInput) SetTrace(v string) *InvokeModelWithResponseStreamInput { - s.Trace = &v - return s +func (r *readResponseStream) readEventStream() { + defer r.Close() + defer close(r.stream) + + for { + event, err := r.eventReader.ReadEvent() + if err != nil { + if err == io.EOF { + return + } + select { + case <-r.done: + // If closed already ignore the error + return + default: + } + if _, ok := err.(*eventstreamapi.UnknownMessageTypeError); ok { + continue + } + r.err.SetError(err) + return + } + + select { + case r.stream <- event.(ResponseStreamEvent): + case <-r.done: + return + } + } } -type InvokeModelWithResponseStreamOutput struct { - _ struct{} `type:"structure" payload:"Body"` - - eventStream *InvokeModelWithResponseStreamEventStream - - // The MIME type of the inference result. - // - // ContentType is a required field - ContentType *string `location:"header" locationName:"X-Amzn-Bedrock-Content-Type" type:"string" required:"true"` +type unmarshalerForResponseStreamEvent struct { + metadata protocol.ResponseMetadata } -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvokeModelWithResponseStreamOutput) String() string { - return awsutil.Prettify(s) +func (u unmarshalerForResponseStreamEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) { + switch eventType { + case "chunk": + return &PayloadPart{}, nil + case "internalServerException": + return newErrorInternalServerException(u.metadata).(eventstreamapi.Unmarshaler), nil + case "modelStreamErrorException": + return newErrorModelStreamErrorException(u.metadata).(eventstreamapi.Unmarshaler), nil + case "modelTimeoutException": + return newErrorModelTimeoutException(u.metadata).(eventstreamapi.Unmarshaler), nil + case "throttlingException": + return newErrorThrottlingException(u.metadata).(eventstreamapi.Unmarshaler), nil + case "validationException": + return newErrorValidationException(u.metadata).(eventstreamapi.Unmarshaler), nil + default: + return &ResponseStreamUnknownEvent{Type: eventType}, nil + } } -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvokeModelWithResponseStreamOutput) GoString() string { - return s.String() +// ResponseStreamUnknownEvent provides a failsafe event for the +// ResponseStream group of events when an unknown event is received. +type ResponseStreamUnknownEvent struct { + Type string + Message eventstream.Message } -// SetContentType sets the ContentType field's value. -func (s *InvokeModelWithResponseStreamOutput) SetContentType(v string) *InvokeModelWithResponseStreamOutput { - s.ContentType = &v - return s +// The ResponseStreamUnknownEvent is and event in the ResponseStream +// group of events. +func (s *ResponseStreamUnknownEvent) eventResponseStream() {} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (e *ResponseStreamUnknownEvent) MarshalEvent(pm protocol.PayloadMarshaler) ( + msg eventstream.Message, err error, +) { + return e.Message.Clone(), nil } -// GetStream returns the type to interact with the event stream. -func (s *InvokeModelWithResponseStreamOutput) GetStream() *InvokeModelWithResponseStreamEventStream { - return s.eventStream +// UnmarshalEvent unmarshals the EventStream Message into the ResponseStream value. +// This method is only used internally within the SDK's EventStream handling. +func (e *ResponseStreamUnknownEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + e.Message = msg.Clone() + return nil } -// The request failed due to an error while processing the model. -type ModelErrorException struct { +// The number of requests exceeds the service quota. Resubmit your request later. +type ServiceQuotaExceededException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` - - // The original status code. - OriginalStatusCode *int64 `locationName:"originalStatusCode" min:"100" type:"integer"` - - // The resource name. - ResourceName *string `locationName:"resourceName" type:"string"` } // String returns the string representation. @@ -966,7 +3568,7 @@ type ModelErrorException struct { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ModelErrorException) String() string { +func (s ServiceQuotaExceededException) String() string { return awsutil.Prettify(s) } @@ -975,23 +3577,23 @@ func (s ModelErrorException) String() string { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ModelErrorException) GoString() string { +func (s ServiceQuotaExceededException) GoString() string { return s.String() } -func newErrorModelErrorException(v protocol.ResponseMetadata) error { - return &ModelErrorException{ +func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { + return &ServiceQuotaExceededException{ RespMetadata: v, } } // Code returns the exception type name. -func (s *ModelErrorException) Code() string { - return "ModelErrorException" +func (s *ServiceQuotaExceededException) Code() string { + return "ServiceQuotaExceededException" } // Message returns the exception's message. -func (s *ModelErrorException) Message() string { +func (s *ServiceQuotaExceededException) Message() string { if s.Message_ != nil { return *s.Message_ } @@ -999,30 +3601,34 @@ func (s *ModelErrorException) Message() string { } // OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ModelErrorException) OrigErr() error { +func (s *ServiceQuotaExceededException) OrigErr() error { return nil } -func (s *ModelErrorException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +func (s *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. -func (s *ModelErrorException) StatusCode() int { +func (s *ServiceQuotaExceededException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. -func (s *ModelErrorException) RequestID() string { +func (s *ServiceQuotaExceededException) RequestID() string { return s.RespMetadata.RequestID } -// The model specified in the request is not ready to serve inference requests. -type ModelNotReadyException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` +// The model must request a specific tool. +// +// This field is only supported by Anthropic Claude 3 models. +type SpecificToolChoice struct { + _ struct{} `type:"structure"` - Message_ *string `locationName:"message" type:"string"` + // The name of the tool that the model must request. + // + // Name is a required field + Name *string `locationName:"name" min:"1" type:"string" required:"true"` } // String returns the string representation. @@ -1030,7 +3636,7 @@ type ModelNotReadyException struct { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ModelNotReadyException) String() string { +func (s SpecificToolChoice) String() string { return awsutil.Prettify(s) } @@ -1039,60 +3645,38 @@ func (s ModelNotReadyException) String() string { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ModelNotReadyException) GoString() string { +func (s SpecificToolChoice) GoString() string { return s.String() } -func newErrorModelNotReadyException(v protocol.ResponseMetadata) error { - return &ModelNotReadyException{ - RespMetadata: v, +// Validate inspects the fields of the type to determine if they are valid. +func (s *SpecificToolChoice) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SpecificToolChoice"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) } -} - -// Code returns the exception type name. -func (s *ModelNotReadyException) Code() string { - return "ModelNotReadyException" -} - -// Message returns the exception's message. -func (s *ModelNotReadyException) Message() string { - if s.Message_ != nil { - return *s.Message_ + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) } - return "" -} -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ModelNotReadyException) OrigErr() error { + if invalidParams.Len() > 0 { + return invalidParams + } return nil } -func (s *ModelNotReadyException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ModelNotReadyException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ModelNotReadyException) RequestID() string { - return s.RespMetadata.RequestID +// SetName sets the Name field's value. +func (s *SpecificToolChoice) SetName(v string) *SpecificToolChoice { + s.Name = &v + return s } -// An error occurred while streaming the response. Retry your request. -type ModelStreamErrorException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The original message. - OriginalMessage *string `locationName:"originalMessage" type:"string"` +// A system content block +type SystemContentBlock struct { + _ struct{} `type:"structure"` - // The original status code. - OriginalStatusCode *int64 `locationName:"originalStatusCode" min:"100" type:"integer"` + // A system prompt for the model. + Text *string `locationName:"text" min:"1" type:"string"` } // String returns the string representation. @@ -1100,7 +3684,7 @@ type ModelStreamErrorException struct { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ModelStreamErrorException) String() string { +func (s SystemContentBlock) String() string { return awsutil.Prettify(s) } @@ -1109,80 +3693,31 @@ func (s ModelStreamErrorException) String() string { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ModelStreamErrorException) GoString() string { +func (s SystemContentBlock) GoString() string { return s.String() } -// The ModelStreamErrorException is and event in the ResponseStream group of events. -func (s *ModelStreamErrorException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ModelStreamErrorException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ModelStreamErrorException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ModelStreamErrorException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorModelStreamErrorException(v protocol.ResponseMetadata) error { - return &ModelStreamErrorException{ - RespMetadata: v, +// Validate inspects the fields of the type to determine if they are valid. +func (s *SystemContentBlock) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SystemContentBlock"} + if s.Text != nil && len(*s.Text) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Text", 1)) } -} - -// Code returns the exception type name. -func (s *ModelStreamErrorException) Code() string { - return "ModelStreamErrorException" -} -// Message returns the exception's message. -func (s *ModelStreamErrorException) Message() string { - if s.Message_ != nil { - return *s.Message_ + if invalidParams.Len() > 0 { + return invalidParams } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ModelStreamErrorException) OrigErr() error { return nil } -func (s *ModelStreamErrorException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ModelStreamErrorException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ModelStreamErrorException) RequestID() string { - return s.RespMetadata.RequestID +// SetText sets the Text field's value. +func (s *SystemContentBlock) SetText(v string) *SystemContentBlock { + s.Text = &v + return s } -// The request took too long to process. Processing time exceeded the model -// timeout length. -type ModelTimeoutException struct { +// The number of requests exceeds the limit. Resubmit your request later. +type ThrottlingException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` @@ -1194,7 +3729,7 @@ type ModelTimeoutException struct { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ModelTimeoutException) String() string { +func (s ThrottlingException) String() string { return awsutil.Prettify(s) } @@ -1203,16 +3738,19 @@ func (s ModelTimeoutException) String() string { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ModelTimeoutException) GoString() string { +func (s ThrottlingException) GoString() string { return s.String() } -// The ModelTimeoutException is and event in the ResponseStream group of events. -func (s *ModelTimeoutException) eventResponseStream() {} +// The ThrottlingException is and event in the ConverseStreamOutput_ group of events. +func (s *ThrottlingException) eventConverseStreamOutput_() {} -// UnmarshalEvent unmarshals the EventStream Message into the ModelTimeoutException value. +// The ThrottlingException is and event in the ResponseStream group of events. +func (s *ThrottlingException) eventResponseStream() {} + +// UnmarshalEvent unmarshals the EventStream Message into the ThrottlingException value. // This method is only used internally within the SDK's EventStream handling. -func (s *ModelTimeoutException) UnmarshalEvent( +func (s *ThrottlingException) UnmarshalEvent( payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message, ) error { @@ -1226,7 +3764,7 @@ func (s *ModelTimeoutException) UnmarshalEvent( // MarshalEvent marshals the type into an stream event value. This method // should only used internally within the SDK's EventStream handling. -func (s *ModelTimeoutException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { +func (s *ThrottlingException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) var buf bytes.Buffer if err = pm.MarshalPayload(&buf, s); err != nil { @@ -1236,19 +3774,19 @@ func (s *ModelTimeoutException) MarshalEvent(pm protocol.PayloadMarshaler) (msg return msg, err } -func newErrorModelTimeoutException(v protocol.ResponseMetadata) error { - return &ModelTimeoutException{ +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ RespMetadata: v, } } // Code returns the exception type name. -func (s *ModelTimeoutException) Code() string { - return "ModelTimeoutException" +func (s *ThrottlingException) Code() string { + return "ThrottlingException" } // Message returns the exception's message. -func (s *ModelTimeoutException) Message() string { +func (s *ThrottlingException) Message() string { if s.Message_ != nil { return *s.Message_ } @@ -1256,36 +3794,42 @@ func (s *ModelTimeoutException) Message() string { } // OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ModelTimeoutException) OrigErr() error { +func (s *ThrottlingException) OrigErr() error { return nil } -func (s *ModelTimeoutException) Error() string { +func (s *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. -func (s *ModelTimeoutException) StatusCode() int { +func (s *ThrottlingException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. -func (s *ModelTimeoutException) RequestID() string { +func (s *ThrottlingException) RequestID() string { return s.RespMetadata.RequestID } -// Payload content included in the response. -type PayloadPart struct { - _ struct{} `type:"structure" sensitive:"true"` +// The tokens used in a message API inference call. +type TokenUsage struct { + _ struct{} `type:"structure"` - // Base64-encoded bytes of payload data. + // The number of tokens sent in the request to the model. // - // Bytes is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PayloadPart's - // String and GoString methods. + // InputTokens is a required field + InputTokens *int64 `locationName:"inputTokens" type:"integer" required:"true"` + + // The number of tokens that the model generated for the request. // - // Bytes is automatically base64 encoded/decoded by the SDK. - Bytes []byte `locationName:"bytes" type:"blob" sensitive:"true"` + // OutputTokens is a required field + OutputTokens *int64 `locationName:"outputTokens" type:"integer" required:"true"` + + // The total of input tokens and tokens generated by the model. + // + // TotalTokens is a required field + TotalTokens *int64 `locationName:"totalTokens" type:"integer" required:"true"` } // String returns the string representation. @@ -1293,7 +3837,7 @@ type PayloadPart struct { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s PayloadPart) String() string { +func (s TokenUsage) String() string { return awsutil.Prettify(s) } @@ -1302,52 +3846,34 @@ func (s PayloadPart) String() string { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s PayloadPart) GoString() string { +func (s TokenUsage) GoString() string { return s.String() } -// SetBytes sets the Bytes field's value. -func (s *PayloadPart) SetBytes(v []byte) *PayloadPart { - s.Bytes = v +// SetInputTokens sets the InputTokens field's value. +func (s *TokenUsage) SetInputTokens(v int64) *TokenUsage { + s.InputTokens = &v return s } -// The PayloadPart is and event in the ResponseStream group of events. -func (s *PayloadPart) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the PayloadPart value. -// This method is only used internally within the SDK's EventStream handling. -func (s *PayloadPart) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil +// SetOutputTokens sets the OutputTokens field's value. +func (s *TokenUsage) SetOutputTokens(v int64) *TokenUsage { + s.OutputTokens = &v + return s } -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *PayloadPart) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err +// SetTotalTokens sets the TotalTokens field's value. +func (s *TokenUsage) SetTotalTokens(v int64) *TokenUsage { + s.TotalTokens = &v + return s } -// The specified resource ARN was not found. Check the ARN and try your request -// again. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` +// Information about a tool that you can use with the Converse API. +type Tool struct { + _ struct{} `type:"structure"` - Message_ *string `locationName:"message" type:"string"` + // The specfication for the tool. + ToolSpec *ToolSpecification `locationName:"toolSpec" type:"structure"` } // String returns the string representation. @@ -1355,7 +3881,7 @@ type ResourceNotFoundException struct { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ResourceNotFoundException) String() string { +func (s Tool) String() string { return awsutil.Prettify(s) } @@ -1364,216 +3890,294 @@ func (s ResourceNotFoundException) String() string { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ResourceNotFoundException) GoString() string { +func (s Tool) GoString() string { return s.String() } -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, +// Validate inspects the fields of the type to determine if they are valid. +func (s *Tool) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tool"} + if s.ToolSpec != nil { + if err := s.ToolSpec.Validate(); err != nil { + invalidParams.AddNested("ToolSpec", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams } + return nil } -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" +// SetToolSpec sets the ToolSpec field's value. +func (s *Tool) SetToolSpec(v *ToolSpecification) *Tool { + s.ToolSpec = v + return s } -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" +// Forces a model to use a tool. +type ToolChoice struct { + _ struct{} `type:"structure"` + + // The model must request at least one tool (no text is generated). + Any *AnyToolChoice `locationName:"any" type:"structure"` + + // The Model automatically decides if a tool should be called or to whether + // to generate text instead. + Auto *AutoToolChoice `locationName:"auto" type:"structure"` + + // The Model must request the specified tool. + Tool *SpecificToolChoice `locationName:"tool" type:"structure"` } -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolChoice) String() string { + return awsutil.Prettify(s) } -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolChoice) GoString() string { + return s.String() } -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode +// Validate inspects the fields of the type to determine if they are valid. +func (s *ToolChoice) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ToolChoice"} + if s.Tool != nil { + if err := s.Tool.Validate(); err != nil { + invalidParams.AddNested("Tool", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID +// SetAny sets the Any field's value. +func (s *ToolChoice) SetAny(v *AnyToolChoice) *ToolChoice { + s.Any = v + return s } -// ResponseStreamEvent groups together all EventStream -// events writes for ResponseStream. -// -// These events are: -// -// - PayloadPart -type ResponseStreamEvent interface { - eventResponseStream() - eventstreamapi.Marshaler - eventstreamapi.Unmarshaler +// SetAuto sets the Auto field's value. +func (s *ToolChoice) SetAuto(v *AutoToolChoice) *ToolChoice { + s.Auto = v + return s } -// ResponseStreamReader provides the interface for reading to the stream. The -// default implementation for this interface will be ResponseStream. -// -// The reader's Close method must allow multiple concurrent calls. -// -// These events are: +// SetTool sets the Tool field's value. +func (s *ToolChoice) SetTool(v *SpecificToolChoice) *ToolChoice { + s.Tool = v + return s +} + +// Configuration information for the tools that you pass to a model. // -// - PayloadPart -// - ResponseStreamUnknownEvent -type ResponseStreamReader interface { - // Returns a channel of events as they are read from the event stream. - Events() <-chan ResponseStreamEvent +// This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere +// Command R+, and Mistral Large models. +type ToolConfiguration struct { + _ struct{} `type:"structure"` - // Close will stop the reader reading events from the stream. - Close() error + // If supported by model, forces the model to request a tool. + ToolChoice *ToolChoice `locationName:"toolChoice" type:"structure"` - // Returns any error that has occurred while reading from the event stream. - Err() error + // An array of tools that you want to pass to a model. + // + // Tools is a required field + Tools []*Tool `locationName:"tools" min:"1" type:"list" required:"true"` } -type readResponseStream struct { - eventReader *eventstreamapi.EventReader - stream chan ResponseStreamEvent - err *eventstreamapi.OnceError +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolConfiguration) String() string { + return awsutil.Prettify(s) +} - done chan struct{} - closeOnce sync.Once +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolConfiguration) GoString() string { + return s.String() } -func newReadResponseStream(eventReader *eventstreamapi.EventReader) *readResponseStream { - r := &readResponseStream{ - eventReader: eventReader, - stream: make(chan ResponseStreamEvent), - done: make(chan struct{}), - err: eventstreamapi.NewOnceError(), +// Validate inspects the fields of the type to determine if they are valid. +func (s *ToolConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ToolConfiguration"} + if s.Tools == nil { + invalidParams.Add(request.NewErrParamRequired("Tools")) + } + if s.Tools != nil && len(s.Tools) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tools", 1)) + } + if s.ToolChoice != nil { + if err := s.ToolChoice.Validate(); err != nil { + invalidParams.AddNested("ToolChoice", err.(request.ErrInvalidParams)) + } + } + if s.Tools != nil { + for i, v := range s.Tools { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tools", i), err.(request.ErrInvalidParams)) + } + } } - go r.readEventStream() - return r + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// Close will close the underlying event stream reader. -func (r *readResponseStream) Close() error { - r.closeOnce.Do(r.safeClose) - return r.Err() +// SetToolChoice sets the ToolChoice field's value. +func (s *ToolConfiguration) SetToolChoice(v *ToolChoice) *ToolConfiguration { + s.ToolChoice = v + return s } -func (r *readResponseStream) ErrorSet() <-chan struct{} { - return r.err.ErrorSet() +// SetTools sets the Tools field's value. +func (s *ToolConfiguration) SetTools(v []*Tool) *ToolConfiguration { + s.Tools = v + return s } -func (r *readResponseStream) Closed() <-chan struct{} { - return r.done +// The schema for the tool. The top level schema type must be object. +type ToolInputSchema struct { + _ struct{} `type:"structure"` } -func (r *readResponseStream) safeClose() { - close(r.done) +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolInputSchema) String() string { + return awsutil.Prettify(s) } -func (r *readResponseStream) Err() error { - return r.err.Err() +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolInputSchema) GoString() string { + return s.String() } -func (r *readResponseStream) Events() <-chan ResponseStreamEvent { - return r.stream +// A tool result block that contains the results for a tool request that the +// model previously made. +type ToolResultBlock struct { + _ struct{} `type:"structure"` + + // The content for tool result content block. + // + // Content is a required field + Content []*ToolResultContentBlock `locationName:"content" type:"list" required:"true"` + + // The status for the tool result content block. + // + // This field is only supported Anthropic Claude 3 models. + Status *string `locationName:"status" type:"string" enum:"ToolResultStatus"` + + // The ID of the tool request that this is the result for. + // + // ToolUseId is a required field + ToolUseId *string `locationName:"toolUseId" min:"1" type:"string" required:"true"` } -func (r *readResponseStream) readEventStream() { - defer r.Close() - defer close(r.stream) +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolResultBlock) String() string { + return awsutil.Prettify(s) +} - for { - event, err := r.eventReader.ReadEvent() - if err != nil { - if err == io.EOF { - return - } - select { - case <-r.done: - // If closed already ignore the error - return - default: - } - if _, ok := err.(*eventstreamapi.UnknownMessageTypeError); ok { +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolResultBlock) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ToolResultBlock) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ToolResultBlock"} + if s.Content == nil { + invalidParams.Add(request.NewErrParamRequired("Content")) + } + if s.ToolUseId == nil { + invalidParams.Add(request.NewErrParamRequired("ToolUseId")) + } + if s.ToolUseId != nil && len(*s.ToolUseId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ToolUseId", 1)) + } + if s.Content != nil { + for i, v := range s.Content { + if v == nil { continue } - r.err.SetError(err) - return - } - - select { - case r.stream <- event.(ResponseStreamEvent): - case <-r.done: - return + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Content", i), err.(request.ErrInvalidParams)) + } } } -} - -type unmarshalerForResponseStreamEvent struct { - metadata protocol.ResponseMetadata -} -func (u unmarshalerForResponseStreamEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) { - switch eventType { - case "chunk": - return &PayloadPart{}, nil - case "internalServerException": - return newErrorInternalServerException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "modelStreamErrorException": - return newErrorModelStreamErrorException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "modelTimeoutException": - return newErrorModelTimeoutException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "throttlingException": - return newErrorThrottlingException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "validationException": - return newErrorValidationException(u.metadata).(eventstreamapi.Unmarshaler), nil - default: - return &ResponseStreamUnknownEvent{Type: eventType}, nil + if invalidParams.Len() > 0 { + return invalidParams } + return nil } -// ResponseStreamUnknownEvent provides a failsafe event for the -// ResponseStream group of events when an unknown event is received. -type ResponseStreamUnknownEvent struct { - Type string - Message eventstream.Message +// SetContent sets the Content field's value. +func (s *ToolResultBlock) SetContent(v []*ToolResultContentBlock) *ToolResultBlock { + s.Content = v + return s } -// The ResponseStreamUnknownEvent is and event in the ResponseStream -// group of events. -func (s *ResponseStreamUnknownEvent) eventResponseStream() {} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (e *ResponseStreamUnknownEvent) MarshalEvent(pm protocol.PayloadMarshaler) ( - msg eventstream.Message, err error, -) { - return e.Message.Clone(), nil +// SetStatus sets the Status field's value. +func (s *ToolResultBlock) SetStatus(v string) *ToolResultBlock { + s.Status = &v + return s } -// UnmarshalEvent unmarshals the EventStream Message into the ResponseStream value. -// This method is only used internally within the SDK's EventStream handling. -func (e *ResponseStreamUnknownEvent) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - e.Message = msg.Clone() - return nil +// SetToolUseId sets the ToolUseId field's value. +func (s *ToolResultBlock) SetToolUseId(v string) *ToolResultBlock { + s.ToolUseId = &v + return s } -// The number of requests exceeds the service quota. Resubmit your request later. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` +// The tool result content block. +type ToolResultContentBlock struct { + _ struct{} `type:"structure"` - Message_ *string `locationName:"message" type:"string"` + // A tool result that is an image. + // + // This field is only supported by Anthropic Claude 3 models. + Image *ImageBlock `locationName:"image" type:"structure"` + + // A tool result that is text. + Text *string `locationName:"text" type:"string"` } // String returns the string representation. @@ -1581,7 +4185,7 @@ type ServiceQuotaExceededException struct { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ServiceQuotaExceededException) String() string { +func (s ToolResultContentBlock) String() string { return awsutil.Prettify(s) } @@ -1590,54 +4194,53 @@ func (s ServiceQuotaExceededException) String() string { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ServiceQuotaExceededException) GoString() string { +func (s ToolResultContentBlock) GoString() string { return s.String() } -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, +// Validate inspects the fields of the type to determine if they are valid. +func (s *ToolResultContentBlock) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ToolResultContentBlock"} + if s.Image != nil { + if err := s.Image.Validate(); err != nil { + invalidParams.AddNested("Image", err.(request.ErrInvalidParams)) + } } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ + if invalidParams.Len() > 0 { + return invalidParams } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { return nil } -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +// SetImage sets the Image field's value. +func (s *ToolResultContentBlock) SetImage(v *ImageBlock) *ToolResultContentBlock { + s.Image = v + return s } -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode +// SetText sets the Text field's value. +func (s *ToolResultContentBlock) SetText(v string) *ToolResultContentBlock { + s.Text = &v + return s } -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} +// The specification for the tool. +type ToolSpecification struct { + _ struct{} `type:"structure"` -// The number of requests exceeds the limit. Resubmit your request later. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + // The description for the tool. + Description *string `locationName:"description" min:"1" type:"string"` - Message_ *string `locationName:"message" type:"string"` + // The input schema for the tool in JSON format. + // + // InputSchema is a required field + InputSchema *ToolInputSchema `locationName:"inputSchema" type:"structure" required:"true"` + + // The name for the tool. + // + // Name is a required field + Name *string `locationName:"name" min:"1" type:"string" required:"true"` } // String returns the string representation. @@ -1645,7 +4248,7 @@ type ThrottlingException struct { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ThrottlingException) String() string { +func (s ToolSpecification) String() string { return awsutil.Prettify(s) } @@ -1654,75 +4257,127 @@ func (s ThrottlingException) String() string { // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". -func (s ThrottlingException) GoString() string { +func (s ToolSpecification) GoString() string { return s.String() } -// The ThrottlingException is and event in the ResponseStream group of events. -func (s *ThrottlingException) eventResponseStream() {} +// Validate inspects the fields of the type to determine if they are valid. +func (s *ToolSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ToolSpecification"} + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + if s.InputSchema == nil { + invalidParams.Add(request.NewErrParamRequired("InputSchema")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } -// UnmarshalEvent unmarshals the EventStream Message into the ThrottlingException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ThrottlingException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err + if invalidParams.Len() > 0 { + return invalidParams } return nil } -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ThrottlingException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err +// SetDescription sets the Description field's value. +func (s *ToolSpecification) SetDescription(v string) *ToolSpecification { + s.Description = &v + return s } -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } +// SetInputSchema sets the InputSchema field's value. +func (s *ToolSpecification) SetInputSchema(v *ToolInputSchema) *ToolSpecification { + s.InputSchema = v + return s } -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" +// SetName sets the Name field's value. +func (s *ToolSpecification) SetName(v string) *ToolSpecification { + s.Name = &v + return s } -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" +// The delta for a tool use block. +type ToolUseBlockDelta struct { + _ struct{} `type:"structure"` + + // The input for a requested tool. + // + // Input is a required field + Input *string `locationName:"input" type:"string" required:"true"` } -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolUseBlockDelta) String() string { + return awsutil.Prettify(s) } -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolUseBlockDelta) GoString() string { + return s.String() } -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode +// SetInput sets the Input field's value. +func (s *ToolUseBlockDelta) SetInput(v string) *ToolUseBlockDelta { + s.Input = &v + return s } -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID +// The start of a tool use block. +type ToolUseBlockStart struct { + _ struct{} `type:"structure"` + + // The name of the tool that the model is requesting to use. + // + // Name is a required field + Name *string `locationName:"name" min:"1" type:"string" required:"true"` + + // The ID for the tool request. + // + // ToolUseId is a required field + ToolUseId *string `locationName:"toolUseId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolUseBlockStart) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ToolUseBlockStart) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *ToolUseBlockStart) SetName(v string) *ToolUseBlockStart { + s.Name = &v + return s +} + +// SetToolUseId sets the ToolUseId field's value. +func (s *ToolUseBlockStart) SetToolUseId(v string) *ToolUseBlockStart { + s.ToolUseId = &v + return s } // Input validation failed. Check your request parameters and retry the request. @@ -1751,6 +4406,9 @@ func (s ValidationException) GoString() string { return s.String() } +// The ValidationException is and event in the ConverseStreamOutput_ group of events. +func (s *ValidationException) eventConverseStreamOutput_() {} + // The ValidationException is and event in the ResponseStream group of events. func (s *ValidationException) eventResponseStream() {} @@ -1818,6 +4476,90 @@ func (s *ValidationException) RequestID() string { return s.RespMetadata.RequestID } +const ( + // ConversationRoleUser is a ConversationRole enum value + ConversationRoleUser = "user" + + // ConversationRoleAssistant is a ConversationRole enum value + ConversationRoleAssistant = "assistant" +) + +// ConversationRole_Values returns all elements of the ConversationRole enum +func ConversationRole_Values() []string { + return []string{ + ConversationRoleUser, + ConversationRoleAssistant, + } +} + +const ( + // ImageFormatPng is a ImageFormat enum value + ImageFormatPng = "png" + + // ImageFormatJpeg is a ImageFormat enum value + ImageFormatJpeg = "jpeg" + + // ImageFormatGif is a ImageFormat enum value + ImageFormatGif = "gif" + + // ImageFormatWebp is a ImageFormat enum value + ImageFormatWebp = "webp" +) + +// ImageFormat_Values returns all elements of the ImageFormat enum +func ImageFormat_Values() []string { + return []string{ + ImageFormatPng, + ImageFormatJpeg, + ImageFormatGif, + ImageFormatWebp, + } +} + +const ( + // StopReasonEndTurn is a StopReason enum value + StopReasonEndTurn = "end_turn" + + // StopReasonToolUse is a StopReason enum value + StopReasonToolUse = "tool_use" + + // StopReasonMaxTokens is a StopReason enum value + StopReasonMaxTokens = "max_tokens" + + // StopReasonStopSequence is a StopReason enum value + StopReasonStopSequence = "stop_sequence" + + // StopReasonContentFiltered is a StopReason enum value + StopReasonContentFiltered = "content_filtered" +) + +// StopReason_Values returns all elements of the StopReason enum +func StopReason_Values() []string { + return []string{ + StopReasonEndTurn, + StopReasonToolUse, + StopReasonMaxTokens, + StopReasonStopSequence, + StopReasonContentFiltered, + } +} + +const ( + // ToolResultStatusSuccess is a ToolResultStatus enum value + ToolResultStatusSuccess = "success" + + // ToolResultStatusError is a ToolResultStatus enum value + ToolResultStatusError = "error" +) + +// ToolResultStatus_Values returns all elements of the ToolResultStatus enum +func ToolResultStatus_Values() []string { + return []string{ + ToolResultStatusSuccess, + ToolResultStatusError, + } +} + const ( // TraceEnabled is a Trace enum value TraceEnabled = "ENABLED" diff --git a/service/bedrockruntime/bedrockruntimeiface/interface.go b/service/bedrockruntime/bedrockruntimeiface/interface.go index 281d1a0a094..4583579101a 100644 --- a/service/bedrockruntime/bedrockruntimeiface/interface.go +++ b/service/bedrockruntime/bedrockruntimeiface/interface.go @@ -26,7 +26,7 @@ import ( // // myFunc uses an SDK service client to make a request to // // Amazon Bedrock Runtime. // func myFunc(svc bedrockruntimeiface.BedrockRuntimeAPI) bool { -// // Make svc.InvokeModel request +// // Make svc.Converse request // } // // func main() { @@ -42,7 +42,7 @@ import ( // type mockBedrockRuntimeClient struct { // bedrockruntimeiface.BedrockRuntimeAPI // } -// func (m *mockBedrockRuntimeClient) InvokeModel(input *bedrockruntime.InvokeModelInput) (*bedrockruntime.InvokeModelOutput, error) { +// func (m *mockBedrockRuntimeClient) Converse(input *bedrockruntime.ConverseInput) (*bedrockruntime.ConverseOutput, error) { // // mock response/functionality // } // @@ -60,6 +60,14 @@ import ( // and waiters. Its suggested to use the pattern above for testing, or using // tooling to generate mocks to satisfy the interfaces. type BedrockRuntimeAPI interface { + Converse(*bedrockruntime.ConverseInput) (*bedrockruntime.ConverseOutput, error) + ConverseWithContext(aws.Context, *bedrockruntime.ConverseInput, ...request.Option) (*bedrockruntime.ConverseOutput, error) + ConverseRequest(*bedrockruntime.ConverseInput) (*request.Request, *bedrockruntime.ConverseOutput) + + ConverseStream(*bedrockruntime.ConverseStreamInput) (*bedrockruntime.ConverseStreamOutput, error) + ConverseStreamWithContext(aws.Context, *bedrockruntime.ConverseStreamInput, ...request.Option) (*bedrockruntime.ConverseStreamOutput, error) + ConverseStreamRequest(*bedrockruntime.ConverseStreamInput) (*request.Request, *bedrockruntime.ConverseStreamOutput) + InvokeModel(*bedrockruntime.InvokeModelInput) (*bedrockruntime.InvokeModelOutput, error) InvokeModelWithContext(aws.Context, *bedrockruntime.InvokeModelInput, ...request.Option) (*bedrockruntime.InvokeModelOutput, error) InvokeModelRequest(*bedrockruntime.InvokeModelInput) (*request.Request, *bedrockruntime.InvokeModelOutput) diff --git a/service/bedrockruntime/eventstream_test.go b/service/bedrockruntime/eventstream_test.go index dadf4b5da2f..c92332f78e8 100644 --- a/service/bedrockruntime/eventstream_test.go +++ b/service/bedrockruntime/eventstream_test.go @@ -34,6 +34,389 @@ var _ context.Context var _ sync.WaitGroup var _ strings.Reader +func TestConverseStream_Read(t *testing.T) { + expectEvents, eventMsgs := mockConverseStreamReadEvents() + sess, cleanupFn, err := eventstreamtest.SetupEventStreamSession(t, + eventstreamtest.ServeEventStream{ + T: t, + Events: eventMsgs, + }, + true, + ) + if err != nil { + t.Fatalf("expect no error, %v", err) + } + defer cleanupFn() + + svc := New(sess) + resp, err := svc.ConverseStream(nil) + if err != nil { + t.Fatalf("expect no error got, %v", err) + } + defer resp.GetStream().Close() + + var i int + for event := range resp.GetStream().Events() { + if event == nil { + t.Errorf("%d, expect event, got nil", i) + } + if e, a := expectEvents[i], event; !reflect.DeepEqual(e, a) { + t.Errorf("%d, expect %T %v, got %T %v", i, e, e, a, a) + } + i++ + } + + if err := resp.GetStream().Err(); err != nil { + t.Errorf("expect no error, %v", err) + } +} + +func TestConverseStream_ReadClose(t *testing.T) { + _, eventMsgs := mockConverseStreamReadEvents() + sess, cleanupFn, err := eventstreamtest.SetupEventStreamSession(t, + eventstreamtest.ServeEventStream{ + T: t, + Events: eventMsgs, + }, + true, + ) + if err != nil { + t.Fatalf("expect no error, %v", err) + } + defer cleanupFn() + + svc := New(sess) + resp, err := svc.ConverseStream(nil) + if err != nil { + t.Fatalf("expect no error got, %v", err) + } + + // Assert calling Err before close does not close the stream. + resp.GetStream().Err() + select { + case _, ok := <-resp.GetStream().Events(): + if !ok { + t.Fatalf("expect stream not to be closed, but was") + } + default: + } + + resp.GetStream().Close() + <-resp.GetStream().Events() + + if err := resp.GetStream().Err(); err != nil { + t.Errorf("expect no error, %v", err) + } +} + +func TestConverseStream_ReadUnknownEvent(t *testing.T) { + expectEvents, eventMsgs := mockConverseStreamReadEvents() + var eventOffset int + + unknownEvent := eventstream.Message{ + Headers: eventstream.Headers{ + eventstreamtest.EventMessageTypeHeader, + { + Name: eventstreamapi.EventTypeHeader, + Value: eventstream.StringValue("UnknownEventName"), + }, + }, + Payload: []byte("some unknown event"), + } + + eventMsgs = append(eventMsgs[:eventOffset], + append([]eventstream.Message{unknownEvent}, eventMsgs[eventOffset:]...)...) + + expectEvents = append(expectEvents[:eventOffset], + append([]ConverseStreamOutput_Event{ + &ConverseStreamOutput_UnknownEvent{ + Type: "UnknownEventName", + Message: unknownEvent, + }, + }, + expectEvents[eventOffset:]...)...) + + sess, cleanupFn, err := eventstreamtest.SetupEventStreamSession(t, + eventstreamtest.ServeEventStream{ + T: t, + Events: eventMsgs, + }, + true, + ) + if err != nil { + t.Fatalf("expect no error, %v", err) + } + defer cleanupFn() + + svc := New(sess) + resp, err := svc.ConverseStream(nil) + if err != nil { + t.Fatalf("expect no error got, %v", err) + } + defer resp.GetStream().Close() + + var i int + for event := range resp.GetStream().Events() { + if event == nil { + t.Errorf("%d, expect event, got nil", i) + } + if e, a := expectEvents[i], event; !reflect.DeepEqual(e, a) { + t.Errorf("%d, expect %T %v, got %T %v", i, e, e, a, a) + } + i++ + } + + if err := resp.GetStream().Err(); err != nil { + t.Errorf("expect no error, %v", err) + } +} + +func BenchmarkConverseStream_Read(b *testing.B) { + _, eventMsgs := mockConverseStreamReadEvents() + var buf bytes.Buffer + encoder := eventstream.NewEncoder(&buf) + for _, msg := range eventMsgs { + if err := encoder.Encode(msg); err != nil { + b.Fatalf("failed to encode message, %v", err) + } + } + stream := &loopReader{source: bytes.NewReader(buf.Bytes())} + + sess := unit.Session + svc := New(sess, &aws.Config{ + Endpoint: aws.String("https://example.com"), + DisableParamValidation: aws.Bool(true), + }) + svc.Handlers.Send.Swap(corehandlers.SendHandler.Name, + request.NamedHandler{Name: "mockSend", + Fn: func(r *request.Request) { + r.HTTPResponse = &http.Response{ + Status: "200 OK", + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(stream), + } + }, + }, + ) + + resp, err := svc.ConverseStream(nil) + if err != nil { + b.Fatalf("failed to create request, %v", err) + } + defer resp.GetStream().Close() + b.ResetTimer() + + for i := 0; i < b.N; i++ { + if err = resp.GetStream().Err(); err != nil { + b.Fatalf("expect no error, got %v", err) + } + event := <-resp.GetStream().Events() + if event == nil { + b.Fatalf("expect event, got nil, %v, %d", resp.GetStream().Err(), i) + } + } +} + +func mockConverseStreamReadEvents() ( + []ConverseStreamOutput_Event, + []eventstream.Message, +) { + expectEvents := []ConverseStreamOutput_Event{ + &ContentBlockDeltaEvent{ + ContentBlockIndex: aws.Int64(123), + Delta: &ContentBlockDelta{ + Text: aws.String("string value goes here"), + ToolUse: &ToolUseBlockDelta{ + Input: aws.String("string value goes here"), + }, + }, + }, + &ContentBlockStartEvent{ + ContentBlockIndex: aws.Int64(123), + Start: &ContentBlockStart{ + ToolUse: &ToolUseBlockStart{ + Name: aws.String("string value goes here"), + ToolUseId: aws.String("string value goes here"), + }, + }, + }, + &ContentBlockStopEvent{ + ContentBlockIndex: aws.Int64(123), + }, + &MessageStartEvent{ + Role: aws.String("string value goes here"), + }, + &MessageStopEvent{ + StopReason: aws.String("string value goes here"), + }, + &ConverseStreamMetadataEvent{ + Metrics: &ConverseStreamMetrics{ + LatencyMs: aws.Int64(1234), + }, + Usage: &TokenUsage{ + InputTokens: aws.Int64(123), + OutputTokens: aws.Int64(123), + TotalTokens: aws.Int64(123), + }, + }, + } + + var marshalers request.HandlerList + marshalers.PushBackNamed(restjson.BuildHandler) + payloadMarshaler := protocol.HandlerPayloadMarshal{ + Marshalers: marshalers, + } + _ = payloadMarshaler + + eventMsgs := []eventstream.Message{ + { + Headers: eventstream.Headers{ + eventstreamtest.EventMessageTypeHeader, + { + Name: eventstreamapi.EventTypeHeader, + Value: eventstream.StringValue("contentBlockDelta"), + }, + }, + Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[0]), + }, + { + Headers: eventstream.Headers{ + eventstreamtest.EventMessageTypeHeader, + { + Name: eventstreamapi.EventTypeHeader, + Value: eventstream.StringValue("contentBlockStart"), + }, + }, + Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[1]), + }, + { + Headers: eventstream.Headers{ + eventstreamtest.EventMessageTypeHeader, + { + Name: eventstreamapi.EventTypeHeader, + Value: eventstream.StringValue("contentBlockStop"), + }, + }, + Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[2]), + }, + { + Headers: eventstream.Headers{ + eventstreamtest.EventMessageTypeHeader, + { + Name: eventstreamapi.EventTypeHeader, + Value: eventstream.StringValue("messageStart"), + }, + }, + Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[3]), + }, + { + Headers: eventstream.Headers{ + eventstreamtest.EventMessageTypeHeader, + { + Name: eventstreamapi.EventTypeHeader, + Value: eventstream.StringValue("messageStop"), + }, + }, + Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[4]), + }, + { + Headers: eventstream.Headers{ + eventstreamtest.EventMessageTypeHeader, + { + Name: eventstreamapi.EventTypeHeader, + Value: eventstream.StringValue("metadata"), + }, + }, + Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[5]), + }, + } + + return expectEvents, eventMsgs +} +func TestConverseStream_ReadException(t *testing.T) { + expectEvents := []ConverseStreamOutput_Event{ + &InternalServerException{ + RespMetadata: protocol.ResponseMetadata{ + StatusCode: 200, + }, + Message_: aws.String("string value goes here"), + }, + } + + var marshalers request.HandlerList + marshalers.PushBackNamed(restjson.BuildHandler) + payloadMarshaler := protocol.HandlerPayloadMarshal{ + Marshalers: marshalers, + } + + eventMsgs := []eventstream.Message{ + { + Headers: eventstream.Headers{ + eventstreamtest.EventExceptionTypeHeader, + { + Name: eventstreamapi.ExceptionTypeHeader, + Value: eventstream.StringValue("internalServerException"), + }, + }, + Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[0]), + }, + } + + sess, cleanupFn, err := eventstreamtest.SetupEventStreamSession(t, + eventstreamtest.ServeEventStream{ + T: t, + Events: eventMsgs, + }, + true, + ) + if err != nil { + t.Fatalf("expect no error, %v", err) + } + defer cleanupFn() + + svc := New(sess) + resp, err := svc.ConverseStream(nil) + if err != nil { + t.Fatalf("expect no error got, %v", err) + } + + defer resp.GetStream().Close() + + <-resp.GetStream().Events() + + err = resp.GetStream().Err() + if err == nil { + t.Fatalf("expect err, got none") + } + + expectErr := &InternalServerException{ + RespMetadata: protocol.ResponseMetadata{ + StatusCode: 200, + }, + Message_: aws.String("string value goes here"), + } + aerr, ok := err.(awserr.Error) + if !ok { + t.Errorf("expect exception, got %T, %#v", err, err) + } + if e, a := expectErr.Code(), aerr.Code(); e != a { + t.Errorf("expect %v, got %v", e, a) + } + if e, a := expectErr.Message(), aerr.Message(); e != a { + t.Errorf("expect %v, got %v", e, a) + } + + if e, a := expectErr, aerr; !reflect.DeepEqual(e, a) { + t.Errorf("expect error %+#v, got %+#v", e, a) + } +} + +var _ awserr.Error = (*InternalServerException)(nil) +var _ awserr.Error = (*ModelStreamErrorException)(nil) +var _ awserr.Error = (*ThrottlingException)(nil) +var _ awserr.Error = (*ValidationException)(nil) + func TestInvokeModelWithResponseStream_Read(t *testing.T) { expectEvents, eventMsgs := mockInvokeModelWithResponseStreamReadEvents() sess, cleanupFn, err := eventstreamtest.SetupEventStreamSession(t, diff --git a/service/cloudtrail/api.go b/service/cloudtrail/api.go index ac583b3583d..7b4bc80cd2d 100644 --- a/service/cloudtrail/api.go +++ b/service/cloudtrail/api.go @@ -143,7 +143,7 @@ func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request, // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -537,9 +537,11 @@ func (c *CloudTrail) CreateEventDataStoreRequest(input *CreateEventDataStoreInpu // // - AccessNotEnabledException // This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// CloudTrail and Organizations. For more information, see How to enable or +// disable trusted access (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) +// in the Organizations User Guide and Prepare For Creating a Trail For Your +// Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) +// in the CloudTrail User Guide. // // - InsufficientDependencyServiceAccessPermissionException // This exception is thrown when the IAM identity that is used to create the @@ -551,7 +553,7 @@ func (c *CloudTrail) CreateEventDataStoreRequest(input *CreateEventDataStoreInpu // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - OrganizationsNotInUseException // This exception is thrown when the request is made from an Amazon Web Services @@ -739,9 +741,11 @@ func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.R // // - AccessNotEnabledException // This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// CloudTrail and Organizations. For more information, see How to enable or +// disable trusted access (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) +// in the Organizations User Guide and Prepare For Creating a Trail For Your +// Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) +// in the CloudTrail User Guide. // // - InsufficientDependencyServiceAccessPermissionException // This exception is thrown when the IAM identity that is used to create the @@ -753,7 +757,7 @@ func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.R // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - OrganizationsNotInUseException // This exception is thrown when the request is made from an Amazon Web Services @@ -994,7 +998,7 @@ func (c *CloudTrail) DeleteEventDataStoreRequest(input *DeleteEventDataStoreInpu // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -1252,7 +1256,7 @@ func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.R // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -1351,9 +1355,11 @@ func (c *CloudTrail) DeregisterOrganizationDelegatedAdminRequest(input *Deregist // // - AccessNotEnabledException // This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// CloudTrail and Organizations. For more information, see How to enable or +// disable trusted access (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) +// in the Organizations User Guide and Prepare For Creating a Trail For Your +// Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) +// in the CloudTrail User Guide. // // - ConflictException // This exception is thrown when the specified resource is not ready for an @@ -1714,9 +1720,11 @@ func (c *CloudTrail) DisableFederationRequest(input *DisableFederationInput) (re // // - AccessNotEnabledException // This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// CloudTrail and Organizations. For more information, see How to enable or +// disable trusted access (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) +// in the Organizations User Guide and Prepare For Creating a Trail For Your +// Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) +// in the CloudTrail User Guide. // // - InsufficientDependencyServiceAccessPermissionException // This exception is thrown when the IAM identity that is used to create the @@ -1728,7 +1736,7 @@ func (c *CloudTrail) DisableFederationRequest(input *DisableFederationInput) (re // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -1865,9 +1873,11 @@ func (c *CloudTrail) EnableFederationRequest(input *EnableFederationInput) (req // // - AccessNotEnabledException // This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// CloudTrail and Organizations. For more information, see How to enable or +// disable trusted access (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) +// in the Organizations User Guide and Prepare For Creating a Trail For Your +// Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) +// in the CloudTrail User Guide. // // - InsufficientDependencyServiceAccessPermissionException // This exception is thrown when the IAM identity that is used to create the @@ -1879,7 +1889,7 @@ func (c *CloudTrail) EnableFederationRequest(input *EnableFederationInput) (req // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -4630,7 +4640,7 @@ func (c *CloudTrail) PutEventSelectorsRequest(input *PutEventSelectorsInput) (re // data event settings for your trail. If you want your trail to log Insights // events, be sure the event selector enables logging of the Insights event // types you want configured for your trail. For more information about logging -// Insights events, see Logging Insights events for trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-insights-events-with-cloudtrail.html) +// Insights events, see Logging Insights events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-insights-events-with-cloudtrail.html) // in the CloudTrail User Guide. By default, trails created without specific // event selectors are configured to log all read and write management events, // and no data events. @@ -4762,7 +4772,7 @@ func (c *CloudTrail) PutEventSelectorsRequest(input *PutEventSelectorsInput) (re // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -4956,7 +4966,7 @@ func (c *CloudTrail) PutInsightSelectorsRequest(input *PutInsightSelectorsInput) // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -5177,9 +5187,11 @@ func (c *CloudTrail) RegisterOrganizationDelegatedAdminRequest(input *RegisterOr // // - AccessNotEnabledException // This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// CloudTrail and Organizations. For more information, see How to enable or +// disable trusted access (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) +// in the Organizations User Guide and Prepare For Creating a Trail For Your +// Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) +// in the CloudTrail User Guide. // // - ConflictException // This exception is thrown when the specified resource is not ready for an @@ -5353,7 +5365,7 @@ func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Req // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -5462,9 +5474,11 @@ func (c *CloudTrail) RestoreEventDataStoreRequest(input *RestoreEventDataStoreIn // // - AccessNotEnabledException // This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// CloudTrail and Organizations. For more information, see How to enable or +// disable trusted access (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) +// in the Organizations User Guide and Prepare For Creating a Trail For Your +// Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) +// in the CloudTrail User Guide. // // - InsufficientDependencyServiceAccessPermissionException // This exception is thrown when the IAM identity that is used to create the @@ -5481,7 +5495,7 @@ func (c *CloudTrail) RestoreEventDataStoreRequest(input *RestoreEventDataStoreIn // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -5600,7 +5614,7 @@ func (c *CloudTrail) StartEventDataStoreIngestionRequest(input *StartEventDataSt // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -5682,7 +5696,8 @@ func (c *CloudTrail) StartImportRequest(input *StartImportInput) (req *request.R // prefix, and does not check prefixes for other Amazon Web Services services. // If you want to import CloudTrail events contained in another prefix, you // must include the prefix in the S3LocationUri. For more considerations about -// importing trail events, see Considerations (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-copy-trail-to-lake.html#cloudtrail-trail-copy-considerations). +// importing trail events, see Considerations for copying trail events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-copy-trail-to-lake.html#cloudtrail-trail-copy-considerations) +// in the CloudTrail User Guide. // // When you start a new import, the Destinations and ImportSource parameters // are required. Before starting a new import, disable any access control lists @@ -5887,7 +5902,7 @@ func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -6139,7 +6154,7 @@ func (c *CloudTrail) StopEventDataStoreIngestionRequest(input *StopEventDataStor // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -6376,7 +6391,7 @@ func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.R // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -6672,9 +6687,11 @@ func (c *CloudTrail) UpdateEventDataStoreRequest(input *UpdateEventDataStoreInpu // // - AccessNotEnabledException // This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// CloudTrail and Organizations. For more information, see How to enable or +// disable trusted access (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) +// in the Organizations User Guide and Prepare For Creating a Trail For Your +// Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) +// in the CloudTrail User Guide. // // - InsufficientDependencyServiceAccessPermissionException // This exception is thrown when the IAM identity that is used to create the @@ -6691,7 +6708,7 @@ func (c *CloudTrail) UpdateEventDataStoreRequest(input *UpdateEventDataStoreInpu // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - NoManagementAccountSLRExistsException // This exception is thrown when the management account does not have a service-linked @@ -6915,9 +6932,11 @@ func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.R // // - AccessNotEnabledException // This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// CloudTrail and Organizations. For more information, see How to enable or +// disable trusted access (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) +// in the Organizations User Guide and Prepare For Creating a Trail For Your +// Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) +// in the CloudTrail User Guide. // // - InsufficientDependencyServiceAccessPermissionException // This exception is thrown when the IAM identity that is used to create the @@ -6934,7 +6953,7 @@ func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.R // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). // // - OrganizationNotInAllFeaturesModeException // This exception is thrown when Organizations is not configured to support @@ -7112,9 +7131,11 @@ func (s *AccessDeniedException) RequestID() string { } // This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// CloudTrail and Organizations. For more information, see How to enable or +// disable trusted access (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) +// in the Organizations User Guide and Prepare For Creating a Trail For Your +// Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) +// in the CloudTrail User Guide. type AccessNotEnabledException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` @@ -7700,27 +7721,30 @@ type AdvancedFieldSelector struct { // AWS::IoT::Thing AWS::IoTSiteWise::Asset AWS::IoTSiteWise::TimeSeries AWS::IoTTwinMaker::Entity // AWS::IoTTwinMaker::Workspace AWS::KendraRanking::ExecutionPlan AWS::KinesisVideo::Stream // AWS::ManagedBlockchain::Network AWS::ManagedBlockchain::Node AWS::MedicalImaging::Datastore - // AWS::NeptuneGraph::Graph AWS::PCAConnectorAD::Connector AWS::QBusiness::Application - // AWS::QBusiness::DataSource AWS::QBusiness::Index AWS::QBusiness::WebExperience - // AWS::RDS::DBCluster AWS::S3::AccessPoint AWS::S3ObjectLambda::AccessPoint - // AWS::S3Outposts::Object AWS::SageMaker::Endpoint AWS::SageMaker::ExperimentTrialComponent - // AWS::SageMaker::FeatureGroup AWS::ServiceDiscovery::Namespace AWS::ServiceDiscovery::Service - // AWS::SCN::Instance AWS::SNS::PlatformEndpoint AWS::SNS::Topic AWS::SWF::Domain - // AWS::SQS::Queue AWS::SSMMessages::ControlChannel AWS::ThinClient::Device + // AWS::NeptuneGraph::Graph AWS::PCAConnectorAD::Connector AWS::QApps:QApp + // AWS::QBusiness::Application AWS::QBusiness::DataSource AWS::QBusiness::Index + // AWS::QBusiness::WebExperience AWS::RDS::DBCluster AWS::S3::AccessPoint + // AWS::S3ObjectLambda::AccessPoint AWS::S3Outposts::Object AWS::SageMaker::Endpoint + // AWS::SageMaker::ExperimentTrialComponent AWS::SageMaker::FeatureGroup + // AWS::ServiceDiscovery::Namespace AWS::ServiceDiscovery::Service AWS::SCN::Instance + // AWS::SNS::PlatformEndpoint AWS::SNS::Topic AWS::SQS::Queue AWS::SSM::ManagedNode + // AWS::SSMMessages::ControlChannel AWS::SWF::Domain AWS::ThinClient::Device // AWS::ThinClient::Environment AWS::Timestream::Database AWS::Timestream::Table - // AWS::VerifiedPermissions::PolicyStore You can have only one resources.type - // field per selector. To log data events on more than one resource type, - // add another selector. + // AWS::VerifiedPermissions::PolicyStore AWS::XRay::Trace You can have only + // one resources.type field per selector. To log data events on more than + // one resource type, add another selector. // // * resources.ARN - You can use any operator with resources.ARN, but if // you use Equals or NotEquals, the value must exactly match the ARN of a // valid resource of the type you've specified in the template as the value - // of resources.type. For example, if resources.type equals AWS::S3::Object, - // the ARN must be in one of the following formats. To log all data events - // for all objects in a specific S3 bucket, use the StartsWith operator, - // and include only the bucket ARN as the matching value. The trailing slash - // is intentional; do not exclude it. Replace the text between less than - // and greater than symbols (<>) with resource-specific information. arn::s3:::/ + // of resources.type. You can't use the resources.ARN field to filter resource + // types that do not have ARNs. The resources.ARN field can be set one of + // the following. If resources.type equals AWS::S3::Object, the ARN must + // be in one of the following formats. To log all data events for all objects + // in a specific S3 bucket, use the StartsWith operator, and include only + // the bucket ARN as the matching value. The trailing slash is intentional; + // do not exclude it. Replace the text between less than and greater than + // symbols (<>) with resource-specific information. arn::s3:::/ // arn::s3:::// When resources.type // equals AWS::DynamoDB::Table, and the operator is set to Equals or NotEquals, // the ARN must be in the following format: arn::dynamodb:::table/ @@ -7809,6 +7833,8 @@ type AdvancedFieldSelector struct { // resources.type equals AWS::PCAConnectorAD::Connector, and the operator // is set to Equals or NotEquals, the ARN must be in the following format: // arn::pca-connector-ad:::connector/ + // When resources.type equals AWS::QApps:QApp, and the operator is set to + // Equals or NotEquals, the ARN must be in the following format: arn::qapps:::application//qapp/ // When resources.type equals AWS::QBusiness::Application, and the operator // is set to Equals or NotEquals, the ARN must be in the following format: // arn::qbusiness:::application/ @@ -7855,13 +7881,17 @@ type AdvancedFieldSelector struct { // arn::sns:::endpoint/// // When resources.type equals AWS::SNS::Topic, and the operator is set to // Equals or NotEquals, the ARN must be in the following format: arn::sns::: - // When resources.type equals AWS::SWF::Domain, and the operator is set to - // Equals or NotEquals, the ARN must be in the following format: arn::swf:::domain/ // When resources.type equals AWS::SQS::Queue, and the operator is set to // Equals or NotEquals, the ARN must be in the following format: arn::sqs::: - // When resources.type equals AWS::SSMMessages::ControlChannel, and the operator + // When resources.type equals AWS::SSM::ManagedNode, and the operator is + // set to Equals or NotEquals, the ARN must be in one of the following formats: + // arn::ssm:::managed-instance/ + // arn::ec2:::instance/ When + // resources.type equals AWS::SSMMessages::ControlChannel, and the operator // is set to Equals or NotEquals, the ARN must be in the following format: // arn::ssmmessages:::control-channel/ + // When resources.type equals AWS::SWF::Domain, and the operator is set to + // Equals or NotEquals, the ARN must be in the following format: arn::swf:::domain/ // When resources.type equals AWS::ThinClient::Device, and the operator is // set to Equals or NotEquals, the ARN must be in the following format: arn::thinclient:::device/ // When resources.type equals AWS::ThinClient::Environment, and the operator @@ -8996,12 +9026,12 @@ type CreateEventDataStoreInput struct { // // For more information about how to use advanced event selectors to include // Config configuration items in your event data store, see Create an event - // data store for Config configuration items (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-lake-cli.html#lake-cli-create-eds-config) + // data store for Config configuration items (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-eds-cli.html#lake-cli-create-eds-config) // in the CloudTrail User Guide. // // For more information about how to use advanced event selectors to include - // non-Amazon Web Services events in your event data store, see Create an integration - // to log events from outside Amazon Web Services (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-lake-cli.html#lake-cli-create-integration) + // events outside of Amazon Web Services events in your event data store, see + // Create an integration to log events from outside Amazon Web Services (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-integrations-cli.html#lake-cli-create-integration) // in the CloudTrail User Guide. AdvancedEventSelectors []*AdvancedEventSelector `type:"list"` @@ -9446,14 +9476,16 @@ type CreateTrailInput struct { Name *string `type:"string" required:"true"` // Specifies the name of the Amazon S3 bucket designated for publishing log - // files. See Amazon S3 Bucket Naming Requirements (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). + // files. For information about bucket naming rules, see Bucket naming rules + // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) + // in the Amazon Simple Storage Service User Guide. // // S3BucketName is a required field S3BucketName *string `type:"string" required:"true"` // Specifies the Amazon S3 key prefix that comes after the name of the bucket // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). + // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). // The maximum length is 200 characters. S3KeyPrefix *string `type:"string"` @@ -9622,7 +9654,7 @@ type CreateTrailOutput struct { // Specifies the Amazon S3 key prefix that comes after the name of the bucket // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). + // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). S3KeyPrefix *string `type:"string"` // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications @@ -9739,11 +9771,21 @@ func (s *CreateTrailOutput) SetTrailARN(v string) *CreateTrailOutput { return s } -// The Amazon S3 buckets, Lambda functions, or Amazon DynamoDB tables that you -// specify in your event selectors for your trail to log data events. Data events -// provide information about the resource operations performed on or within -// a resource itself. These are also known as data plane operations. You can -// specify up to 250 data resources for a trail. +// Data events provide information about the resource operations performed on +// or within a resource itself. These are also known as data plane operations. +// You can specify up to 250 data resources for a trail. +// +// Configure the DataResource to specify the resource type and resource ARNs +// for which you want to log data events. +// +// You can specify the following resource types in your event selectors for +// your trail: +// +// - AWS::DynamoDB::Table +// +// - AWS::Lambda::Function +// +// - AWS::S3::Object // // The total number of allowed data resources is 250. This number can be distributed // between 1 and 5 event selectors, but the total cannot exceed 250 across all @@ -9805,7 +9847,7 @@ type DataResource struct { Type *string `type:"string"` // An array of Amazon Resource Name (ARN) strings or partial ARN strings for - // the specified objects. + // the specified resource type. // // * To log data events for all objects in all S3 buckets in your Amazon // Web Services account, specify the prefix as arn:aws:s3. This also enables @@ -10943,7 +10985,7 @@ func (s *Event) SetUsername(v string) *Event { // A storage lake of event data against which you can run complex SQL-based // queries. An event data store can include events that you have logged on your // account. To select events for an event data store, use advanced event selectors -// (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#creating-data-event-selectors-advanced). +// (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-concepts.html#adv-event-selectors). type EventDataStore struct { _ struct{} `type:"structure"` @@ -11853,6 +11895,11 @@ type GetEventDataStoreOutput struct { // organization in Organizations. OrganizationEnabled *bool `type:"boolean"` + // The partition keys for the event data store. To improve query performance + // and efficiency, CloudTrail Lake organizes event data into partitions based + // on values derived from partition keys. + PartitionKeys []*PartitionKey `type:"list"` + // The retention period of the event data store, in days. RetentionPeriod *int64 `min:"7" type:"integer"` @@ -11945,6 +11992,12 @@ func (s *GetEventDataStoreOutput) SetOrganizationEnabled(v bool) *GetEventDataSt return s } +// SetPartitionKeys sets the PartitionKeys field's value. +func (s *GetEventDataStoreOutput) SetPartitionKeys(v []*PartitionKey) *GetEventDataStoreOutput { + s.PartitionKeys = v + return s +} + // SetRetentionPeriod sets the RetentionPeriod field's value. func (s *GetEventDataStoreOutput) SetRetentionPeriod(v int64) *GetEventDataStoreOutput { s.RetentionPeriod = &v @@ -12781,9 +12834,10 @@ type GetTrailStatusOutput struct { // in the Amazon S3 API Reference. // // This error occurs only when there is a problem with the destination S3 bucket, - // and does not occur for requests that time out. To resolve the issue, create - // a new bucket, and then call UpdateTrail to specify the new bucket; or fix - // the existing objects so that CloudTrail can again write to the bucket. + // and does not occur for requests that time out. To resolve the issue, fix + // the bucket policy (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create-s3-bucket-policy-for-cloudtrail.html) + // so that CloudTrail can write to the bucket; or create a new bucket and call + // UpdateTrail to specify the new bucket. LatestDeliveryError *string `type:"string"` // Specifies the date and time that CloudTrail last delivered log files to an @@ -12796,9 +12850,10 @@ type GetTrailStatusOutput struct { // in the Amazon S3 API Reference. // // This error occurs only when there is a problem with the destination S3 bucket, - // and does not occur for requests that time out. To resolve the issue, create - // a new bucket, and then call UpdateTrail to specify the new bucket; or fix - // the existing objects so that CloudTrail can again write to the bucket. + // and does not occur for requests that time out. To resolve the issue, fix + // the bucket policy (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create-s3-bucket-policy-for-cloudtrail.html) + // so that CloudTrail can write to the bucket; or create a new bucket and call + // UpdateTrail to specify the new bucket. LatestDigestDeliveryError *string `type:"string"` // Specifies the date and time that CloudTrail last delivered a digest file @@ -17378,7 +17433,7 @@ func (s *NotOrganizationManagementAccountException) RequestID() string { // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). +// or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). type NotOrganizationMasterAccountException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` @@ -17638,6 +17693,51 @@ func (s *OrganizationsNotInUseException) RequestID() string { return s.RespMetadata.RequestID } +// Contains information about a partition key for an event data store. +type PartitionKey struct { + _ struct{} `type:"structure"` + + // The name of the partition key. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The data type of the partition key. For example, bigint or string. + // + // Type is a required field + Type *string `type:"string" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PartitionKey) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PartitionKey) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *PartitionKey) SetName(v string) *PartitionKey { + s.Name = &v + return s +} + +// SetType sets the Type field's value. +func (s *PartitionKey) SetType(v string) *PartitionKey { + s.Type = &v + return s +} + // Contains information about a returned public key. type PublicKey struct { _ struct{} `type:"structure"` @@ -20332,12 +20432,12 @@ type Trail struct { Name *string `type:"string"` // Name of the Amazon S3 bucket into which CloudTrail delivers your trail files. - // See Amazon S3 Bucket Naming Requirements (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). + // See Amazon S3 Bucket naming rules (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html). S3BucketName *string `type:"string"` // Specifies the Amazon S3 key prefix that comes after the name of the bucket // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). + // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). // The maximum length is 200 characters. S3KeyPrefix *string `type:"string"` @@ -21386,12 +21486,12 @@ type UpdateTrailInput struct { Name *string `type:"string" required:"true"` // Specifies the name of the Amazon S3 bucket designated for publishing log - // files. See Amazon S3 Bucket Naming Requirements (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). + // files. See Amazon S3 Bucket naming rules (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html). S3BucketName *string `type:"string"` // Specifies the Amazon S3 key prefix that comes after the name of the bucket // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). + // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). // The maximum length is 200 characters. S3KeyPrefix *string `type:"string"` @@ -21538,7 +21638,7 @@ type UpdateTrailOutput struct { // Specifies the Amazon S3 key prefix that comes after the name of the bucket // you have designated for log file delivery. For more information, see Finding - // Your IAM Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). + // Your IAM Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). S3KeyPrefix *string `type:"string"` // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications diff --git a/service/cloudtrail/errors.go b/service/cloudtrail/errors.go index a0a453086eb..3c43dac792b 100644 --- a/service/cloudtrail/errors.go +++ b/service/cloudtrail/errors.go @@ -31,9 +31,11 @@ const ( // "CloudTrailAccessNotEnabledException". // // This exception is thrown when trusted access has not been enabled between - // CloudTrail and Organizations. For more information, see Enabling Trusted - // Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) - // and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). + // CloudTrail and Organizations. For more information, see How to enable or + // disable trusted access (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) + // in the Organizations User Guide and Prepare For Creating a Trail For Your + // Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) + // in the CloudTrail User Guide. ErrCodeAccessNotEnabledException = "CloudTrailAccessNotEnabledException" // ErrCodeAccountHasOngoingImportException for service response error code @@ -519,7 +521,7 @@ const ( // request to create or update an organization trail or event data store is // not the management account for an organization in Organizations. For more // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) - // or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). + // or Organization event data stores (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). ErrCodeNotOrganizationMasterAccountException = "NotOrganizationMasterAccountException" // ErrCodeOperationNotPermittedException for service response error code diff --git a/service/connect/api.go b/service/connect/api.go index 42373eb4a2f..de43b961d12 100644 --- a/service/connect/api.go +++ b/service/connect/api.go @@ -64341,6 +64341,9 @@ type RoutingProfile struct { // based on time since their last inbound contact or longest idle time. AgentAvailabilityTimer *string `type:"string" enum:"AgentAvailabilityTimer"` + // The IDs of the associated queue. + AssociatedQueueIds []*string `type:"list"` + // The identifier of the default outbound queue for this routing profile. DefaultOutboundQueueId *string `type:"string"` @@ -64409,6 +64412,12 @@ func (s *RoutingProfile) SetAgentAvailabilityTimer(v string) *RoutingProfile { return s } +// SetAssociatedQueueIds sets the AssociatedQueueIds field's value. +func (s *RoutingProfile) SetAssociatedQueueIds(v []*string) *RoutingProfile { + s.AssociatedQueueIds = v + return s +} + // SetDefaultOutboundQueueId sets the DefaultOutboundQueueId field's value. func (s *RoutingProfile) SetDefaultOutboundQueueId(v string) *RoutingProfile { s.DefaultOutboundQueueId = &v @@ -64787,7 +64796,8 @@ type RoutingProfileSearchCriteria struct { // A leaf node condition which can be used to specify a string condition. // - // The currently supported values for FieldName are name, description, and resourceID. + // The currently supported values for FieldName are associatedQueueIds, name, + // description, and resourceID. StringCondition *StringCondition `type:"structure"` } diff --git a/service/emrserverless/api.go b/service/emrserverless/api.go index d886a0f56e9..9c14836129a 100644 --- a/service/emrserverless/api.go +++ b/service/emrserverless/api.go @@ -685,6 +685,149 @@ func (c *EMRServerless) ListApplicationsPagesWithContext(ctx aws.Context, input return p.Err() } +const opListJobRunAttempts = "ListJobRunAttempts" + +// ListJobRunAttemptsRequest generates a "aws/request.Request" representing the +// client's request for the ListJobRunAttempts operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListJobRunAttempts for more information on using the ListJobRunAttempts +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// // Example sending a request using the ListJobRunAttemptsRequest method. +// req, resp := client.ListJobRunAttemptsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/emr-serverless-2021-07-13/ListJobRunAttempts +func (c *EMRServerless) ListJobRunAttemptsRequest(input *ListJobRunAttemptsInput) (req *request.Request, output *ListJobRunAttemptsOutput) { + op := &request.Operation{ + Name: opListJobRunAttempts, + HTTPMethod: "GET", + HTTPPath: "/applications/{applicationId}/jobruns/{jobRunId}/attempts", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListJobRunAttemptsInput{} + } + + output = &ListJobRunAttemptsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListJobRunAttempts API operation for EMR Serverless. +// +// Lists all attempt of a job run. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for EMR Serverless's +// API operation ListJobRunAttempts for usage and error information. +// +// Returned Error Types: +// +// - ValidationException +// The input fails to satisfy the constraints specified by an Amazon Web Services +// service. +// +// - ResourceNotFoundException +// The specified resource was not found. +// +// - InternalServerException +// Request processing failed because of an error or failure with the service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/emr-serverless-2021-07-13/ListJobRunAttempts +func (c *EMRServerless) ListJobRunAttempts(input *ListJobRunAttemptsInput) (*ListJobRunAttemptsOutput, error) { + req, out := c.ListJobRunAttemptsRequest(input) + return out, req.Send() +} + +// ListJobRunAttemptsWithContext is the same as ListJobRunAttempts with the addition of +// the ability to pass a context and additional request options. +// +// See ListJobRunAttempts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EMRServerless) ListJobRunAttemptsWithContext(ctx aws.Context, input *ListJobRunAttemptsInput, opts ...request.Option) (*ListJobRunAttemptsOutput, error) { + req, out := c.ListJobRunAttemptsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListJobRunAttemptsPages iterates over the pages of a ListJobRunAttempts operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListJobRunAttempts method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a ListJobRunAttempts operation. +// pageNum := 0 +// err := client.ListJobRunAttemptsPages(params, +// func(page *emrserverless.ListJobRunAttemptsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +func (c *EMRServerless) ListJobRunAttemptsPages(input *ListJobRunAttemptsInput, fn func(*ListJobRunAttemptsOutput, bool) bool) error { + return c.ListJobRunAttemptsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListJobRunAttemptsPagesWithContext same as ListJobRunAttemptsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EMRServerless) ListJobRunAttemptsPagesWithContext(ctx aws.Context, input *ListJobRunAttemptsInput, fn func(*ListJobRunAttemptsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListJobRunAttemptsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListJobRunAttemptsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListJobRunAttemptsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opListJobRuns = "ListJobRuns" // ListJobRunsRequest generates a "aws/request.Request" representing the @@ -2807,6 +2950,10 @@ type GetDashboardForJobRunInput struct { // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"applicationId" min:"1" type:"string" required:"true"` + // An optimal parameter that indicates the amount of attempts for the job. If + // not specified, this value defaults to the attempt of the latest job. + Attempt *int64 `location:"querystring" locationName:"attempt" min:"1" type:"integer"` + // The ID of the job run. // // JobRunId is a required field @@ -2840,6 +2987,9 @@ func (s *GetDashboardForJobRunInput) Validate() error { if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } + if s.Attempt != nil && *s.Attempt < 1 { + invalidParams.Add(request.NewErrParamMinValue("Attempt", 1)) + } if s.JobRunId == nil { invalidParams.Add(request.NewErrParamRequired("JobRunId")) } @@ -2859,6 +3009,12 @@ func (s *GetDashboardForJobRunInput) SetApplicationId(v string) *GetDashboardFor return s } +// SetAttempt sets the Attempt field's value. +func (s *GetDashboardForJobRunInput) SetAttempt(v int64) *GetDashboardForJobRunInput { + s.Attempt = &v + return s +} + // SetJobRunId sets the JobRunId field's value. func (s *GetDashboardForJobRunInput) SetJobRunId(v string) *GetDashboardForJobRunInput { s.JobRunId = &v @@ -2904,6 +3060,10 @@ type GetJobRunInput struct { // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"applicationId" min:"1" type:"string" required:"true"` + // An optimal parameter that indicates the amount of attempts for the job. If + // not specified, this value defaults to the attempt of the latest job. + Attempt *int64 `location:"querystring" locationName:"attempt" min:"1" type:"integer"` + // The ID of the job run. // // JobRunId is a required field @@ -2937,6 +3097,9 @@ func (s *GetJobRunInput) Validate() error { if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } + if s.Attempt != nil && *s.Attempt < 1 { + invalidParams.Add(request.NewErrParamMinValue("Attempt", 1)) + } if s.JobRunId == nil { invalidParams.Add(request.NewErrParamRequired("JobRunId")) } @@ -2956,6 +3119,12 @@ func (s *GetJobRunInput) SetApplicationId(v string) *GetJobRunInput { return s } +// SetAttempt sets the Attempt field's value. +func (s *GetJobRunInput) SetAttempt(v int64) *GetJobRunInput { + s.Attempt = &v + return s +} + // SetJobRunId sets the JobRunId field's value. func (s *GetJobRunInput) SetJobRunId(v string) *GetJobRunInput { s.JobRunId = &v @@ -3422,6 +3591,15 @@ type JobRun struct { // Arn is a required field Arn *string `locationName:"arn" min:"60" type:"string" required:"true"` + // The attempt of the job run. + Attempt *int64 `locationName:"attempt" min:"1" type:"integer"` + + // The date and time of when the job run attempt was created. + AttemptCreatedAt *time.Time `locationName:"attemptCreatedAt" type:"timestamp"` + + // The date and time of when the job run attempt was last updated. + AttemptUpdatedAt *time.Time `locationName:"attemptUpdatedAt" type:"timestamp"` + // The aggregate vCPU, memory, and storage that Amazon Web Services has billed // for the job run. The billed resources include a 1-minute minimum usage for // workers, plus additional storage over 20 GB per worker. Note that billed @@ -3460,6 +3638,9 @@ type JobRun struct { // JobRunId is a required field JobRunId *string `locationName:"jobRunId" min:"1" type:"string" required:"true"` + // The mode of the job run. + Mode *string `locationName:"mode" type:"string" enum:"JobRunMode"` + // The optional job run name. This doesn't have to be unique. Name *string `locationName:"name" min:"1" type:"string"` @@ -3472,6 +3653,9 @@ type JobRun struct { // ReleaseLabel is a required field ReleaseLabel *string `locationName:"releaseLabel" min:"1" type:"string" required:"true"` + // The retry policy of the job run. + RetryPolicy *RetryPolicy `locationName:"retryPolicy" type:"structure"` + // The state of the job run. // // State is a required field @@ -3530,6 +3714,24 @@ func (s *JobRun) SetArn(v string) *JobRun { return s } +// SetAttempt sets the Attempt field's value. +func (s *JobRun) SetAttempt(v int64) *JobRun { + s.Attempt = &v + return s +} + +// SetAttemptCreatedAt sets the AttemptCreatedAt field's value. +func (s *JobRun) SetAttemptCreatedAt(v time.Time) *JobRun { + s.AttemptCreatedAt = &v + return s +} + +// SetAttemptUpdatedAt sets the AttemptUpdatedAt field's value. +func (s *JobRun) SetAttemptUpdatedAt(v time.Time) *JobRun { + s.AttemptUpdatedAt = &v + return s +} + // SetBilledResourceUtilization sets the BilledResourceUtilization field's value. func (s *JobRun) SetBilledResourceUtilization(v *ResourceUtilization) *JobRun { s.BilledResourceUtilization = v @@ -3578,6 +3780,12 @@ func (s *JobRun) SetJobRunId(v string) *JobRun { return s } +// SetMode sets the Mode field's value. +func (s *JobRun) SetMode(v string) *JobRun { + s.Mode = &v + return s +} + // SetName sets the Name field's value. func (s *JobRun) SetName(v string) *JobRun { s.Name = &v @@ -3596,6 +3804,12 @@ func (s *JobRun) SetReleaseLabel(v string) *JobRun { return s } +// SetRetryPolicy sets the RetryPolicy field's value. +func (s *JobRun) SetRetryPolicy(v *RetryPolicy) *JobRun { + s.RetryPolicy = v + return s +} + // SetState sets the State field's value. func (s *JobRun) SetState(v string) *JobRun { s.State = &v @@ -3632,6 +3846,186 @@ func (s *JobRun) SetUpdatedAt(v time.Time) *JobRun { return s } +// The summary of attributes associated with a job run attempt. +type JobRunAttemptSummary struct { + _ struct{} `type:"structure"` + + // The ID of the application the job is running on. + // + // ApplicationId is a required field + ApplicationId *string `locationName:"applicationId" min:"1" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the job run. + // + // Arn is a required field + Arn *string `locationName:"arn" min:"60" type:"string" required:"true"` + + // The attempt number of the job run execution. + Attempt *int64 `locationName:"attempt" min:"1" type:"integer"` + + // The date and time when the job run attempt was created. + // + // CreatedAt is a required field + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` + + // The user who created the job run. + // + // CreatedBy is a required field + CreatedBy *string `locationName:"createdBy" min:"20" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the execution role of the job run.. + // + // ExecutionRole is a required field + ExecutionRole *string `locationName:"executionRole" min:"20" type:"string" required:"true"` + + // The ID of the job run attempt. + // + // Id is a required field + Id *string `locationName:"id" min:"1" type:"string" required:"true"` + + // The date and time of when the job run was created. + // + // JobCreatedAt is a required field + JobCreatedAt *time.Time `locationName:"jobCreatedAt" type:"timestamp" required:"true"` + + // The mode of the job run attempt. + Mode *string `locationName:"mode" type:"string" enum:"JobRunMode"` + + // The name of the job run attempt. + Name *string `locationName:"name" min:"1" type:"string"` + + // The Amazon EMR release label of the job run attempt. + // + // ReleaseLabel is a required field + ReleaseLabel *string `locationName:"releaseLabel" min:"1" type:"string" required:"true"` + + // The state of the job run attempt. + // + // State is a required field + State *string `locationName:"state" type:"string" required:"true" enum:"JobRunState"` + + // The state details of the job run attempt. + // + // StateDetails is a required field + StateDetails *string `locationName:"stateDetails" min:"1" type:"string" required:"true"` + + // The type of the job run, such as Spark or Hive. + Type *string `locationName:"type" type:"string"` + + // The date and time of when the job run attempt was last updated. + // + // UpdatedAt is a required field + UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s JobRunAttemptSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s JobRunAttemptSummary) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *JobRunAttemptSummary) SetApplicationId(v string) *JobRunAttemptSummary { + s.ApplicationId = &v + return s +} + +// SetArn sets the Arn field's value. +func (s *JobRunAttemptSummary) SetArn(v string) *JobRunAttemptSummary { + s.Arn = &v + return s +} + +// SetAttempt sets the Attempt field's value. +func (s *JobRunAttemptSummary) SetAttempt(v int64) *JobRunAttemptSummary { + s.Attempt = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *JobRunAttemptSummary) SetCreatedAt(v time.Time) *JobRunAttemptSummary { + s.CreatedAt = &v + return s +} + +// SetCreatedBy sets the CreatedBy field's value. +func (s *JobRunAttemptSummary) SetCreatedBy(v string) *JobRunAttemptSummary { + s.CreatedBy = &v + return s +} + +// SetExecutionRole sets the ExecutionRole field's value. +func (s *JobRunAttemptSummary) SetExecutionRole(v string) *JobRunAttemptSummary { + s.ExecutionRole = &v + return s +} + +// SetId sets the Id field's value. +func (s *JobRunAttemptSummary) SetId(v string) *JobRunAttemptSummary { + s.Id = &v + return s +} + +// SetJobCreatedAt sets the JobCreatedAt field's value. +func (s *JobRunAttemptSummary) SetJobCreatedAt(v time.Time) *JobRunAttemptSummary { + s.JobCreatedAt = &v + return s +} + +// SetMode sets the Mode field's value. +func (s *JobRunAttemptSummary) SetMode(v string) *JobRunAttemptSummary { + s.Mode = &v + return s +} + +// SetName sets the Name field's value. +func (s *JobRunAttemptSummary) SetName(v string) *JobRunAttemptSummary { + s.Name = &v + return s +} + +// SetReleaseLabel sets the ReleaseLabel field's value. +func (s *JobRunAttemptSummary) SetReleaseLabel(v string) *JobRunAttemptSummary { + s.ReleaseLabel = &v + return s +} + +// SetState sets the State field's value. +func (s *JobRunAttemptSummary) SetState(v string) *JobRunAttemptSummary { + s.State = &v + return s +} + +// SetStateDetails sets the StateDetails field's value. +func (s *JobRunAttemptSummary) SetStateDetails(v string) *JobRunAttemptSummary { + s.StateDetails = &v + return s +} + +// SetType sets the Type field's value. +func (s *JobRunAttemptSummary) SetType(v string) *JobRunAttemptSummary { + s.Type = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *JobRunAttemptSummary) SetUpdatedAt(v time.Time) *JobRunAttemptSummary { + s.UpdatedAt = &v + return s +} + // The summary of attributes associated with a job run. type JobRunSummary struct { _ struct{} `type:"structure"` @@ -3646,6 +4040,15 @@ type JobRunSummary struct { // Arn is a required field Arn *string `locationName:"arn" min:"60" type:"string" required:"true"` + // The attempt number of the job run execution. + Attempt *int64 `locationName:"attempt" min:"1" type:"integer"` + + // The date and time of when the job run attempt was created. + AttemptCreatedAt *time.Time `locationName:"attemptCreatedAt" type:"timestamp"` + + // The date and time of when the job run attempt was last updated. + AttemptUpdatedAt *time.Time `locationName:"attemptUpdatedAt" type:"timestamp"` + // The date and time when the job run was created. // // CreatedAt is a required field @@ -3666,6 +4069,9 @@ type JobRunSummary struct { // Id is a required field Id *string `locationName:"id" min:"1" type:"string" required:"true"` + // The mode of the job run. + Mode *string `locationName:"mode" type:"string" enum:"JobRunMode"` + // The optional job run name. This doesn't have to be unique. Name *string `locationName:"name" min:"1" type:"string"` @@ -3724,6 +4130,24 @@ func (s *JobRunSummary) SetArn(v string) *JobRunSummary { return s } +// SetAttempt sets the Attempt field's value. +func (s *JobRunSummary) SetAttempt(v int64) *JobRunSummary { + s.Attempt = &v + return s +} + +// SetAttemptCreatedAt sets the AttemptCreatedAt field's value. +func (s *JobRunSummary) SetAttemptCreatedAt(v time.Time) *JobRunSummary { + s.AttemptCreatedAt = &v + return s +} + +// SetAttemptUpdatedAt sets the AttemptUpdatedAt field's value. +func (s *JobRunSummary) SetAttemptUpdatedAt(v time.Time) *JobRunSummary { + s.AttemptUpdatedAt = &v + return s +} + // SetCreatedAt sets the CreatedAt field's value. func (s *JobRunSummary) SetCreatedAt(v time.Time) *JobRunSummary { s.CreatedAt = &v @@ -3748,6 +4172,12 @@ func (s *JobRunSummary) SetId(v string) *JobRunSummary { return s } +// SetMode sets the Mode field's value. +func (s *JobRunSummary) SetMode(v string) *JobRunSummary { + s.Mode = &v + return s +} + // SetName sets the Name field's value. func (s *JobRunSummary) SetName(v string) *JobRunSummary { s.Name = &v @@ -3897,6 +4327,140 @@ func (s *ListApplicationsOutput) SetNextToken(v string) *ListApplicationsOutput return s } +type ListJobRunAttemptsInput struct { + _ struct{} `type:"structure" nopayload:"true"` + + // The ID of the application for which to list job runs. + // + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"applicationId" min:"1" type:"string" required:"true"` + + // The ID of the job run to list. + // + // JobRunId is a required field + JobRunId *string `location:"uri" locationName:"jobRunId" min:"1" type:"string" required:"true"` + + // The maximum number of job run attempts to list. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // The token for the next set of job run attempt results. + NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListJobRunAttemptsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListJobRunAttemptsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListJobRunAttemptsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListJobRunAttemptsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.JobRunId == nil { + invalidParams.Add(request.NewErrParamRequired("JobRunId")) + } + if s.JobRunId != nil && len(*s.JobRunId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JobRunId", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *ListJobRunAttemptsInput) SetApplicationId(v string) *ListJobRunAttemptsInput { + s.ApplicationId = &v + return s +} + +// SetJobRunId sets the JobRunId field's value. +func (s *ListJobRunAttemptsInput) SetJobRunId(v string) *ListJobRunAttemptsInput { + s.JobRunId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListJobRunAttemptsInput) SetMaxResults(v int64) *ListJobRunAttemptsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListJobRunAttemptsInput) SetNextToken(v string) *ListJobRunAttemptsInput { + s.NextToken = &v + return s +} + +type ListJobRunAttemptsOutput struct { + _ struct{} `type:"structure"` + + // The array of the listed job run attempt objects. + // + // JobRunAttempts is a required field + JobRunAttempts []*JobRunAttemptSummary `locationName:"jobRunAttempts" type:"list" required:"true"` + + // The output displays the token for the next set of application results. This + // is required for pagination and is available as a response of the previous + // request. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListJobRunAttemptsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListJobRunAttemptsOutput) GoString() string { + return s.String() +} + +// SetJobRunAttempts sets the JobRunAttempts field's value. +func (s *ListJobRunAttemptsOutput) SetJobRunAttempts(v []*JobRunAttemptSummary) *ListJobRunAttemptsOutput { + s.JobRunAttempts = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListJobRunAttemptsOutput) SetNextToken(v string) *ListJobRunAttemptsOutput { + s.NextToken = &v + return s +} + type ListJobRunsInput struct { _ struct{} `type:"structure" nopayload:"true"` @@ -3914,6 +4478,9 @@ type ListJobRunsInput struct { // The maximum number of job runs that can be listed. MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + // The mode of the job runs to list. + Mode *string `location:"querystring" locationName:"mode" type:"string" enum:"JobRunMode"` + // The token for the next set of job run results. NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` @@ -3986,6 +4553,12 @@ func (s *ListJobRunsInput) SetMaxResults(v int64) *ListJobRunsInput { return s } +// SetMode sets the Mode field's value. +func (s *ListJobRunsInput) SetMode(v string) *ListJobRunsInput { + s.Mode = &v + return s +} + // SetNextToken sets the NextToken field's value. func (s *ListJobRunsInput) SetNextToken(v string) *ListJobRunsInput { s.NextToken = &v @@ -4554,6 +5127,65 @@ func (s *ResourceUtilization) SetVCPUHour(v float64) *ResourceUtilization { return s } +// The retry policy to use for a job run. +type RetryPolicy struct { + _ struct{} `type:"structure"` + + // Maximum number of attempts for the job run. This parameter is only applicable + // for BATCH mode. + MaxAttempts *int64 `locationName:"maxAttempts" min:"1" type:"integer"` + + // Maximum number of failed attempts per hour. This [arameter is only applicable + // for STREAMING mode. + MaxFailedAttemptsPerHour *int64 `locationName:"maxFailedAttemptsPerHour" min:"1" type:"integer"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s RetryPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s RetryPolicy) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RetryPolicy) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RetryPolicy"} + if s.MaxAttempts != nil && *s.MaxAttempts < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxAttempts", 1)) + } + if s.MaxFailedAttemptsPerHour != nil && *s.MaxFailedAttemptsPerHour < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxFailedAttemptsPerHour", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxAttempts sets the MaxAttempts field's value. +func (s *RetryPolicy) SetMaxAttempts(v int64) *RetryPolicy { + s.MaxAttempts = &v + return s +} + +// SetMaxFailedAttemptsPerHour sets the MaxFailedAttemptsPerHour field's value. +func (s *RetryPolicy) SetMaxFailedAttemptsPerHour(v int64) *RetryPolicy { + s.MaxFailedAttemptsPerHour = &v + return s +} + // The Amazon S3 configuration for monitoring log publishing. You can configure // your jobs to send log information to Amazon S3. type S3MonitoringConfiguration struct { @@ -4853,9 +5485,15 @@ type StartJobRunInput struct { // The job driver for the job run. JobDriver *JobDriver `locationName:"jobDriver" type:"structure"` + // The mode of the job run when it starts. + Mode *string `locationName:"mode" type:"string" enum:"JobRunMode"` + // The optional job run name. This doesn't have to be unique. Name *string `locationName:"name" min:"1" type:"string"` + // The retry policy when job run starts. + RetryPolicy *RetryPolicy `locationName:"retryPolicy" type:"structure"` + // The tags assigned to the job run. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -4909,6 +5547,11 @@ func (s *StartJobRunInput) Validate() error { invalidParams.AddNested("JobDriver", err.(request.ErrInvalidParams)) } } + if s.RetryPolicy != nil { + if err := s.RetryPolicy.Validate(); err != nil { + invalidParams.AddNested("RetryPolicy", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -4952,12 +5595,24 @@ func (s *StartJobRunInput) SetJobDriver(v *JobDriver) *StartJobRunInput { return s } +// SetMode sets the Mode field's value. +func (s *StartJobRunInput) SetMode(v string) *StartJobRunInput { + s.Mode = &v + return s +} + // SetName sets the Name field's value. func (s *StartJobRunInput) SetName(v string) *StartJobRunInput { s.Name = &v return s } +// SetRetryPolicy sets the RetryPolicy field's value. +func (s *StartJobRunInput) SetRetryPolicy(v *RetryPolicy) *StartJobRunInput { + s.RetryPolicy = v + return s +} + // SetTags sets the Tags field's value. func (s *StartJobRunInput) SetTags(v map[string]*string) *StartJobRunInput { s.Tags = v @@ -5880,6 +6535,22 @@ func Architecture_Values() []string { } } +const ( + // JobRunModeBatch is a JobRunMode enum value + JobRunModeBatch = "BATCH" + + // JobRunModeStreaming is a JobRunMode enum value + JobRunModeStreaming = "STREAMING" +) + +// JobRunMode_Values returns all elements of the JobRunMode enum +func JobRunMode_Values() []string { + return []string{ + JobRunModeBatch, + JobRunModeStreaming, + } +} + const ( // JobRunStateSubmitted is a JobRunState enum value JobRunStateSubmitted = "SUBMITTED" diff --git a/service/emrserverless/emrserverlessiface/interface.go b/service/emrserverless/emrserverlessiface/interface.go index 2e42cae577e..32f5bafdf31 100644 --- a/service/emrserverless/emrserverlessiface/interface.go +++ b/service/emrserverless/emrserverlessiface/interface.go @@ -91,6 +91,13 @@ type EMRServerlessAPI interface { ListApplicationsPages(*emrserverless.ListApplicationsInput, func(*emrserverless.ListApplicationsOutput, bool) bool) error ListApplicationsPagesWithContext(aws.Context, *emrserverless.ListApplicationsInput, func(*emrserverless.ListApplicationsOutput, bool) bool, ...request.Option) error + ListJobRunAttempts(*emrserverless.ListJobRunAttemptsInput) (*emrserverless.ListJobRunAttemptsOutput, error) + ListJobRunAttemptsWithContext(aws.Context, *emrserverless.ListJobRunAttemptsInput, ...request.Option) (*emrserverless.ListJobRunAttemptsOutput, error) + ListJobRunAttemptsRequest(*emrserverless.ListJobRunAttemptsInput) (*request.Request, *emrserverless.ListJobRunAttemptsOutput) + + ListJobRunAttemptsPages(*emrserverless.ListJobRunAttemptsInput, func(*emrserverless.ListJobRunAttemptsOutput, bool) bool) error + ListJobRunAttemptsPagesWithContext(aws.Context, *emrserverless.ListJobRunAttemptsInput, func(*emrserverless.ListJobRunAttemptsOutput, bool) bool, ...request.Option) error + ListJobRuns(*emrserverless.ListJobRunsInput) (*emrserverless.ListJobRunsOutput, error) ListJobRunsWithContext(aws.Context, *emrserverless.ListJobRunsInput, ...request.Option) (*emrserverless.ListJobRunsOutput, error) ListJobRunsRequest(*emrserverless.ListJobRunsInput) (*request.Request, *emrserverless.ListJobRunsOutput) diff --git a/service/rds/api.go b/service/rds/api.go index 2a3ebe73488..272e3c3dbf3 100644 --- a/service/rds/api.go +++ b/service/rds/api.go @@ -330,8 +330,9 @@ func (c *RDS) AddTagsToResourceRequest(input *AddTagsToResourceInput) (req *requ // with cost allocation reporting to track cost associated with Amazon RDS resources, // or used in a Condition statement in an IAM policy for Amazon RDS. // -// For an overview on tagging Amazon RDS resources, see Tagging Amazon RDS Resources -// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Tagging.html). +// For an overview on tagging your relational database resources, see Tagging +// Amazon RDS Resources (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html) +// or Tagging Amazon Aurora and Amazon RDS Resources (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -22125,9 +22126,9 @@ type CreateDBClusterInput struct { // Reserved for future use. DBSystemId *string `type:"string"` - // The name for your database of up to 64 alphanumeric characters. If you don't - // provide a name, Amazon RDS doesn't create a database in the DB cluster you - // are creating. + // The name for your database of up to 64 alphanumeric characters. A database + // named postgres is always created. If this parameter is specified, an additional + // database with this name is created. // // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters DatabaseName *string `type:"string"` @@ -23715,9 +23716,9 @@ type CreateDBInstanceInput struct { // Amazon Aurora PostgreSQL // // The name of the database to create when the primary DB instance of the Aurora - // PostgreSQL DB cluster is created. If this parameter isn't specified for an - // Aurora PostgreSQL DB cluster, a database named postgres is created in the - // DB cluster. + // PostgreSQL DB cluster is created. A database named postgres is always created. + // If this parameter is specified, an additional database with this name is + // created. // // Constraints: // @@ -23807,9 +23808,9 @@ type CreateDBInstanceInput struct { // // RDS for PostgreSQL // - // The name of the database to create when the DB instance is created. If this - // parameter isn't specified, a database named postgres is created in the DB - // instance. + // The name of the database to create when the DB instance is created. A database + // named postgres is always created. If this parameter is specified, an additional + // database with this name is created. // // Constraints: // @@ -58813,8 +58814,11 @@ type RestoreDBInstanceFromS3Input struct { // S3BucketName is a required field S3BucketName *string `type:"string" required:"true"` - // An Amazon Web Services Identity and Access Management (IAM) role to allow - // Amazon RDS to access your Amazon S3 bucket. + // An Amazon Web Services Identity and Access Management (IAM) role with a trust + // policy and a permissions policy that allows Amazon RDS to access your Amazon + // S3 bucket. For information about this role, see Creating an IAM role manually + // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.html#MySQL.Procedural.Importing.Enabling.IAM) + // in the Amazon RDS User Guide. // // S3IngestionRoleArn is a required field S3IngestionRoleArn *string `type:"string" required:"true"` @@ -62389,7 +62393,9 @@ func (s *SwitchoverReadReplicaOutput) SetDBInstance(v *DBInstance) *SwitchoverRe // Metadata assigned to an Amazon RDS resource consisting of a key-value pair. // // For more information, see Tagging Amazon RDS Resources (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html) -// in the Amazon RDS User Guide. +// in the Amazon RDS User Guide or Tagging Amazon Aurora and Amazon RDS Resources +// (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html) +// in the Amazon Aurora User Guide. type Tag struct { _ struct{} `type:"structure"` diff --git a/service/sagemaker/api.go b/service/sagemaker/api.go index c094daf81e0..f984178918c 100644 --- a/service/sagemaker/api.go +++ b/service/sagemaker/api.go @@ -12746,6 +12746,10 @@ func (c *SageMaker) DescribeModelPackageRequest(input *DescribeModelPackageInput // Returns a description of the specified model package, which is used to create // SageMaker models or list them on Amazon Web Services Marketplace. // +// If you provided a KMS Key ID when you created your model package, you will +// see the KMS Decrypt (https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) +// API call in your CloudTrail logs when you use this API. +// // To create models in SageMaker, buyers can subscribe to model packages listed // on Amazon Web Services Marketplace. // @@ -33293,22 +33297,25 @@ func (s *AthenaDatasetDefinition) SetWorkGroup(v string) *AthenaDatasetDefinitio return s } -// The collection of algorithms run on a dataset for training the model candidates -// of an Autopilot job. +// The selection of algorithms trained on your dataset to generate the model +// candidates for an Autopilot job. type AutoMLAlgorithmConfig struct { _ struct{} `type:"structure"` - // The selection of algorithms run on a dataset to train the model candidates - // of an Autopilot job. - // - // Selected algorithms must belong to the list corresponding to the training - // mode set in AutoMLJobConfig.Mode (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLJobConfig.html#sagemaker-Type-AutoMLJobConfig-Mode) - // (ENSEMBLING or HYPERPARAMETER_TUNING). Choose a minimum of 1 algorithm. + // The selection of algorithms trained on your dataset to generate the model + // candidates for an Autopilot job. // - // * In ENSEMBLING mode: "catboost" "extra-trees" "fastai" "lightgbm" "linear-learner" - // "nn-torch" "randomforest" "xgboost" + // * For the tabular problem type TabularJobConfig: Selected algorithms must + // belong to the list corresponding to the training mode set in AutoMLJobConfig.Mode + // (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLJobConfig.html#sagemaker-Type-AutoMLJobConfig-Mode) + // (ENSEMBLING or HYPERPARAMETER_TUNING). Choose a minimum of 1 algorithm. + // In ENSEMBLING mode: "catboost" "extra-trees" "fastai" "lightgbm" "linear-learner" + // "nn-torch" "randomforest" "xgboost" In HYPERPARAMETER_TUNING mode: "linear-learner" + // "mlp" "xgboost" // - // * In HYPERPARAMETER_TUNING mode: "linear-learner" "mlp" "xgboost" + // * For the time-series forecasting problem type TimeSeriesForecastingJobConfig: + // Choose your algorithms from this list. "cnn-qr" "deepar" "prophet" "arima" + // "npts" "ets" // // AutoMLAlgorithms is a required field AutoMLAlgorithms []*string `type:"list" required:"true" enum:"AutoMLAlgorithm"` @@ -33502,23 +33509,23 @@ func (s *AutoMLCandidate) SetObjectiveStatus(v string) *AutoMLCandidate { type AutoMLCandidateGenerationConfig struct { _ struct{} `type:"structure"` - // Stores the configuration information for the selection of algorithms used - // to train the model candidates. + // Stores the configuration information for the selection of algorithms trained + // on tabular data. // // The list of available algorithms to choose from depends on the training mode - // set in AutoMLJobConfig.Mode (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLJobConfig.html). + // set in TabularJobConfig.Mode (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_TabularJobConfig.html). // - // * AlgorithmsConfig should not be set in AUTO training mode. + // * AlgorithmsConfig should not be set if the training mode is set on AUTO. // // * When AlgorithmsConfig is provided, one AutoMLAlgorithms attribute must // be set and one only. If the list of algorithms provided as values for - // AutoMLAlgorithms is empty, AutoMLCandidateGenerationConfig uses the full - // set of algorithms for the given training mode. + // AutoMLAlgorithms is empty, CandidateGenerationConfig uses the full set + // of algorithms for the given training mode. // - // * When AlgorithmsConfig is not provided, AutoMLCandidateGenerationConfig - // uses the full set of algorithms for the given training mode. + // * When AlgorithmsConfig is not provided, CandidateGenerationConfig uses + // the full set of algorithms for the given training mode. // - // For the list of all algorithms per training mode, see AutoMLAlgorithmConfig + // For the list of all algorithms per problem type and training mode, see AutoMLAlgorithmConfig // (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLAlgorithmConfig.html). // // For more information on each algorithm, see the Algorithm support (https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-model-support-validation.html#autopilot-algorithm-support) @@ -35983,27 +35990,37 @@ func (s *CandidateArtifactLocations) SetModelInsights(v string) *CandidateArtifa type CandidateGenerationConfig struct { _ struct{} `type:"structure"` - // Stores the configuration information for the selection of algorithms used - // to train model candidates on tabular data. - // - // The list of available algorithms to choose from depends on the training mode - // set in TabularJobConfig.Mode (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_TabularJobConfig.html). - // - // * AlgorithmsConfig should not be set in AUTO training mode. - // - // * When AlgorithmsConfig is provided, one AutoMLAlgorithms attribute must - // be set and one only. If the list of algorithms provided as values for - // AutoMLAlgorithms is empty, CandidateGenerationConfig uses the full set - // of algorithms for the given training mode. - // - // * When AlgorithmsConfig is not provided, CandidateGenerationConfig uses - // the full set of algorithms for the given training mode. - // - // For the list of all algorithms per problem type and training mode, see AutoMLAlgorithmConfig - // (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLAlgorithmConfig.html). - // - // For more information on each algorithm, see the Algorithm support (https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-model-support-validation.html#autopilot-algorithm-support) - // section in Autopilot developer guide. + // Your Autopilot job trains a default set of algorithms on your dataset. For + // tabular and time-series data, you can customize the algorithm list by selecting + // a subset of algorithms for your problem type. + // + // AlgorithmsConfig stores the customized selection of algorithms to train on + // your data. + // + // * For the tabular problem type TabularJobConfig, the list of available + // algorithms to choose from depends on the training mode set in AutoMLJobConfig.Mode + // (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLJobConfig.html). + // AlgorithmsConfig should not be set when the training mode AutoMLJobConfig.Mode + // is set to AUTO. When AlgorithmsConfig is provided, one AutoMLAlgorithms + // attribute must be set and one only. If the list of algorithms provided + // as values for AutoMLAlgorithms is empty, CandidateGenerationConfig uses + // the full set of algorithms for the given training mode. When AlgorithmsConfig + // is not provided, CandidateGenerationConfig uses the full set of algorithms + // for the given training mode. For the list of all algorithms per training + // mode, see AlgorithmConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLAlgorithmConfig.html). + // For more information on each algorithm, see the Algorithm support (https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-model-support-validation.html#autopilot-algorithm-support) + // section in the Autopilot developer guide. + // + // * For the time-series forecasting problem type TimeSeriesForecastingJobConfig, + // choose your algorithms from the list provided in AlgorithmConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLAlgorithmConfig.html). + // For more information on each algorithm, see the Algorithms support for + // time-series forecasting (https://docs.aws.amazon.com/sagemaker/latest/dg/timeseries-forecasting-algorithms.html) + // section in the Autopilot developer guide. When AlgorithmsConfig is provided, + // one AutoMLAlgorithms attribute must be set and one only. If the list of + // algorithms provided as values for AutoMLAlgorithms is empty, CandidateGenerationConfig + // uses the full set of algorithms for time-series forecasting. When AlgorithmsConfig + // is not provided, CandidateGenerationConfig uses the full set of algorithms + // for time-series forecasting. AlgorithmsConfig []*AutoMLAlgorithmConfig `type:"list"` } @@ -46547,6 +46564,15 @@ type CreateModelPackageInput struct { // to deploy the model. ModelApprovalStatus *string `type:"string" enum:"ModelApprovalStatus"` + // The model card associated with the model package. Since ModelPackageModelCard + // is tied to a model package, it is a specific usage of a model card and its + // schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard + // schema does not include model_package_details, and model_overview is composed + // of the model_creator and model_artifact properties. For more information + // about the model card associated with the model package, see View the Details + // of a Model Version (https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html). + ModelCard *ModelPackageModelCard `type:"structure"` + // A structure that contains model metrics reports. ModelMetrics *ModelMetrics `type:"structure"` @@ -46575,6 +46601,9 @@ type CreateModelPackageInput struct { // call. SamplePayloadUrl *string `type:"string"` + // The KMS Key ID (KMSKeyId) used for encryption of model package information. + SecurityConfig *ModelPackageSecurityConfig `type:"structure"` + // Indicates if you want to skip model validation. SkipModelValidation *string `type:"string" enum:"SkipModelValidation"` @@ -46670,6 +46699,11 @@ func (s *CreateModelPackageInput) Validate() error { invalidParams.AddNested("ModelMetrics", err.(request.ErrInvalidParams)) } } + if s.SecurityConfig != nil { + if err := s.SecurityConfig.Validate(); err != nil { + invalidParams.AddNested("SecurityConfig", err.(request.ErrInvalidParams)) + } + } if s.SourceAlgorithmSpecification != nil { if err := s.SourceAlgorithmSpecification.Validate(); err != nil { invalidParams.AddNested("SourceAlgorithmSpecification", err.(request.ErrInvalidParams)) @@ -46751,6 +46785,12 @@ func (s *CreateModelPackageInput) SetModelApprovalStatus(v string) *CreateModelP return s } +// SetModelCard sets the ModelCard field's value. +func (s *CreateModelPackageInput) SetModelCard(v *ModelPackageModelCard) *CreateModelPackageInput { + s.ModelCard = v + return s +} + // SetModelMetrics sets the ModelMetrics field's value. func (s *CreateModelPackageInput) SetModelMetrics(v *ModelMetrics) *CreateModelPackageInput { s.ModelMetrics = v @@ -46781,6 +46821,12 @@ func (s *CreateModelPackageInput) SetSamplePayloadUrl(v string) *CreateModelPack return s } +// SetSecurityConfig sets the SecurityConfig field's value. +func (s *CreateModelPackageInput) SetSecurityConfig(v *ModelPackageSecurityConfig) *CreateModelPackageInput { + s.SecurityConfig = v + return s +} + // SetSkipModelValidation sets the SkipModelValidation field's value. func (s *CreateModelPackageInput) SetSkipModelValidation(v string) *CreateModelPackageInput { s.SkipModelValidation = &v @@ -64615,6 +64661,15 @@ type DescribeModelPackageOutput struct { // The approval status of the model package. ModelApprovalStatus *string `type:"string" enum:"ModelApprovalStatus"` + // The model card associated with the model package. Since ModelPackageModelCard + // is tied to a model package, it is a specific usage of a model card and its + // schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard + // schema does not include model_package_details, and model_overview is composed + // of the model_creator and model_artifact properties. For more information + // about the model card associated with the model package, see View the Details + // of a Model Version (https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html). + ModelCard *ModelPackageModelCard `type:"structure"` + // Metrics for the model. ModelMetrics *ModelMetrics `type:"structure"` @@ -64653,6 +64708,9 @@ type DescribeModelPackageOutput struct { // suffix). SamplePayloadUrl *string `type:"string"` + // The KMS Key ID (KMSKeyId) used for encryption of model package information. + SecurityConfig *ModelPackageSecurityConfig `type:"structure"` + // Indicates if you want to skip model validation. SkipModelValidation *string `type:"string" enum:"SkipModelValidation"` @@ -64767,6 +64825,12 @@ func (s *DescribeModelPackageOutput) SetModelApprovalStatus(v string) *DescribeM return s } +// SetModelCard sets the ModelCard field's value. +func (s *DescribeModelPackageOutput) SetModelCard(v *ModelPackageModelCard) *DescribeModelPackageOutput { + s.ModelCard = v + return s +} + // SetModelMetrics sets the ModelMetrics field's value. func (s *DescribeModelPackageOutput) SetModelMetrics(v *ModelMetrics) *DescribeModelPackageOutput { s.ModelMetrics = v @@ -64821,6 +64885,12 @@ func (s *DescribeModelPackageOutput) SetSamplePayloadUrl(v string) *DescribeMode return s } +// SetSecurityConfig sets the SecurityConfig field's value. +func (s *DescribeModelPackageOutput) SetSecurityConfig(v *ModelPackageSecurityConfig) *DescribeModelPackageOutput { + s.SecurityConfig = v + return s +} + // SetSkipModelValidation sets the SkipModelValidation field's value. func (s *DescribeModelPackageOutput) SetSkipModelValidation(v string) *DescribeModelPackageOutput { s.SkipModelValidation = &v @@ -83163,8 +83233,8 @@ type ListAppsInput struct { // A parameter to search for the domain ID. DomainIdEquals *string `type:"string"` - // This parameter defines the maximum number of results that can be returned - // in a single response. The MaxResults parameter is an upper bound, not a target. + // This parameter defines the maximum number of results that can be return in + // a single response. The MaxResults parameter is an upper bound, not a target. // If there are more results available than the value specified, a NextToken // is provided in the response. The NextToken indicates that the user should // get the next set of results by providing this token as a part of a subsequent @@ -85252,8 +85322,8 @@ func (s *ListDevicesOutput) SetNextToken(v string) *ListDevicesOutput { type ListDomainsInput struct { _ struct{} `type:"structure"` - // This parameter defines the maximum number of results that can be returned - // in a single response. The MaxResults parameter is an upper bound, not a target. + // This parameter defines the maximum number of results that can be return in + // a single response. The MaxResults parameter is an upper bound, not a target. // If there are more results available than the value specified, a NextToken // is provided in the response. The NextToken indicates that the user should // get the next set of results by providing this token as a part of a subsequent @@ -92414,8 +92484,8 @@ type ListSpacesInput struct { // A parameter to search for the domain ID. DomainIdEquals *string `type:"string"` - // This parameter defines the maximum number of results that can be returned - // in a single response. The MaxResults parameter is an upper bound, not a target. + // This parameter defines the maximum number of results that can be return in + // a single response. The MaxResults parameter is an upper bound, not a target. // If there are more results available than the value specified, a NextToken // is provided in the response. The NextToken indicates that the user should // get the next set of results by providing this token as a part of a subsequent @@ -93912,8 +93982,8 @@ type ListUserProfilesInput struct { // A parameter by which to filter the results. DomainIdEquals *string `type:"string"` - // This parameter defines the maximum number of results that can be returned - // in a single response. The MaxResults parameter is an upper bound, not a target. + // This parameter defines the maximum number of results that can be return in + // a single response. The MaxResults parameter is an upper bound, not a target. // If there are more results available than the value specified, a NextToken // is provided in the response. The NextToken indicates that the user should // get the next set of results by providing this token as a part of a subsequent @@ -97193,6 +97263,15 @@ type ModelPackage struct { // * PENDING_MANUAL_APPROVAL - The model is waiting for manual approval. ModelApprovalStatus *string `type:"string" enum:"ModelApprovalStatus"` + // The model card associated with the model package. Since ModelPackageModelCard + // is tied to a model package, it is a specific usage of a model card and its + // schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard + // schema does not include model_package_details, and model_overview is composed + // of the model_creator and model_artifact properties. For more information + // about the model card associated with the model package, see View the Details + // of a Model Version (https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html). + ModelCard *ModelPackageModelCard `type:"structure"` + // Metrics for the model. ModelMetrics *ModelMetrics `type:"structure"` @@ -97231,6 +97310,10 @@ type ModelPackage struct { // This path must point to a single gzip compressed tar archive (.tar.gz suffix). SamplePayloadUrl *string `type:"string"` + // An optional Key Management Service key to encrypt, decrypt, and re-encrypt + // model package information for regulated workloads with highly sensitive data. + SecurityConfig *ModelPackageSecurityConfig `type:"structure"` + // Indicates if you want to skip model validation. SkipModelValidation *string `type:"string" enum:"SkipModelValidation"` @@ -97350,6 +97433,12 @@ func (s *ModelPackage) SetModelApprovalStatus(v string) *ModelPackage { return s } +// SetModelCard sets the ModelCard field's value. +func (s *ModelPackage) SetModelCard(v *ModelPackageModelCard) *ModelPackage { + s.ModelCard = v + return s +} + // SetModelMetrics sets the ModelMetrics field's value. func (s *ModelPackage) SetModelMetrics(v *ModelMetrics) *ModelPackage { s.ModelMetrics = v @@ -97404,6 +97493,12 @@ func (s *ModelPackage) SetSamplePayloadUrl(v string) *ModelPackage { return s } +// SetSecurityConfig sets the SecurityConfig field's value. +func (s *ModelPackage) SetSecurityConfig(v *ModelPackageSecurityConfig) *ModelPackage { + s.SecurityConfig = v + return s +} + // SetSkipModelValidation sets the SkipModelValidation field's value. func (s *ModelPackage) SetSkipModelValidation(v string) *ModelPackage { s.SkipModelValidation = &v @@ -97799,6 +97894,116 @@ func (s *ModelPackageGroupSummary) SetModelPackageGroupStatus(v string) *ModelPa return s } +// The model card associated with the model package. Since ModelPackageModelCard +// is tied to a model package, it is a specific usage of a model card and its +// schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard +// schema does not include model_package_details, and model_overview is composed +// of the model_creator and model_artifact properties. For more information +// about the model card associated with the model package, see View the Details +// of a Model Version (https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html). +type ModelPackageModelCard struct { + _ struct{} `type:"structure"` + + // The content of the model card. + // + // ModelCardContent is a sensitive parameter and its value will be + // replaced with "sensitive" in string returned by ModelPackageModelCard's + // String and GoString methods. + ModelCardContent *string `type:"string" sensitive:"true"` + + // The approval status of the model card within your organization. Different + // organizations might have different criteria for model card review and approval. + // + // * Draft: The model card is a work in progress. + // + // * PendingReview: The model card is pending review. + // + // * Approved: The model card is approved. + // + // * Archived: The model card is archived. No more updates can be made to + // the model card content. If you try to update the model card content, you + // will receive the message Model Card is in Archived state. + ModelCardStatus *string `type:"string" enum:"ModelCardStatus"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ModelPackageModelCard) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ModelPackageModelCard) GoString() string { + return s.String() +} + +// SetModelCardContent sets the ModelCardContent field's value. +func (s *ModelPackageModelCard) SetModelCardContent(v string) *ModelPackageModelCard { + s.ModelCardContent = &v + return s +} + +// SetModelCardStatus sets the ModelCardStatus field's value. +func (s *ModelPackageModelCard) SetModelCardStatus(v string) *ModelPackageModelCard { + s.ModelCardStatus = &v + return s +} + +// An optional Key Management Service key to encrypt, decrypt, and re-encrypt +// model package information for regulated workloads with highly sensitive data. +type ModelPackageSecurityConfig struct { + _ struct{} `type:"structure"` + + // The KMS Key ID (KMSKeyId) used for encryption of model package information. + // + // KmsKeyId is a required field + KmsKeyId *string `type:"string" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ModelPackageSecurityConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ModelPackageSecurityConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModelPackageSecurityConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModelPackageSecurityConfig"} + if s.KmsKeyId == nil { + invalidParams.Add(request.NewErrParamRequired("KmsKeyId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *ModelPackageSecurityConfig) SetKmsKeyId(v string) *ModelPackageSecurityConfig { + s.KmsKeyId = &v + return s +} + // Specifies the validation and image scan statuses of the model package. type ModelPackageStatusDetails struct { _ struct{} `type:"structure"` @@ -116044,6 +116249,10 @@ func (s *TimeSeriesConfig) SetTimestampAttributeName(v string) *TimeSeriesConfig type TimeSeriesForecastingJobConfig struct { _ struct{} `type:"structure"` + // Stores the configuration information for how model candidates are generated + // using an AutoML job V2. + CandidateGenerationConfig *CandidateGenerationConfig `type:"structure"` + // How long a job is allowed to run, or how many candidates a job is allowed // to generate. CompletionCriteria *AutoMLJobCompletionCriteria `type:"structure"` @@ -116164,6 +116373,11 @@ func (s *TimeSeriesForecastingJobConfig) Validate() error { if s.TimeSeriesConfig == nil { invalidParams.Add(request.NewErrParamRequired("TimeSeriesConfig")) } + if s.CandidateGenerationConfig != nil { + if err := s.CandidateGenerationConfig.Validate(); err != nil { + invalidParams.AddNested("CandidateGenerationConfig", err.(request.ErrInvalidParams)) + } + } if s.CompletionCriteria != nil { if err := s.CompletionCriteria.Validate(); err != nil { invalidParams.AddNested("CompletionCriteria", err.(request.ErrInvalidParams)) @@ -116196,6 +116410,12 @@ func (s *TimeSeriesForecastingJobConfig) Validate() error { return nil } +// SetCandidateGenerationConfig sets the CandidateGenerationConfig field's value. +func (s *TimeSeriesForecastingJobConfig) SetCandidateGenerationConfig(v *CandidateGenerationConfig) *TimeSeriesForecastingJobConfig { + s.CandidateGenerationConfig = v + return s +} + // SetCompletionCriteria sets the CompletionCriteria field's value. func (s *TimeSeriesForecastingJobConfig) SetCompletionCriteria(v *AutoMLJobCompletionCriteria) *TimeSeriesForecastingJobConfig { s.CompletionCriteria = v @@ -122882,6 +123102,15 @@ type UpdateModelPackageInput struct { // The approval status of the model. ModelApprovalStatus *string `type:"string" enum:"ModelApprovalStatus"` + // The model card associated with the model package. Since ModelPackageModelCard + // is tied to a model package, it is a specific usage of a model card and its + // schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard + // schema does not include model_package_details, and model_overview is composed + // of the model_creator and model_artifact properties. For more information + // about the model card associated with the model package, see View the Details + // of a Model Version (https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html). + ModelCard *ModelPackageModelCard `type:"structure"` + // The Amazon Resource Name (ARN) of the model package. // // ModelPackageArn is a required field @@ -122982,6 +123211,12 @@ func (s *UpdateModelPackageInput) SetModelApprovalStatus(v string) *UpdateModelP return s } +// SetModelCard sets the ModelCard field's value. +func (s *UpdateModelPackageInput) SetModelCard(v *ModelPackageModelCard) *UpdateModelPackageInput { + s.ModelCard = v + return s +} + // SetModelPackageArn sets the ModelPackageArn field's value. func (s *UpdateModelPackageInput) SetModelPackageArn(v string) *UpdateModelPackageInput { s.ModelPackageArn = &v @@ -127263,6 +127498,24 @@ const ( // AutoMLAlgorithmFastai is a AutoMLAlgorithm enum value AutoMLAlgorithmFastai = "fastai" + + // AutoMLAlgorithmCnnQr is a AutoMLAlgorithm enum value + AutoMLAlgorithmCnnQr = "cnn-qr" + + // AutoMLAlgorithmDeepar is a AutoMLAlgorithm enum value + AutoMLAlgorithmDeepar = "deepar" + + // AutoMLAlgorithmProphet is a AutoMLAlgorithm enum value + AutoMLAlgorithmProphet = "prophet" + + // AutoMLAlgorithmNpts is a AutoMLAlgorithm enum value + AutoMLAlgorithmNpts = "npts" + + // AutoMLAlgorithmArima is a AutoMLAlgorithm enum value + AutoMLAlgorithmArima = "arima" + + // AutoMLAlgorithmEts is a AutoMLAlgorithm enum value + AutoMLAlgorithmEts = "ets" ) // AutoMLAlgorithm_Values returns all elements of the AutoMLAlgorithm enum @@ -127277,6 +127530,12 @@ func AutoMLAlgorithm_Values() []string { AutoMLAlgorithmExtraTrees, AutoMLAlgorithmNnTorch, AutoMLAlgorithmFastai, + AutoMLAlgorithmCnnQr, + AutoMLAlgorithmDeepar, + AutoMLAlgorithmProphet, + AutoMLAlgorithmNpts, + AutoMLAlgorithmArima, + AutoMLAlgorithmEts, } }