diff --git a/.changelog/139066346415457b8dac4ec265cb1710.json b/.changelog/139066346415457b8dac4ec265cb1710.json new file mode 100644 index 00000000000..c3ee077e475 --- /dev/null +++ b/.changelog/139066346415457b8dac4ec265cb1710.json @@ -0,0 +1,8 @@ +{ + "id": "13906634-6415-457b-8dac-4ec265cb1710", + "type": "feature", + "description": "Introduces query decomposition, enhanced Agents integration with Knowledge bases, session summary generation, and code interpretation (preview) for Claude V3 Sonnet and Haiku models. Also introduces Prompt Flows (preview) to link prompts, foundational models, and resources for end-to-end solutions.", + "modules": [ + "service/bedrockagentruntime" + ] +} \ No newline at end of file diff --git a/.changelog/592fb91e841049588522bd9a497c668e.json b/.changelog/592fb91e841049588522bd9a497c668e.json new file mode 100644 index 00000000000..14f922f94b4 --- /dev/null +++ b/.changelog/592fb91e841049588522bd9a497c668e.json @@ -0,0 +1,8 @@ +{ + "id": "592fb91e-8410-4958-8522-bd9a497c668e", + "type": "feature", + "description": "Introduces new data sources and chunking strategies for Knowledge bases, advanced parsing logic using FMs, session summary generation, and code interpretation (preview) for Claude V3 Sonnet and Haiku models. Also introduces Prompt Flows (preview) to link prompts, foundational models, and resources.", + "modules": [ + "service/bedrockagent" + ] +} \ No newline at end of file diff --git a/.changelog/694943c0ece447a1906bdf2cba0270a1.json b/.changelog/694943c0ece447a1906bdf2cba0270a1.json new file mode 100644 index 00000000000..75971b634a4 --- /dev/null +++ b/.changelog/694943c0ece447a1906bdf2cba0270a1.json @@ -0,0 +1,8 @@ +{ + "id": "694943c0-ece4-47a1-906b-df2cba0270a1", + "type": "feature", + "description": "Add support for contextual grounding check and ApplyGuardrail API for Guardrails for Amazon Bedrock.", + "modules": [ + "service/bedrockruntime" + ] +} \ No newline at end of file diff --git a/.changelog/7542114aa8b747e494e72b09ad0a151c.json b/.changelog/7542114aa8b747e494e72b09ad0a151c.json new file mode 100644 index 00000000000..3334da130f0 --- /dev/null +++ b/.changelog/7542114aa8b747e494e72b09ad0a151c.json @@ -0,0 +1,8 @@ +{ + "id": "7542114a-a8b7-47e4-94e7-2b09ad0a151c", + "type": "feature", + "description": "Add support for third party subscription providers, starting with RHEL subscriptions through Red Hat Subscription Manager (RHSM). Additionally, add support for tagging subscription provider resources, and detect when an instance has more than one Linux subscription and notify the customer.", + "modules": [ + "service/licensemanagerlinuxsubscriptions" + ] +} \ No newline at end of file diff --git a/.changelog/8103caba7db14dbca547b3faac39ae6b.json b/.changelog/8103caba7db14dbca547b3faac39ae6b.json new file mode 100644 index 00000000000..172d1f00572 --- /dev/null +++ b/.changelog/8103caba7db14dbca547b3faac39ae6b.json @@ -0,0 +1,8 @@ +{ + "id": "8103caba-7db1-4dbc-a547-b3faac39ae6b", + "type": "feature", + "description": "Add support for contextual grounding check for Guardrails for Amazon Bedrock.", + "modules": [ + "service/bedrock" + ] +} \ No newline at end of file diff --git a/.changelog/8daadf6030c74801925ee33007de85da.json b/.changelog/8daadf6030c74801925ee33007de85da.json new file mode 100644 index 00000000000..54f94547750 --- /dev/null +++ b/.changelog/8daadf6030c74801925ee33007de85da.json @@ -0,0 +1,8 @@ +{ + "id": "8daadf60-30c7-4801-925e-e33007de85da", + "type": "documentation", + "description": "Documentation update specifying OEM ephemeris units of measurement", + "modules": [ + "service/groundstation" + ] +} \ No newline at end of file diff --git a/.changelog/9f1da4aea54c4deeaa622e775ae6ca93.json b/.changelog/9f1da4aea54c4deeaa622e775ae6ca93.json new file mode 100644 index 00000000000..f85060c4e8d --- /dev/null +++ b/.changelog/9f1da4aea54c4deeaa622e775ae6ca93.json @@ -0,0 +1,8 @@ +{ + "id": "9f1da4ae-a54c-4dee-aa62-2e775ae6ca93", + "type": "feature", + "description": "This feature allows AWS Batch Jobs with EKS container orchestration type to be run as Multi-Node Parallel Jobs.", + "modules": [ + "service/batch" + ] +} \ No newline at end of file diff --git a/.changelog/a77dee5265ad424196b7adbf16c5c132.json b/.changelog/a77dee5265ad424196b7adbf16c5c132.json new file mode 100644 index 00000000000..30d83a50ef1 --- /dev/null +++ b/.changelog/a77dee5265ad424196b7adbf16c5c132.json @@ -0,0 +1,8 @@ +{ + "id": "a77dee52-65ad-4241-96b7-adbf16c5c132", + "type": "feature", + "description": "Add parameters to enable provisioning IPAM BYOIPv4 space at a Local Zone Network Border Group level", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/b30e3470ce8d4aa8a4f39363e769de81.json b/.changelog/b30e3470ce8d4aa8a4f39363e769de81.json new file mode 100644 index 00000000000..18f96ae3ffd --- /dev/null +++ b/.changelog/b30e3470ce8d4aa8a4f39363e769de81.json @@ -0,0 +1,8 @@ +{ + "id": "b30e3470-ce8d-4aa8-a4f3-9363e769de81", + "type": "feature", + "description": "AWS Elemental MediaConnect introduces the ability to disable outputs. Disabling an output allows you to keep the output attached to the flow, but stop streaming to the output destination. A disabled output does not incur data transfer costs.", + "modules": [ + "service/mediaconnect" + ] +} \ No newline at end of file diff --git a/.changelog/e9a995f030e24afe86c8a10da3ceb209.json b/.changelog/e9a995f030e24afe86c8a10da3ceb209.json new file mode 100644 index 00000000000..649cdf69fb3 --- /dev/null +++ b/.changelog/e9a995f030e24afe86c8a10da3ceb209.json @@ -0,0 +1,8 @@ +{ + "id": "e9a995f0-30e2-4afe-86c8-a10da3ceb209", + "type": "feature", + "description": "Add recipe step support for recipe node", + "modules": [ + "service/glue" + ] +} \ No newline at end of file diff --git a/feature/dynamodb/attributevalue/go.mod b/feature/dynamodb/attributevalue/go.mod index 14b0d92e9fd..4555ff631fb 100644 --- a/feature/dynamodb/attributevalue/go.mod +++ b/feature/dynamodb/attributevalue/go.mod @@ -8,10 +8,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.1 ) -require ( - github.com/aws/smithy-go v1.20.3 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect -) +require github.com/aws/smithy-go v1.20.3 // indirect replace github.com/aws/aws-sdk-go-v2 => ../../../ diff --git a/feature/dynamodb/attributevalue/go.sum b/feature/dynamodb/attributevalue/go.sum index eb1604bcdab..07970476de0 100644 --- a/feature/dynamodb/attributevalue/go.sum +++ b/feature/dynamodb/attributevalue/go.sum @@ -1,14 +1,2 @@ github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/feature/dynamodbstreams/attributevalue/go.mod b/feature/dynamodbstreams/attributevalue/go.mod index 23ead6a2fff..1258bb5a8cd 100644 --- a/feature/dynamodbstreams/attributevalue/go.mod +++ b/feature/dynamodbstreams/attributevalue/go.mod @@ -8,10 +8,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.1 ) -require ( - github.com/aws/smithy-go v1.20.3 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect -) +require github.com/aws/smithy-go v1.20.3 // indirect replace github.com/aws/aws-sdk-go-v2 => ../../../ diff --git a/feature/dynamodbstreams/attributevalue/go.sum b/feature/dynamodbstreams/attributevalue/go.sum index eb1604bcdab..07970476de0 100644 --- a/feature/dynamodbstreams/attributevalue/go.sum +++ b/feature/dynamodbstreams/attributevalue/go.sum @@ -1,14 +1,2 @@ github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/feature/dynamodbstreams/attributevalue/go_module_metadata.go b/feature/dynamodbstreams/attributevalue/go_module_metadata.go index 266c70ef78d..b70823954d4 100644 --- a/feature/dynamodbstreams/attributevalue/go_module_metadata.go +++ b/feature/dynamodbstreams/attributevalue/go_module_metadata.go @@ -3,4 +3,4 @@ package attributevalue // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.44" +const goModuleVersion = "1.14.7" diff --git a/feature/s3/manager/go.mod b/feature/s3/manager/go.mod index 5d33efa9ab7..4a4c5ac9d0e 100644 --- a/feature/s3/manager/go.mod +++ b/feature/s3/manager/go.mod @@ -24,7 +24,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/sso v1.22.1 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.2 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.30.1 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect ) replace github.com/aws/aws-sdk-go-v2 => ../../../ diff --git a/feature/s3/manager/go.sum b/feature/s3/manager/go.sum index eb1604bcdab..07970476de0 100644 --- a/feature/s3/manager/go.sum +++ b/feature/s3/manager/go.sum @@ -1,14 +1,2 @@ github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/batch/deserializers.go b/service/batch/deserializers.go index 69a5fdb6c49..28506ecd47f 100644 --- a/service/batch/deserializers.go +++ b/service/batch/deserializers.go @@ -5651,6 +5651,15 @@ func awsRestjson1_deserializeDocumentEksAttemptDetail(v **types.EksAttemptDetail return err } + case "eksClusterArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EksClusterArn = ptr.String(jtv) + } + case "initContainers": if err := awsRestjson1_deserializeDocumentEksAttemptContainerDetails(&sv.InitContainers, value); err != nil { return err @@ -9537,6 +9546,11 @@ func awsRestjson1_deserializeDocumentNodeRangeProperty(v **types.NodeRangeProper return err } + case "eksProperties": + if err := awsRestjson1_deserializeDocumentEksProperties(&sv.EksProperties, value); err != nil { + return err + } + case "instanceTypes": if err := awsRestjson1_deserializeDocumentStringList(&sv.InstanceTypes, value); err != nil { return err diff --git a/service/batch/serializers.go b/service/batch/serializers.go index 2b9a31efa73..0fa6bc70207 100644 --- a/service/batch/serializers.go +++ b/service/batch/serializers.go @@ -4050,6 +4050,13 @@ func awsRestjson1_serializeDocumentNodePropertyOverride(v *types.NodePropertyOve } } + if v.EksPropertiesOverride != nil { + ok := object.Key("eksPropertiesOverride") + if err := awsRestjson1_serializeDocumentEksPropertiesOverride(v.EksPropertiesOverride, ok); err != nil { + return err + } + } + if v.InstanceTypes != nil { ok := object.Key("instanceTypes") if err := awsRestjson1_serializeDocumentStringList(v.InstanceTypes, ok); err != nil { @@ -4109,6 +4116,13 @@ func awsRestjson1_serializeDocumentNodeRangeProperty(v *types.NodeRangeProperty, } } + if v.EksProperties != nil { + ok := object.Key("eksProperties") + if err := awsRestjson1_serializeDocumentEksProperties(v.EksProperties, ok); err != nil { + return err + } + } + if v.InstanceTypes != nil { ok := object.Key("instanceTypes") if err := awsRestjson1_serializeDocumentStringList(v.InstanceTypes, ok); err != nil { diff --git a/service/batch/types/types.go b/service/batch/types/types.go index 866cbd777cc..e876178c03c 100644 --- a/service/batch/types/types.go +++ b/service/batch/types/types.go @@ -1722,6 +1722,9 @@ type EksAttemptDetail struct { // The details for the final status of the containers for this job attempt. Containers []EksAttemptContainerDetail + // The Amazon Resource Name (ARN) of the Amazon EKS cluster. + EksClusterArn *string + // The details for the init containers. InitContainers []EksAttemptContainerDetail @@ -3440,6 +3443,10 @@ type NodePropertyOverride struct { // existing Amazon ECS resources of a job. EcsPropertiesOverride *EcsPropertiesOverride + // An object that contains the properties that you want to replace for the + // existing Amazon EKS resources of a job. + EksPropertiesOverride *EksPropertiesOverride + // An object that contains the instance types that you want to replace for the // existing resources of a job. InstanceTypes []string @@ -3469,6 +3476,10 @@ type NodeRangeProperty struct { // multi-node parallel job. EcsProperties *EcsProperties + // This is an object that represents the properties of the node range for a + // multi-node parallel job. + EksProperties *EksProperties + // The instance types of the underlying host infrastructure of a multi-node // parallel job. // diff --git a/service/batch/validators.go b/service/batch/validators.go index a7ed6c11e38..92649e24d93 100644 --- a/service/batch/validators.go +++ b/service/batch/validators.go @@ -1349,6 +1349,11 @@ func validateNodePropertyOverride(v *types.NodePropertyOverride) error { invalidParams.AddNested("EcsPropertiesOverride", err.(smithy.InvalidParamsError)) } } + if v.EksPropertiesOverride != nil { + if err := validateEksPropertiesOverride(v.EksPropertiesOverride); err != nil { + invalidParams.AddNested("EksPropertiesOverride", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1408,6 +1413,11 @@ func validateNodeRangeProperty(v *types.NodeRangeProperty) error { invalidParams.AddNested("EcsProperties", err.(smithy.InvalidParamsError)) } } + if v.EksProperties != nil { + if err := validateEksProperties(v.EksProperties); err != nil { + invalidParams.AddNested("EksProperties", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/bedrock/api_op_CreateGuardrail.go b/service/bedrock/api_op_CreateGuardrail.go index f68a54d0d6e..df7c6ca7ef3 100644 --- a/service/bedrock/api_op_CreateGuardrail.go +++ b/service/bedrock/api_op_CreateGuardrail.go @@ -12,43 +12,34 @@ import ( "time" ) -// Creates a guardrail to block topics and to filter out harmful content. +// Creates a guardrail to block topics and to implement safeguards for your +// generative AI applications. // -// - Specify a name and optional description . +// You can configure the following policies in a guardrail to avoid undesirable +// and harmful content, filter out denied topics and words, and remove sensitive +// information for privacy protection. // -// - Specify messages for when the guardrail successfully blocks a prompt or a -// model response in the blockedInputMessaging and blockedOutputsMessaging fields. +// - Content filters - Adjust filter strengths to block input prompts or model +// responses containing harmful content. // -// - Specify topics for the guardrail to deny in the topicPolicyConfig object. -// Each [GuardrailTopicConfig]object in the topicsConfig list pertains to one topic. +// - Denied topics - Define a set of topics that are undesirable in the context +// of your application. These topics will be blocked if detected in user queries or +// model responses. // -// - Give a name and description so that the guardrail can properly identify the -// topic. +// - Word filters - Configure filters to block undesirable words, phrases, and +// profanity. Such words can include offensive terms, competitor names etc. // -// - Specify DENY in the type field. +// - Sensitive information filters - Block or mask sensitive information such as +// personally identifiable information (PII) or custom regex in user inputs and +// model responses. // -// - (Optional) Provide up to five prompts that you would categorize as -// belonging to the topic in the examples list. +// In addition to the above policies, you can also configure the messages to be +// returned to the user if a user input or model response is in violation of the +// policies defined in the guardrail. // -// - Specify filter strengths for the harmful categories defined in Amazon -// Bedrock in the contentPolicyConfig object. Each [GuardrailContentFilterConfig]object in the filtersConfig -// list pertains to a harmful category. For more information, see [Content filters]. For more -// information about the fields in a content filter, see [GuardrailContentFilterConfig]. +// For more information, see [Guardrails for Amazon Bedrock] in the Amazon Bedrock User Guide. // -// - Specify the category in the type field. -// -// - Specify the strength of the filter for prompts in the inputStrength field -// and for model responses in the strength field of the [GuardrailContentFilterConfig]. -// -// - (Optional) For security, include the ARN of a KMS key in the kmsKeyId field. -// -// - (Optional) Attach any tags to the guardrail in the tags object. For more -// information, see [Tag resources]. -// -// [GuardrailContentFilterConfig]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GuardrailContentFilterConfig.html -// [Content filters]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-filters -// [Tag resources]: https://docs.aws.amazon.com/bedrock/latest/userguide/tagging -// [GuardrailTopicConfig]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GuardrailTopicConfig.html +// [Guardrails for Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html func (c *Client) CreateGuardrail(ctx context.Context, params *CreateGuardrailInput, optFns ...func(*Options)) (*CreateGuardrailOutput, error) { if params == nil { params = &CreateGuardrailInput{} @@ -92,6 +83,9 @@ type CreateGuardrailInput struct { // The content filter policies to configure for the guardrail. ContentPolicyConfig *types.GuardrailContentPolicyConfig + // The contextual grounding policy configuration used to create a guardrail. + ContextualGroundingPolicyConfig *types.GuardrailContextualGroundingPolicyConfig + // A description of the guardrail. Description *string @@ -120,7 +114,7 @@ type CreateGuardrailOutput struct { // This member is required. CreatedAt *time.Time - // The ARN of the guardrail that was created. + // The ARN of the guardrail. // // This member is required. GuardrailArn *string @@ -130,7 +124,7 @@ type CreateGuardrailOutput struct { // This member is required. GuardrailId *string - // The version of the guardrail that was created. This value should be 1. + // The version of the guardrail that was created. This value will always be DRAFT . // // This member is required. Version *string diff --git a/service/bedrock/api_op_CreateGuardrailVersion.go b/service/bedrock/api_op_CreateGuardrailVersion.go index a7aeaed3505..dcb3691285e 100644 --- a/service/bedrock/api_op_CreateGuardrailVersion.go +++ b/service/bedrock/api_op_CreateGuardrailVersion.go @@ -30,7 +30,7 @@ func (c *Client) CreateGuardrailVersion(ctx context.Context, params *CreateGuard type CreateGuardrailVersionInput struct { - // The unique identifier of the guardrail. + // The unique identifier of the guardrail. This can be an ID or the ARN. // // This member is required. GuardrailIdentifier *string diff --git a/service/bedrock/api_op_DeleteGuardrail.go b/service/bedrock/api_op_DeleteGuardrail.go index 3d20b8bd8ea..65af9e73dc8 100644 --- a/service/bedrock/api_op_DeleteGuardrail.go +++ b/service/bedrock/api_op_DeleteGuardrail.go @@ -35,7 +35,7 @@ func (c *Client) DeleteGuardrail(ctx context.Context, params *DeleteGuardrailInp type DeleteGuardrailInput struct { - // The unique identifier of the guardrail. + // The unique identifier of the guardrail. This can be an ID or the ARN. // // This member is required. GuardrailIdentifier *string diff --git a/service/bedrock/api_op_GetGuardrail.go b/service/bedrock/api_op_GetGuardrail.go index 8f9d45ac6c9..10ef61a2f1a 100644 --- a/service/bedrock/api_op_GetGuardrail.go +++ b/service/bedrock/api_op_GetGuardrail.go @@ -31,7 +31,8 @@ func (c *Client) GetGuardrail(ctx context.Context, params *GetGuardrailInput, op type GetGuardrailInput struct { - // The unique identifier of the guardrail for which to get details. + // The unique identifier of the guardrail for which to get details. This can be an + // ID or the ARN. // // This member is required. GuardrailIdentifier *string @@ -60,7 +61,7 @@ type GetGuardrailOutput struct { // This member is required. CreatedAt *time.Time - // The ARN of the guardrail that was created. + // The ARN of the guardrail. // // This member is required. GuardrailArn *string @@ -93,6 +94,9 @@ type GetGuardrailOutput struct { // The content policy that was configured for the guardrail. ContentPolicy *types.GuardrailContentPolicy + // The contextual grounding policy used in the guardrail. + ContextualGroundingPolicy *types.GuardrailContextualGroundingPolicy + // The description of the guardrail. Description *string diff --git a/service/bedrock/api_op_ListGuardrails.go b/service/bedrock/api_op_ListGuardrails.go index fe130faacd8..b91b7be333c 100644 --- a/service/bedrock/api_op_ListGuardrails.go +++ b/service/bedrock/api_op_ListGuardrails.go @@ -37,7 +37,7 @@ func (c *Client) ListGuardrails(ctx context.Context, params *ListGuardrailsInput type ListGuardrailsInput struct { - // The unique identifier of the guardrail. + // The unique identifier of the guardrail. This can be an ID or the ARN. GuardrailIdentifier *string // The maximum number of results to return in the response. diff --git a/service/bedrock/api_op_UpdateGuardrail.go b/service/bedrock/api_op_UpdateGuardrail.go index daeb3d12e45..2216484a514 100644 --- a/service/bedrock/api_op_UpdateGuardrail.go +++ b/service/bedrock/api_op_UpdateGuardrail.go @@ -42,12 +42,8 @@ import ( // // - (Optional) For security, include the ARN of a KMS key in the kmsKeyId field. // -// - (Optional) Attach any tags to the guardrail in the tags object. For more -// information, see [Tag resources]. -// // [GuardrailContentFilterConfig]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GuardrailContentFilterConfig.html -// [Content filters]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-filters -// [Tag resources]: https://docs.aws.amazon.com/bedrock/latest/userguide/tagging +// [Content filters]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-content-filters // [GuardrailTopicConfig]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GuardrailTopicConfig.html func (c *Client) UpdateGuardrail(ctx context.Context, params *UpdateGuardrailInput, optFns ...func(*Options)) (*UpdateGuardrailOutput, error) { if params == nil { @@ -76,7 +72,7 @@ type UpdateGuardrailInput struct { // This member is required. BlockedOutputsMessaging *string - // The unique identifier of the guardrail + // The unique identifier of the guardrail. This can be an ID or the ARN. // // This member is required. GuardrailIdentifier *string @@ -89,6 +85,9 @@ type UpdateGuardrailInput struct { // The content policy to configure for the guardrail. ContentPolicyConfig *types.GuardrailContentPolicyConfig + // The contextual grounding policy configuration used to update a guardrail. + ContextualGroundingPolicyConfig *types.GuardrailContextualGroundingPolicyConfig + // A description of the guardrail. Description *string @@ -109,7 +108,7 @@ type UpdateGuardrailInput struct { type UpdateGuardrailOutput struct { - // The ARN of the guardrail that was created. + // The ARN of the guardrail. // // This member is required. GuardrailArn *string diff --git a/service/bedrock/deserializers.go b/service/bedrock/deserializers.go index e1dbf1f571a..279bbe3ffd5 100644 --- a/service/bedrock/deserializers.go +++ b/service/bedrock/deserializers.go @@ -2153,6 +2153,11 @@ func awsRestjson1_deserializeOpDocumentGetGuardrailOutput(v **GetGuardrailOutput return err } + case "contextualGroundingPolicy": + if err := awsRestjson1_deserializeDocumentGuardrailContextualGroundingPolicy(&sv.ContextualGroundingPolicy, value); err != nil { + return err + } + case "createdAt": if value != nil { jtv, ok := value.(string) @@ -6639,6 +6644,150 @@ func awsRestjson1_deserializeDocumentGuardrailContentPolicy(v **types.GuardrailC return nil } +func awsRestjson1_deserializeDocumentGuardrailContextualGroundingFilter(v **types.GuardrailContextualGroundingFilter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GuardrailContextualGroundingFilter + if *v == nil { + sv = &types.GuardrailContextualGroundingFilter{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "threshold": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Threshold = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Threshold = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuardrailContextualGroundingFilterType to be of type string, got %T instead", value) + } + sv.Type = types.GuardrailContextualGroundingFilterType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGuardrailContextualGroundingFilters(v *[]types.GuardrailContextualGroundingFilter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.GuardrailContextualGroundingFilter + if *v == nil { + cv = []types.GuardrailContextualGroundingFilter{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GuardrailContextualGroundingFilter + destAddr := &col + if err := awsRestjson1_deserializeDocumentGuardrailContextualGroundingFilter(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentGuardrailContextualGroundingPolicy(v **types.GuardrailContextualGroundingPolicy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GuardrailContextualGroundingPolicy + if *v == nil { + sv = &types.GuardrailContextualGroundingPolicy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "filters": + if err := awsRestjson1_deserializeDocumentGuardrailContextualGroundingFilters(&sv.Filters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentGuardrailFailureRecommendations(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/bedrock/serializers.go b/service/bedrock/serializers.go index 16f57323693..01fc932e49b 100644 --- a/service/bedrock/serializers.go +++ b/service/bedrock/serializers.go @@ -13,6 +13,7 @@ import ( "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" + "math" ) type awsRestjson1_serializeOpCreateEvaluationJob struct { @@ -227,6 +228,13 @@ func awsRestjson1_serializeOpDocumentCreateGuardrailInput(v *CreateGuardrailInpu } } + if v.ContextualGroundingPolicyConfig != nil { + ok := object.Key("contextualGroundingPolicyConfig") + if err := awsRestjson1_serializeDocumentGuardrailContextualGroundingPolicyConfig(v.ContextualGroundingPolicyConfig, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -2362,6 +2370,13 @@ func awsRestjson1_serializeOpDocumentUpdateGuardrailInput(v *UpdateGuardrailInpu } } + if v.ContextualGroundingPolicyConfig != nil { + ok := object.Key("contextualGroundingPolicyConfig") + if err := awsRestjson1_serializeDocumentGuardrailContextualGroundingPolicyConfig(v.ContextualGroundingPolicyConfig, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -2771,6 +2786,63 @@ func awsRestjson1_serializeDocumentGuardrailContentPolicyConfig(v *types.Guardra return nil } +func awsRestjson1_serializeDocumentGuardrailContextualGroundingFilterConfig(v *types.GuardrailContextualGroundingFilterConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Threshold != nil { + ok := object.Key("threshold") + switch { + case math.IsNaN(*v.Threshold): + ok.String("NaN") + + case math.IsInf(*v.Threshold, 1): + ok.String("Infinity") + + case math.IsInf(*v.Threshold, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Threshold) + + } + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentGuardrailContextualGroundingFiltersConfig(v []types.GuardrailContextualGroundingFilterConfig, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentGuardrailContextualGroundingFilterConfig(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentGuardrailContextualGroundingPolicyConfig(v *types.GuardrailContextualGroundingPolicyConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FiltersConfig != nil { + ok := object.Key("filtersConfig") + if err := awsRestjson1_serializeDocumentGuardrailContextualGroundingFiltersConfig(v.FiltersConfig, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentGuardrailManagedWordListsConfig(v []types.GuardrailManagedWordsConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/bedrock/types/enums.go b/service/bedrock/types/enums.go index 9430803b30d..bb7e517c5f5 100644 --- a/service/bedrock/types/enums.go +++ b/service/bedrock/types/enums.go @@ -181,6 +181,26 @@ func (GuardrailContentFilterType) Values() []GuardrailContentFilterType { } } +type GuardrailContextualGroundingFilterType string + +// Enum values for GuardrailContextualGroundingFilterType +const ( + GuardrailContextualGroundingFilterTypeGrounding GuardrailContextualGroundingFilterType = "GROUNDING" + GuardrailContextualGroundingFilterTypeRelevance GuardrailContextualGroundingFilterType = "RELEVANCE" +) + +// Values returns all known values for GuardrailContextualGroundingFilterType. +// Note that this can be expanded in the future, and so it is only as up to date as +// the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (GuardrailContextualGroundingFilterType) Values() []GuardrailContextualGroundingFilterType { + return []GuardrailContextualGroundingFilterType{ + "GROUNDING", + "RELEVANCE", + } +} + type GuardrailFilterStrength string // Enum values for GuardrailFilterStrength diff --git a/service/bedrock/types/types.go b/service/bedrock/types/types.go index d78d6b1ffed..52cd0fc0d2e 100644 --- a/service/bedrock/types/types.go +++ b/service/bedrock/types/types.go @@ -476,15 +476,7 @@ type GuardrailContentFilter struct { // // For more information, see [Guardrails content filters]. // -// This data type is used in the following API operations: -// -// [CreateGuardrail request body] -// -// [UpdateGuardrail request body] -// -// [UpdateGuardrail request body]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_UpdateGuardrail.html#API_UpdateGuardrail_RequestSyntax // [Guardrails content filters]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-filters.html -// [CreateGuardrail request body]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateGuardrail.html#API_CreateGuardrail_RequestSyntax type GuardrailContentFilterConfig struct { // The strength of the content filter to apply to prompts. As you increase the @@ -526,15 +518,6 @@ type GuardrailContentPolicy struct { } // Contains details about how to handle harmful content. -// -// This data type is used in the following API operations: -// -// [CreateGuardrail request body] -// -// [UpdateGuardrail request body] -// -// [UpdateGuardrail request body]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_UpdateGuardrail.html#API_UpdateGuardrail_RequestSyntax -// [CreateGuardrail request body]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateGuardrail.html#API_CreateGuardrail_RequestSyntax type GuardrailContentPolicyConfig struct { // Contains the type of the content filter and how strongly it should apply to @@ -546,8 +529,62 @@ type GuardrailContentPolicyConfig struct { noSmithyDocumentSerde } +// The details for the guardrails contextual grounding filter. +type GuardrailContextualGroundingFilter struct { + + // The threshold details for the guardrails contextual grounding filter. + // + // This member is required. + Threshold *float64 + + // The filter type details for the guardrails contextual grounding filter. + // + // This member is required. + Type GuardrailContextualGroundingFilterType + + noSmithyDocumentSerde +} + +// The filter configuration details for the guardrails contextual grounding filter. +type GuardrailContextualGroundingFilterConfig struct { + + // The threshold details for the guardrails contextual grounding filter. + // + // This member is required. + Threshold *float64 + + // The filter details for the guardrails contextual grounding filter. + // + // This member is required. + Type GuardrailContextualGroundingFilterType + + noSmithyDocumentSerde +} + +// The details for the guardrails contextual grounding policy. +type GuardrailContextualGroundingPolicy struct { + + // The filter details for the guardrails contextual grounding policy. + // + // This member is required. + Filters []GuardrailContextualGroundingFilter + + noSmithyDocumentSerde +} + +// The policy configuration details for the guardrails contextual grounding policy. +type GuardrailContextualGroundingPolicyConfig struct { + + // The filter configuration details for the guardrails contextual grounding policy. + // + // This member is required. + FiltersConfig []GuardrailContextualGroundingFilterConfig + + noSmithyDocumentSerde +} + // The managed word list that was configured for the guardrail. (This is a list of -// words that are pre-defined and managed by Guardrails only.) +// words that are pre-defined and managed by guardrails only.) type GuardrailManagedWords struct { // ManagedWords$type The managed word type that was configured for the guardrail. @@ -596,6 +633,205 @@ type GuardrailPiiEntityConfig struct { // Configure guardrail type when the PII entity is detected. // + // The following PIIs are used to block or mask sensitive information: + // + // - General + // + // - ADDRESS + // + // A physical address, such as "100 Main Street, Anytown, USA" or "Suite #12, + // Building 123". An address can include information such as the street, building, + // location, city, state, country, county, zip code, precinct, and neighborhood. + // + // - AGE + // + // An individual's age, including the quantity and unit of time. For example, in + // the phrase "I am 40 years old," Guarrails recognizes "40 years" as an age. + // + // - NAME + // + // An individual's name. This entity type does not include titles, such as Dr., + // Mr., Mrs., or Miss. guardrails doesn't apply this entity type to names that are + // part of organizations or addresses. For example, guardrails recognizes the "John + // Doe Organization" as an organization, and it recognizes "Jane Doe Street" as an + // address. + // + // - EMAIL + // + // An email address, such as marymajor@email.com. + // + // - PHONE + // + // A phone number. This entity type also includes fax and pager numbers. + // + // - USERNAME + // + // A user name that identifies an account, such as a login name, screen name, nick + // name, or handle. + // + // - PASSWORD + // + // An alphanumeric string that is used as a password, such as + // "*very20special#pass*". + // + // - DRIVER_ID + // + // The number assigned to a driver's license, which is an official document + // permitting an individual to operate one or more motorized vehicles on a public + // road. A driver's license number consists of alphanumeric characters. + // + // - LICENSE_PLATE + // + // A license plate for a vehicle is issued by the state or country where the + // vehicle is registered. The format for passenger vehicles is typically five to + // eight digits, consisting of upper-case letters and numbers. The format varies + // depending on the location of the issuing state or country. + // + // - VEHICLE_IDENTIFICATION_NUMBER + // + // A Vehicle Identification Number (VIN) uniquely identifies a vehicle. VIN + // content and format are defined in the ISO 3779 specification. Each country has + // specific codes and formats for VINs. + // + // - Finance + // + // - REDIT_DEBIT_CARD_CVV + // + // A three-digit card verification code (CVV) that is present on VISA, MasterCard, + // and Discover credit and debit cards. For American Express credit or debit cards, + // the CVV is a four-digit numeric code. + // + // - CREDIT_DEBIT_CARD_EXPIRY + // + // The expiration date for a credit or debit card. This number is usually four + // digits long and is often formatted as month/year or MM/YY. Guardrails recognizes + // expiration dates such as 01/21, 01/2021, and Jan 2021. + // + // - CREDIT_DEBIT_CARD_NUMBER + // + // The number for a credit or debit card. These numbers can vary from 13 to 16 + // digits in length. However, Amazon Comprehend also recognizes credit or debit + // card numbers when only the last four digits are present. + // + // - PIN + // + // A four-digit personal identification number (PIN) with which you can access + // your bank account. + // + // - INTERNATIONAL_BANK_ACCOUNT_NUMBER + // + // An International Bank Account Number has specific formats in each country. For + // more information, see [www.iban.com/structure]. + // + // - SWIFT_CODE + // + // A SWIFT code is a standard format of Bank Identifier Code (BIC) used to specify + // a particular bank or branch. Banks use these codes for money transfers such as + // international wire transfers. + // + // SWIFT codes consist of eight or 11 characters. The 11-digit codes refer to + // specific branches, while eight-digit codes (or 11-digit codes ending in 'XXX') + // refer to the head or primary office. + // + // - IT + // + // - IP_ADDRESS + // + // An IPv4 address, such as 198.51.100.0. + // + // - MAC_ADDRESS + // + // A media access control (MAC) address is a unique identifier assigned to a + // network interface controller (NIC). + // + // - URL + // + // A web address, such as www.example.com. + // + // - AWS_ACCESS_KEY + // + // A unique identifier that's associated with a secret access key; you use the + // access key ID and secret access key to sign programmatic Amazon Web Services + // requests cryptographically. + // + // - AWS_SECRET_KEY + // + // A unique identifier that's associated with an access key. You use the access + // key ID and secret access key to sign programmatic Amazon Web Services requests + // cryptographically. + // + // - USA specific + // + // - US_BANK_ACCOUNT_NUMBER + // + // A US bank account number, which is typically 10 to 12 digits long. + // + // - US_BANK_ROUTING_NUMBER + // + // A US bank account routing number. These are typically nine digits long, + // + // - US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER + // + // A US Individual Taxpayer Identification Number (ITIN) is a nine-digit number + // that starts with a "9" and contain a "7" or "8" as the fourth digit. An ITIN can + // be formatted with a space or a dash after the third and forth digits. + // + // - US_PASSPORT_NUMBER + // + // A US passport number. Passport numbers range from six to nine alphanumeric + // characters. + // + // - US_SOCIAL_SECURITY_NUMBER + // + // A US Social Security Number (SSN) is a nine-digit number that is issued to US + // citizens, permanent residents, and temporary working residents. + // + // - Canada specific + // + // - CA_HEALTH_NUMBER + // + // A Canadian Health Service Number is a 10-digit unique identifier, required for + // individuals to access healthcare benefits. + // + // - CA_SOCIAL_INSURANCE_NUMBER + // + // A Canadian Social Insurance Number (SIN) is a nine-digit unique identifier, + // required for individuals to access government programs and benefits. + // + // The SIN is formatted as three groups of three digits, such as 123-456-789. A + // SIN can be validated through a simple check-digit process called the [Luhn algorithm]. + // + // - UK Specific + // + // - UK_NATIONAL_HEALTH_SERVICE_NUMBER + // + // A UK National Health Service Number is a 10-17 digit number, such as 485 777 + // 3456. The current system formats the 10-digit number with spaces after the third + // and sixth digits. The final digit is an error-detecting checksum. + // + // - UK_NATIONAL_INSURANCE_NUMBER + // + // A UK National Insurance Number (NINO) provides individuals with access to + // National Insurance (social security) benefits. It is also used for some purposes + // in the UK tax system. + // + // The number is nine digits long and starts with two letters, followed by six + // numbers and one letter. A NINO can be formatted with a space or a dash after the + // two letters and after the second, forth, and sixth digits. + // + // - UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER + // + // A UK Unique Taxpayer Reference (UTR) is a 10-digit number that identifies a + // taxpayer or a business. + // + // - Custom + // + // - Regex filter - You can use a regular expressions to define patterns for a + // guardrail to recognize and act upon such as serial number, booking ID etc.. + // + // [Luhn algorithm]: https://www.wikipedia.org/wiki/Luhn_algorithm + // [www.iban.com/structure]: https://www.iban.com/structure + // // This member is required. Type GuardrailPiiEntityType @@ -756,15 +992,6 @@ type GuardrailTopic struct { } // Details about topics for the guardrail to identify and deny. -// -// This data type is used in the following API operations: -// -// [CreateGuardrail request body] -// -// [UpdateGuardrail request body] -// -// [UpdateGuardrail request body]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_UpdateGuardrail.html#API_UpdateGuardrail_RequestSyntax -// [CreateGuardrail request body]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateGuardrail.html#API_CreateGuardrail_RequestSyntax type GuardrailTopicConfig struct { // A definition of the topic to deny. @@ -807,15 +1034,6 @@ type GuardrailTopicPolicy struct { } // Contains details about topics that the guardrail should identify and deny. -// -// This data type is used in the following API operations: -// -// [CreateGuardrail request body] -// -// [UpdateGuardrail request body] -// -// [UpdateGuardrail request body]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_UpdateGuardrail.html#API_UpdateGuardrail_RequestSyntax -// [CreateGuardrail request body]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateGuardrail.html#API_CreateGuardrail_RequestSyntax type GuardrailTopicPolicyConfig struct { // A list of policies related to topics that the guardrail should deny. diff --git a/service/bedrock/validators.go b/service/bedrock/validators.go index c6b293be483..522ab18e947 100644 --- a/service/bedrock/validators.go +++ b/service/bedrock/validators.go @@ -806,6 +806,60 @@ func validateGuardrailContentPolicyConfig(v *types.GuardrailContentPolicyConfig) } } +func validateGuardrailContextualGroundingFilterConfig(v *types.GuardrailContextualGroundingFilterConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GuardrailContextualGroundingFilterConfig"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Threshold == nil { + invalidParams.Add(smithy.NewErrParamRequired("Threshold")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateGuardrailContextualGroundingFiltersConfig(v []types.GuardrailContextualGroundingFilterConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GuardrailContextualGroundingFiltersConfig"} + for i := range v { + if err := validateGuardrailContextualGroundingFilterConfig(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateGuardrailContextualGroundingPolicyConfig(v *types.GuardrailContextualGroundingPolicyConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GuardrailContextualGroundingPolicyConfig"} + if v.FiltersConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("FiltersConfig")) + } else if v.FiltersConfig != nil { + if err := validateGuardrailContextualGroundingFiltersConfig(v.FiltersConfig); err != nil { + invalidParams.AddNested("FiltersConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateGuardrailManagedWordListsConfig(v []types.GuardrailManagedWordsConfig) error { if v == nil { return nil @@ -1366,6 +1420,11 @@ func validateOpCreateGuardrailInput(v *CreateGuardrailInput) error { invalidParams.AddNested("SensitiveInformationPolicyConfig", err.(smithy.InvalidParamsError)) } } + if v.ContextualGroundingPolicyConfig != nil { + if err := validateGuardrailContextualGroundingPolicyConfig(v.ContextualGroundingPolicyConfig); err != nil { + invalidParams.AddNested("ContextualGroundingPolicyConfig", err.(smithy.InvalidParamsError)) + } + } if v.BlockedInputMessaging == nil { invalidParams.Add(smithy.NewErrParamRequired("BlockedInputMessaging")) } @@ -1756,6 +1815,11 @@ func validateOpUpdateGuardrailInput(v *UpdateGuardrailInput) error { invalidParams.AddNested("SensitiveInformationPolicyConfig", err.(smithy.InvalidParamsError)) } } + if v.ContextualGroundingPolicyConfig != nil { + if err := validateGuardrailContextualGroundingPolicyConfig(v.ContextualGroundingPolicyConfig); err != nil { + invalidParams.AddNested("ContextualGroundingPolicyConfig", err.(smithy.InvalidParamsError)) + } + } if v.BlockedInputMessaging == nil { invalidParams.Add(smithy.NewErrParamRequired("BlockedInputMessaging")) } diff --git a/service/bedrockagent/api_op_CreateAgent.go b/service/bedrockagent/api_op_CreateAgent.go index 1221d229891..a6c0a3430ec 100644 --- a/service/bedrockagent/api_op_CreateAgent.go +++ b/service/bedrockagent/api_op_CreateAgent.go @@ -27,6 +27,9 @@ import ( // the agent should maintain session information. After this time expires, the // subsequent InvokeAgent request begins a new session. // +// - To enable your agent to retain conversational context across multiple +// sessions, include a memoryConfiguration object. For more information, see [Configure memory]. +// // - To override the default prompt behavior for agent orchestration and to use // advanced prompts, include a promptOverrideConfiguration object. For more // information, see [Advanced prompts]. @@ -35,6 +38,7 @@ import ( // failureReasons alongside a list of recommendedActions for you to troubleshoot. // // [Advanced prompts]: https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html +// [Configure memory]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-configure-memory.html func (c *Client) CreateAgent(ctx context.Context, params *CreateAgentInput, optFns ...func(*Options)) (*CreateAgentOutput, error) { if params == nil { params = &CreateAgentInput{} @@ -92,6 +96,9 @@ type CreateAgentInput struct { // with users. Instruction *string + // Contains the details of the memory configured for the agent. + MemoryConfiguration *types.MemoryConfiguration + // Contains configurations to override prompts in different parts of an agent // sequence. For more information, see [Advanced prompts]. // diff --git a/service/bedrockagent/api_op_CreateAgentActionGroup.go b/service/bedrockagent/api_op_CreateAgentActionGroup.go index 43f8174a94d..494d52b7e98 100644 --- a/service/bedrockagent/api_op_CreateAgentActionGroup.go +++ b/service/bedrockagent/api_op_CreateAgentActionGroup.go @@ -17,11 +17,17 @@ import ( // // To allow your agent to request the user for additional information when trying // to complete a task, add an action group with the parentActionGroupSignature -// field set to AMAZON.UserInput . You must leave the description , apiSchema , and -// actionGroupExecutor fields blank for this action group. During orchestration, if -// your agent determines that it needs to invoke an API in an action group, but -// doesn't have enough information to complete the API request, it will invoke this -// action group instead and return an [Observation]reprompting the user for more information. +// field set to AMAZON.UserInput . +// +// To allow your agent to generate, run, and troubleshoot code when trying to +// complete a task, add an action group with the parentActionGroupSignature field +// set to AMAZON.CodeInterpreter . +// +// You must leave the description , apiSchema , and actionGroupExecutor fields +// blank for this action group. During orchestration, if your agent determines that +// it needs to invoke an API in an action group, but doesn't have enough +// information to complete the API request, it will invoke this action group +// instead and return an [Observation]reprompting the user for more information. // // [Observation]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html func (c *Client) CreateAgentActionGroup(ctx context.Context, params *CreateAgentActionGroupInput, optFns ...func(*Options)) (*CreateAgentActionGroupOutput, error) { @@ -93,6 +99,11 @@ type CreateAgentActionGroupInput struct { // description , apiSchema , and actionGroupExecutor fields blank for this action // group. // + // To allow your agent to generate, run, and troubleshoot code when trying to + // complete a task, set this field to AMAZON.CodeInterpreter . You must leave the + // description , apiSchema , and actionGroupExecutor fields blank for this action + // group. + // // During orchestration, if your agent determines that it needs to invoke an API // in an action group, but doesn't have enough information to complete the API // request, it will invoke this action group instead and return an [Observation]reprompting the diff --git a/service/bedrockagent/api_op_CreateDataSource.go b/service/bedrockagent/api_op_CreateDataSource.go index ccf25ecc33f..2ce36f52127 100644 --- a/service/bedrockagent/api_op_CreateDataSource.go +++ b/service/bedrockagent/api_op_CreateDataSource.go @@ -11,9 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Sets up a data source to be added to a knowledge base. +// Creates a data source connector for a knowledge base. // -// You can't change the chunkingConfiguration after you create the data source. +// You can't change the chunkingConfiguration after you create the data source +// connector. func (c *Client) CreateDataSource(ctx context.Context, params *CreateDataSourceInput, optFns ...func(*Options)) (*CreateDataSourceOutput, error) { if params == nil { params = &CreateDataSourceInput{} @@ -31,7 +32,7 @@ func (c *Client) CreateDataSource(ctx context.Context, params *CreateDataSourceI type CreateDataSourceInput struct { - // Contains metadata about where the data source is stored. + // The connection configuration for the data source. // // This member is required. DataSourceConfiguration *types.DataSourceConfiguration @@ -53,7 +54,17 @@ type CreateDataSourceInput struct { // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html ClientToken *string - // The data deletion policy assigned to the data source. + // The data deletion policy for the data source. + // + // You can set the data deletion policy to: + // + // - DELETE: Deletes all underlying data belonging to the data source from the + // vector store upon deletion of a knowledge base or data source resource. Note + // that the vector store itself is not deleted, only the underlying data. This flag + // is ignored if an Amazon Web Services account is deleted. + // + // - RETAIN: Retains all underlying data in your vector store upon deletion of a + // knowledge base or data source resource. DataDeletionPolicy types.DataDeletionPolicy // A description of the data source. diff --git a/service/bedrockagent/api_op_CreateFlow.go b/service/bedrockagent/api_op_CreateFlow.go new file mode 100644 index 00000000000..955e32fa12a --- /dev/null +++ b/service/bedrockagent/api_op_CreateFlow.go @@ -0,0 +1,265 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a prompt flow that you can use to send an input through various steps +// to yield an output. Configure nodes, each of which corresponds to a step of the +// flow, and create connections between the nodes to create paths to different +// outputs. For more information, see [How it works]and [Create a flow in Amazon Bedrock] in the Amazon Bedrock User Guide. +// +// [How it works]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html +// [Create a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-create.html +func (c *Client) CreateFlow(ctx context.Context, params *CreateFlowInput, optFns ...func(*Options)) (*CreateFlowOutput, error) { + if params == nil { + params = &CreateFlowInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateFlow", params, optFns, c.addOperationCreateFlowMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateFlowOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateFlowInput struct { + + // The Amazon Resource Name (ARN) of the service role with permissions to create + // and manage a flow. For more information, see [Create a service role for flows in Amazon Bedrock]in the Amazon Bedrock User Guide. + // + // [Create a service role for flows in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html + // + // This member is required. + ExecutionRoleArn *string + + // A name for the flow. + // + // This member is required. + Name *string + + // A unique, case-sensitive identifier to ensure that the API request completes no + // more than one time. If this token matches a previous request, Amazon Bedrock + // ignores the request, but does not return an error. For more information, see [Ensuring idempotency]. + // + // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html + ClientToken *string + + // The Amazon Resource Name (ARN) of the KMS key to encrypt the flow. + CustomerEncryptionKeyArn *string + + // A definition of the nodes and connections between nodes in the flow. + Definition *types.FlowDefinition + + // A description for the flow. + Description *string + + // Any tags that you want to attach to the flow. For more information, see [Tagging resources in Amazon Bedrock]. + // + // [Tagging resources in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateFlowOutput struct { + + // The Amazon Resource Name (ARN) of the flow. + // + // This member is required. + Arn *string + + // The time at which the flow was created. + // + // This member is required. + CreatedAt *time.Time + + // The Amazon Resource Name (ARN) of the service role with permissions to create a + // flow. For more information, see [Create a service role for flows in Amazon Bedrock]in the Amazon Bedrock User Guide. + // + // [Create a service role for flows in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html + // + // This member is required. + ExecutionRoleArn *string + + // The unique identifier of the flow. + // + // This member is required. + Id *string + + // The name of the flow. + // + // This member is required. + Name *string + + // The status of the flow. When you submit this request, the status will be + // NotPrepared . If creation fails, the status becomes Failed . + // + // This member is required. + Status types.FlowStatus + + // The time at which the flow was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The version of the flow. When you create a flow, the version created is the + // DRAFT version. + // + // This member is required. + Version *string + + // The Amazon Resource Name (ARN) of the KMS key that you encrypted the flow with. + CustomerEncryptionKeyArn *string + + // A definition of the nodes and connections between nodes in the flow. + Definition *types.FlowDefinition + + // The description of the flow. + Description *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateFlowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateFlow{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateFlow{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateFlow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateFlowMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateFlowValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFlow(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateFlow struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateFlow) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateFlow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateFlowInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateFlowInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateFlowMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateFlow{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateFlow(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateFlow", + } +} diff --git a/service/bedrockagent/api_op_CreateFlowAlias.go b/service/bedrockagent/api_op_CreateFlowAlias.go new file mode 100644 index 00000000000..c5143fce71f --- /dev/null +++ b/service/bedrockagent/api_op_CreateFlowAlias.go @@ -0,0 +1,243 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates an alias of a flow for deployment. For more information, see [Deploy a flow in Amazon Bedrock] in the +// Amazon Bedrock User Guide. +// +// [Deploy a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html +func (c *Client) CreateFlowAlias(ctx context.Context, params *CreateFlowAliasInput, optFns ...func(*Options)) (*CreateFlowAliasOutput, error) { + if params == nil { + params = &CreateFlowAliasInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateFlowAlias", params, optFns, c.addOperationCreateFlowAliasMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateFlowAliasOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateFlowAliasInput struct { + + // The unique identifier of the flow for which to create an alias. + // + // This member is required. + FlowIdentifier *string + + // A name for the alias. + // + // This member is required. + Name *string + + // Contains information about the version to which to map the alias. + // + // This member is required. + RoutingConfiguration []types.FlowAliasRoutingConfigurationListItem + + // A unique, case-sensitive identifier to ensure that the API request completes no + // more than one time. If this token matches a previous request, Amazon Bedrock + // ignores the request, but does not return an error. For more information, see [Ensuring idempotency]. + // + // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html + ClientToken *string + + // A description for the alias. + Description *string + + // Any tags that you want to attach to the alias of the flow. For more + // information, see [Tagging resources in Amazon Bedrock]. + // + // [Tagging resources in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateFlowAliasOutput struct { + + // The Amazon Resource Name (ARN) of the alias. + // + // This member is required. + Arn *string + + // The time at which the alias was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique identifier of the flow that the alias belongs to. + // + // This member is required. + FlowId *string + + // The unique identifier of the alias. + // + // This member is required. + Id *string + + // The name of the alias. + // + // This member is required. + Name *string + + // Contains information about the version that the alias is mapped to. + // + // This member is required. + RoutingConfiguration []types.FlowAliasRoutingConfigurationListItem + + // The time at which the alias of the flow was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The description of the alias. + Description *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateFlowAliasMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateFlowAlias{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateFlowAlias{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateFlowAlias"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateFlowAliasMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateFlowAliasValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFlowAlias(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateFlowAlias struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateFlowAlias) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateFlowAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateFlowAliasInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateFlowAliasInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateFlowAliasMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateFlowAlias{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateFlowAlias(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateFlowAlias", + } +} diff --git a/service/bedrockagent/api_op_CreateFlowVersion.go b/service/bedrockagent/api_op_CreateFlowVersion.go new file mode 100644 index 00000000000..7467d66687e --- /dev/null +++ b/service/bedrockagent/api_op_CreateFlowVersion.go @@ -0,0 +1,237 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a version of the flow that you can deploy. For more information, see [Deploy a flow in Amazon Bedrock] +// in the Amazon Bedrock User Guide. +// +// [Deploy a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html +func (c *Client) CreateFlowVersion(ctx context.Context, params *CreateFlowVersionInput, optFns ...func(*Options)) (*CreateFlowVersionOutput, error) { + if params == nil { + params = &CreateFlowVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateFlowVersion", params, optFns, c.addOperationCreateFlowVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateFlowVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateFlowVersionInput struct { + + // The unique identifier of the flow that you want to create a version of. + // + // This member is required. + FlowIdentifier *string + + // A unique, case-sensitive identifier to ensure that the API request completes no + // more than one time. If this token matches a previous request, Amazon Bedrock + // ignores the request, but does not return an error. For more information, see [Ensuring idempotency]. + // + // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html + ClientToken *string + + // A description of the version of the flow. + Description *string + + noSmithyDocumentSerde +} + +type CreateFlowVersionOutput struct { + + // The Amazon Resource Name (ARN) of the flow. + // + // This member is required. + Arn *string + + // The time at which the flow was created. + // + // This member is required. + CreatedAt *time.Time + + // The Amazon Resource Name (ARN) of the service role with permissions to create a + // flow. For more information, see [Create a service role for flows in Amazon Bedrock]in the Amazon Bedrock User Guide. + // + // [Create a service role for flows in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html + // + // This member is required. + ExecutionRoleArn *string + + // The unique identifier of the flow. + // + // This member is required. + Id *string + + // The name of the flow version. + // + // This member is required. + Name *string + + // The status of the flow. + // + // This member is required. + Status types.FlowStatus + + // The version of the flow that was created. Versions are numbered incrementally, + // starting from 1. + // + // This member is required. + Version *string + + // The KMS key that the flow is encrypted with. + CustomerEncryptionKeyArn *string + + // A definition of the nodes and connections in the flow. + Definition *types.FlowDefinition + + // The description of the flow version. + Description *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateFlowVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateFlowVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateFlowVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateFlowVersion"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateFlowVersionMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateFlowVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFlowVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateFlowVersion struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateFlowVersion) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateFlowVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateFlowVersionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateFlowVersionInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateFlowVersionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateFlowVersion{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateFlowVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateFlowVersion", + } +} diff --git a/service/bedrockagent/api_op_CreatePrompt.go b/service/bedrockagent/api_op_CreatePrompt.go new file mode 100644 index 00000000000..927be928f91 --- /dev/null +++ b/service/bedrockagent/api_op_CreatePrompt.go @@ -0,0 +1,252 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a prompt in your prompt library that you can add to a flow. For more +// information, see [Prompt management in Amazon Bedrock], [Create a prompt using Prompt management] and [Prompt flows in Amazon Bedrock] in the Amazon Bedrock User Guide. +// +// [Prompt flows in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows.html +// [Prompt management in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html +// [Create a prompt using Prompt management]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html +func (c *Client) CreatePrompt(ctx context.Context, params *CreatePromptInput, optFns ...func(*Options)) (*CreatePromptOutput, error) { + if params == nil { + params = &CreatePromptInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreatePrompt", params, optFns, c.addOperationCreatePromptMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreatePromptOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreatePromptInput struct { + + // A name for the prompt. + // + // This member is required. + Name *string + + // A unique, case-sensitive identifier to ensure that the API request completes no + // more than one time. If this token matches a previous request, Amazon Bedrock + // ignores the request, but does not return an error. For more information, see [Ensuring idempotency]. + // + // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html + ClientToken *string + + // The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt. + CustomerEncryptionKeyArn *string + + // The name of the default variant for the prompt. This value must match the name + // field in the relevant [PromptVariant]object. + // + // [PromptVariant]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html + DefaultVariant *string + + // A description for the prompt. + Description *string + + // Any tags that you want to attach to the prompt. For more information, see [Tagging resources in Amazon Bedrock]. + // + // [Tagging resources in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html + Tags map[string]string + + // A list of objects, each containing details about a variant of the prompt. + Variants []types.PromptVariant + + noSmithyDocumentSerde +} + +type CreatePromptOutput struct { + + // The Amazon Resource Name (ARN) of the prompt. + // + // This member is required. + Arn *string + + // The time at which the prompt was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique identifier of the prompt. + // + // This member is required. + Id *string + + // The name of the prompt. + // + // This member is required. + Name *string + + // The time at which the prompt was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The version of the prompt. When you create a prompt, the version created is the + // DRAFT version. + // + // This member is required. + Version *string + + // The Amazon Resource Name (ARN) of the KMS key that you encrypted the prompt + // with. + CustomerEncryptionKeyArn *string + + // The name of the default variant for your prompt. + DefaultVariant *string + + // The description of the prompt. + Description *string + + // A list of objects, each containing details about a variant of the prompt. + Variants []types.PromptVariant + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreatePromptMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreatePrompt{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreatePrompt{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreatePrompt"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreatePromptMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreatePromptValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePrompt(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreatePrompt struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreatePrompt) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreatePrompt) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreatePromptInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePromptInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreatePromptMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePrompt{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreatePrompt(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreatePrompt", + } +} diff --git a/service/bedrockagent/api_op_CreatePromptVersion.go b/service/bedrockagent/api_op_CreatePromptVersion.go new file mode 100644 index 00000000000..faa2bdd0289 --- /dev/null +++ b/service/bedrockagent/api_op_CreatePromptVersion.go @@ -0,0 +1,242 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a static snapshot of your prompt that can be deployed to production. +// For more information, see [Deploy prompts using Prompt management by creating versions]in the Amazon Bedrock User Guide. +// +// [Deploy prompts using Prompt management by creating versions]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html +func (c *Client) CreatePromptVersion(ctx context.Context, params *CreatePromptVersionInput, optFns ...func(*Options)) (*CreatePromptVersionOutput, error) { + if params == nil { + params = &CreatePromptVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreatePromptVersion", params, optFns, c.addOperationCreatePromptVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreatePromptVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreatePromptVersionInput struct { + + // The unique identifier of the prompt that you want to create a version of. + // + // This member is required. + PromptIdentifier *string + + // A unique, case-sensitive identifier to ensure that the API request completes no + // more than one time. If this token matches a previous request, Amazon Bedrock + // ignores the request, but does not return an error. For more information, see [Ensuring idempotency]. + // + // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html + ClientToken *string + + // A description for the version of the prompt. + Description *string + + // Any tags that you want to attach to the version of the prompt. For more + // information, see [Tagging resources in Amazon Bedrock]. + // + // [Tagging resources in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreatePromptVersionOutput struct { + + // The Amazon Resource Name (ARN) of the version of the prompt. + // + // This member is required. + Arn *string + + // The time at which the prompt was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique identifier of the prompt. + // + // This member is required. + Id *string + + // The name of the prompt version. + // + // This member is required. + Name *string + + // The time at which the prompt was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The version of the prompt that was created. Versions are numbered + // incrementally, starting from 1. + // + // This member is required. + Version *string + + // The Amazon Resource Name (ARN) of the KMS key to encrypt the version of the + // prompt. + CustomerEncryptionKeyArn *string + + // The name of the default variant for the prompt. This value must match the name + // field in the relevant [PromptVariant]object. + // + // [PromptVariant]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html + DefaultVariant *string + + // A description for the prompt version. + Description *string + + // A list of objects, each containing details about a variant of the prompt. + Variants []types.PromptVariant + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreatePromptVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreatePromptVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreatePromptVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreatePromptVersion"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreatePromptVersionMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreatePromptVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePromptVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreatePromptVersion struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreatePromptVersion) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreatePromptVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreatePromptVersionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePromptVersionInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreatePromptVersionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePromptVersion{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreatePromptVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreatePromptVersion", + } +} diff --git a/service/bedrockagent/api_op_DeleteFlow.go b/service/bedrockagent/api_op_DeleteFlow.go new file mode 100644 index 00000000000..a9072afec22 --- /dev/null +++ b/service/bedrockagent/api_op_DeleteFlow.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a flow. +func (c *Client) DeleteFlow(ctx context.Context, params *DeleteFlowInput, optFns ...func(*Options)) (*DeleteFlowOutput, error) { + if params == nil { + params = &DeleteFlowInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteFlow", params, optFns, c.addOperationDeleteFlowMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteFlowOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteFlowInput struct { + + // The unique identifier of the flow. + // + // This member is required. + FlowIdentifier *string + + // By default, this value is false and deletion is stopped if the resource is in + // use. If you set it to true , the resource will be deleted even if the resource + // is in use. + SkipResourceInUseCheck bool + + noSmithyDocumentSerde +} + +type DeleteFlowOutput struct { + + // The unique identifier of the flow. + // + // This member is required. + Id *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteFlowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteFlow{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteFlow{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteFlow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteFlowValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFlow(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteFlow(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteFlow", + } +} diff --git a/service/bedrockagent/api_op_DeleteFlowAlias.go b/service/bedrockagent/api_op_DeleteFlowAlias.go new file mode 100644 index 00000000000..c80d5527442 --- /dev/null +++ b/service/bedrockagent/api_op_DeleteFlowAlias.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an alias of a flow. +func (c *Client) DeleteFlowAlias(ctx context.Context, params *DeleteFlowAliasInput, optFns ...func(*Options)) (*DeleteFlowAliasOutput, error) { + if params == nil { + params = &DeleteFlowAliasInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteFlowAlias", params, optFns, c.addOperationDeleteFlowAliasMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteFlowAliasOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteFlowAliasInput struct { + + // The unique identifier of the alias to be deleted. + // + // This member is required. + AliasIdentifier *string + + // The unique identifier of the flow that the alias belongs to. + // + // This member is required. + FlowIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteFlowAliasOutput struct { + + // The unique identifier of the flow that the alias belongs to. + // + // This member is required. + FlowId *string + + // The unique identifier of the flow. + // + // This member is required. + Id *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteFlowAliasMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteFlowAlias{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteFlowAlias{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteFlowAlias"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteFlowAliasValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFlowAlias(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteFlowAlias(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteFlowAlias", + } +} diff --git a/service/bedrockagent/api_op_DeleteFlowVersion.go b/service/bedrockagent/api_op_DeleteFlowVersion.go new file mode 100644 index 00000000000..4a70887fd99 --- /dev/null +++ b/service/bedrockagent/api_op_DeleteFlowVersion.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a version of a flow. +func (c *Client) DeleteFlowVersion(ctx context.Context, params *DeleteFlowVersionInput, optFns ...func(*Options)) (*DeleteFlowVersionOutput, error) { + if params == nil { + params = &DeleteFlowVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteFlowVersion", params, optFns, c.addOperationDeleteFlowVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteFlowVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteFlowVersionInput struct { + + // The unique identifier of the flow whose version that you want to delete + // + // This member is required. + FlowIdentifier *string + + // The version of the flow that you want to delete. + // + // This member is required. + FlowVersion *string + + // By default, this value is false and deletion is stopped if the resource is in + // use. If you set it to true , the resource will be deleted even if the resource + // is in use. + SkipResourceInUseCheck bool + + noSmithyDocumentSerde +} + +type DeleteFlowVersionOutput struct { + + // The unique identifier of the flow. + // + // This member is required. + Id *string + + // The version of the flow being deleted. + // + // This member is required. + Version *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteFlowVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteFlowVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteFlowVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteFlowVersion"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteFlowVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFlowVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteFlowVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteFlowVersion", + } +} diff --git a/service/bedrockagent/api_op_DeletePrompt.go b/service/bedrockagent/api_op_DeletePrompt.go new file mode 100644 index 00000000000..e4f7312e05b --- /dev/null +++ b/service/bedrockagent/api_op_DeletePrompt.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a prompt or a prompt version from the Prompt management tool. For more +// information, see [Delete prompts from the Prompt management tool]and [Delete a version of a prompt from the Prompt management tool] in the Amazon Bedrock User Guide. +// +// [Delete a version of a prompt from the Prompt management tool]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html#prompt-management-versions-delete.html +// [Delete prompts from the Prompt management tool]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-delete.html +func (c *Client) DeletePrompt(ctx context.Context, params *DeletePromptInput, optFns ...func(*Options)) (*DeletePromptOutput, error) { + if params == nil { + params = &DeletePromptInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeletePrompt", params, optFns, c.addOperationDeletePromptMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeletePromptOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeletePromptInput struct { + + // The unique identifier of the prompt. + // + // This member is required. + PromptIdentifier *string + + // The version of the prompt to delete. + PromptVersion *string + + noSmithyDocumentSerde +} + +type DeletePromptOutput struct { + + // The unique identifier of the prompt that was deleted. + // + // This member is required. + Id *string + + // The version of the prompt that was deleted. + Version *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeletePromptMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePrompt{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePrompt{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePrompt"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeletePromptValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePrompt(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeletePrompt(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeletePrompt", + } +} diff --git a/service/bedrockagent/api_op_GetFlow.go b/service/bedrockagent/api_op_GetFlow.go new file mode 100644 index 00000000000..e8edfe1536a --- /dev/null +++ b/service/bedrockagent/api_op_GetFlow.go @@ -0,0 +1,216 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about a flow. For more information, see [Manage a flow in Amazon Bedrock] in the Amazon +// Bedrock User Guide. +// +// [Manage a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-manage.html +func (c *Client) GetFlow(ctx context.Context, params *GetFlowInput, optFns ...func(*Options)) (*GetFlowOutput, error) { + if params == nil { + params = &GetFlowInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetFlow", params, optFns, c.addOperationGetFlowMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetFlowOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetFlowInput struct { + + // The unique identifier of the flow. + // + // This member is required. + FlowIdentifier *string + + noSmithyDocumentSerde +} + +type GetFlowOutput struct { + + // The Amazon Resource Name (ARN) of the flow. + // + // This member is required. + Arn *string + + // The time at which the flow was created. + // + // This member is required. + CreatedAt *time.Time + + // The Amazon Resource Name (ARN) of the service role with permissions to create a + // flow. For more information, see [Create a service row for flows]in the Amazon Bedrock User Guide. + // + // [Create a service row for flows]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html + // + // This member is required. + ExecutionRoleArn *string + + // The unique identifier of the flow. + // + // This member is required. + Id *string + + // The name of the flow. + // + // This member is required. + Name *string + + // The status of the flow. The following statuses are possible: + // + // - NotPrepared – The flow has been created or updated, but hasn't been + // prepared. If you just created the flow, you can't test it. If you updated the + // flow, the DRAFT version won't contain the latest changes for testing. Send a [PrepareFlow] + // request to package the latest changes into the DRAFT version. + // + // - Preparing – The flow is being prepared so that the DRAFT version contains + // the latest changes for testing. + // + // - Prepared – The flow is prepared and the DRAFT version contains the latest + // changes for testing. + // + // - Failed – The last API operation that you invoked on the flow failed. Send a [GetFlow] + // request and check the error message in the validations field. + // + // [PrepareFlow]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PrepareFlow.html + // [GetFlow]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlow.html + // + // This member is required. + Status types.FlowStatus + + // The time at which the flow was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The version of the flow for which information was retrieved. + // + // This member is required. + Version *string + + // The Amazon Resource Name (ARN) of the KMS key that the flow is encrypted with. + CustomerEncryptionKeyArn *string + + // The definition of the nodes and connections between the nodes in the flow. + Definition *types.FlowDefinition + + // The description of the flow. + Description *string + + // A list of validation error messages related to the last failed operation on the + // flow. + Validations []types.FlowValidation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetFlowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetFlow{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetFlow{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetFlow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetFlowValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFlow(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetFlow(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetFlow", + } +} diff --git a/service/bedrockagent/api_op_GetFlowAlias.go b/service/bedrockagent/api_op_GetFlowAlias.go new file mode 100644 index 00000000000..5ffdf8f7e1c --- /dev/null +++ b/service/bedrockagent/api_op_GetFlowAlias.go @@ -0,0 +1,186 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about a flow. For more information, see [Deploy a flow in Amazon Bedrock] in the Amazon +// Bedrock User Guide. +// +// [Deploy a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html +func (c *Client) GetFlowAlias(ctx context.Context, params *GetFlowAliasInput, optFns ...func(*Options)) (*GetFlowAliasOutput, error) { + if params == nil { + params = &GetFlowAliasInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetFlowAlias", params, optFns, c.addOperationGetFlowAliasMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetFlowAliasOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetFlowAliasInput struct { + + // The unique identifier of the alias for which to retrieve information. + // + // This member is required. + AliasIdentifier *string + + // The unique identifier of the flow that the alias belongs to. + // + // This member is required. + FlowIdentifier *string + + noSmithyDocumentSerde +} + +type GetFlowAliasOutput struct { + + // The Amazon Resource Name (ARN) of the flow. + // + // This member is required. + Arn *string + + // The time at which the flow was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique identifier of the flow that the alias belongs to. + // + // This member is required. + FlowId *string + + // The unique identifier of the alias of the flow. + // + // This member is required. + Id *string + + // The name of the flow alias. + // + // This member is required. + Name *string + + // Contains information about the version that the alias is mapped to. + // + // This member is required. + RoutingConfiguration []types.FlowAliasRoutingConfigurationListItem + + // The time at which the flow alias was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The description of the flow. + Description *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetFlowAliasMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetFlowAlias{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetFlowAlias{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetFlowAlias"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetFlowAliasValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFlowAlias(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetFlowAlias(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetFlowAlias", + } +} diff --git a/service/bedrockagent/api_op_GetFlowVersion.go b/service/bedrockagent/api_op_GetFlowVersion.go new file mode 100644 index 00000000000..51c53516df2 --- /dev/null +++ b/service/bedrockagent/api_op_GetFlowVersion.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about a version of a flow. For more information, see [Deploy a flow in Amazon Bedrock] in +// the Amazon Bedrock User Guide. +// +// [Deploy a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html +func (c *Client) GetFlowVersion(ctx context.Context, params *GetFlowVersionInput, optFns ...func(*Options)) (*GetFlowVersionOutput, error) { + if params == nil { + params = &GetFlowVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetFlowVersion", params, optFns, c.addOperationGetFlowVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetFlowVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetFlowVersionInput struct { + + // The unique identifier of the flow for which to get information. + // + // This member is required. + FlowIdentifier *string + + // The version of the flow for which to get information. + // + // This member is required. + FlowVersion *string + + noSmithyDocumentSerde +} + +type GetFlowVersionOutput struct { + + // The Amazon Resource Name (ARN) of the flow. + // + // This member is required. + Arn *string + + // The time at which the flow was created. + // + // This member is required. + CreatedAt *time.Time + + // The Amazon Resource Name (ARN) of the service role with permissions to create a + // flow. For more information, see [Create a service role for flows in Amazon Bedrock]in the Amazon Bedrock User Guide. + // + // [Create a service role for flows in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html + // + // This member is required. + ExecutionRoleArn *string + + // The unique identifier of the flow. + // + // This member is required. + Id *string + + // The name of the flow version. + // + // This member is required. + Name *string + + // The status of the flow. + // + // This member is required. + Status types.FlowStatus + + // The version of the flow for which information was retrieved. + // + // This member is required. + Version *string + + // The Amazon Resource Name (ARN) of the KMS key that the version of the flow is + // encrypted with. + CustomerEncryptionKeyArn *string + + // The definition of the nodes and connections between nodes in the flow. + Definition *types.FlowDefinition + + // The description of the flow. + Description *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetFlowVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetFlowVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetFlowVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetFlowVersion"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetFlowVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFlowVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetFlowVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetFlowVersion", + } +} diff --git a/service/bedrockagent/api_op_GetPrompt.go b/service/bedrockagent/api_op_GetPrompt.go new file mode 100644 index 00000000000..69a0d692760 --- /dev/null +++ b/service/bedrockagent/api_op_GetPrompt.go @@ -0,0 +1,192 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about a prompt or a version of it. For more information, +// see [View information about prompts using Prompt management]and [View information about a version of your prompt] in the Amazon Bedrock User Guide. +// +// [View information about a version of your prompt]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html#prompt-management-versions-view.html +// [View information about prompts using Prompt management]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-view.html +func (c *Client) GetPrompt(ctx context.Context, params *GetPromptInput, optFns ...func(*Options)) (*GetPromptOutput, error) { + if params == nil { + params = &GetPromptInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPrompt", params, optFns, c.addOperationGetPromptMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPromptOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPromptInput struct { + + // The unique identifier of the prompt. + // + // This member is required. + PromptIdentifier *string + + // The version of the prompt about which you want to retrieve information. + PromptVersion *string + + noSmithyDocumentSerde +} + +type GetPromptOutput struct { + + // The Amazon Resource Name (ARN) of the prompt. + // + // This member is required. + Arn *string + + // The time at which the prompt was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique identifier of the prompt. + // + // This member is required. + Id *string + + // The name of the prompt. + // + // This member is required. + Name *string + + // The time at which the prompt was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The version of the prompt. + // + // This member is required. + Version *string + + // The Amazon Resource Name (ARN) of the KMS key that the prompt is encrypted with. + CustomerEncryptionKeyArn *string + + // The name of the default variant for the prompt. This value must match the name + // field in the relevant [PromptVariant]object. + // + // [PromptVariant]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html + DefaultVariant *string + + // The descriptino of the prompt. + Description *string + + // A list of objects, each containing details about a variant of the prompt. + Variants []types.PromptVariant + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPromptMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPrompt{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPrompt{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetPrompt"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetPromptValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPrompt(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetPrompt(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetPrompt", + } +} diff --git a/service/bedrockagent/api_op_ListFlowAliases.go b/service/bedrockagent/api_op_ListFlowAliases.go new file mode 100644 index 00000000000..2b65c8b0d06 --- /dev/null +++ b/service/bedrockagent/api_op_ListFlowAliases.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of aliases for a flow. +func (c *Client) ListFlowAliases(ctx context.Context, params *ListFlowAliasesInput, optFns ...func(*Options)) (*ListFlowAliasesOutput, error) { + if params == nil { + params = &ListFlowAliasesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListFlowAliases", params, optFns, c.addOperationListFlowAliasesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListFlowAliasesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListFlowAliasesInput struct { + + // The unique identifier of the flow for which aliases are being returned. + // + // This member is required. + FlowIdentifier *string + + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + MaxResults *int32 + + // If the total number of results is greater than the maxResults value provided in + // the request, enter the token returned in the nextToken field in the response in + // this field to return the next batch of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListFlowAliasesOutput struct { + + // A list, each member of which contains information about a flow alias. + // + // This member is required. + FlowAliasSummaries []types.FlowAliasSummary + + // If the total number of results is greater than the maxResults value provided in + // the request, use this token when making another request in the nextToken field + // to return the next batch of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListFlowAliasesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListFlowAliases{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFlowAliases{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListFlowAliases"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListFlowAliasesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFlowAliases(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListFlowAliasesPaginatorOptions is the paginator options for ListFlowAliases +type ListFlowAliasesPaginatorOptions struct { + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListFlowAliasesPaginator is a paginator for ListFlowAliases +type ListFlowAliasesPaginator struct { + options ListFlowAliasesPaginatorOptions + client ListFlowAliasesAPIClient + params *ListFlowAliasesInput + nextToken *string + firstPage bool +} + +// NewListFlowAliasesPaginator returns a new ListFlowAliasesPaginator +func NewListFlowAliasesPaginator(client ListFlowAliasesAPIClient, params *ListFlowAliasesInput, optFns ...func(*ListFlowAliasesPaginatorOptions)) *ListFlowAliasesPaginator { + if params == nil { + params = &ListFlowAliasesInput{} + } + + options := ListFlowAliasesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListFlowAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFlowAliasesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListFlowAliases page. +func (p *ListFlowAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListFlowAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListFlowAliasesAPIClient is a client that implements the ListFlowAliases +// operation. +type ListFlowAliasesAPIClient interface { + ListFlowAliases(context.Context, *ListFlowAliasesInput, ...func(*Options)) (*ListFlowAliasesOutput, error) +} + +var _ ListFlowAliasesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListFlowAliases(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListFlowAliases", + } +} diff --git a/service/bedrockagent/api_op_ListFlowVersions.go b/service/bedrockagent/api_op_ListFlowVersions.go new file mode 100644 index 00000000000..37b8ad6bedc --- /dev/null +++ b/service/bedrockagent/api_op_ListFlowVersions.go @@ -0,0 +1,259 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of information about each flow. For more information, see [Deploy a flow in Amazon Bedrock] in +// the Amazon Bedrock User Guide. +// +// [Deploy a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html +func (c *Client) ListFlowVersions(ctx context.Context, params *ListFlowVersionsInput, optFns ...func(*Options)) (*ListFlowVersionsOutput, error) { + if params == nil { + params = &ListFlowVersionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListFlowVersions", params, optFns, c.addOperationListFlowVersionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListFlowVersionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListFlowVersionsInput struct { + + // The unique identifier of the flow. + // + // This member is required. + FlowIdentifier *string + + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + MaxResults *int32 + + // If the total number of results is greater than the maxResults value provided in + // the request, enter the token returned in the nextToken field in the response in + // this field to return the next batch of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListFlowVersionsOutput struct { + + // A list, each member of which contains information about a flow. + // + // This member is required. + FlowVersionSummaries []types.FlowVersionSummary + + // If the total number of results is greater than the maxResults value provided in + // the request, use this token when making another request in the nextToken field + // to return the next batch of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListFlowVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListFlowVersions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFlowVersions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListFlowVersions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListFlowVersionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFlowVersions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListFlowVersionsPaginatorOptions is the paginator options for ListFlowVersions +type ListFlowVersionsPaginatorOptions struct { + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListFlowVersionsPaginator is a paginator for ListFlowVersions +type ListFlowVersionsPaginator struct { + options ListFlowVersionsPaginatorOptions + client ListFlowVersionsAPIClient + params *ListFlowVersionsInput + nextToken *string + firstPage bool +} + +// NewListFlowVersionsPaginator returns a new ListFlowVersionsPaginator +func NewListFlowVersionsPaginator(client ListFlowVersionsAPIClient, params *ListFlowVersionsInput, optFns ...func(*ListFlowVersionsPaginatorOptions)) *ListFlowVersionsPaginator { + if params == nil { + params = &ListFlowVersionsInput{} + } + + options := ListFlowVersionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListFlowVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFlowVersionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListFlowVersions page. +func (p *ListFlowVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListFlowVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListFlowVersionsAPIClient is a client that implements the ListFlowVersions +// operation. +type ListFlowVersionsAPIClient interface { + ListFlowVersions(context.Context, *ListFlowVersionsInput, ...func(*Options)) (*ListFlowVersionsOutput, error) +} + +var _ ListFlowVersionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListFlowVersions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListFlowVersions", + } +} diff --git a/service/bedrockagent/api_op_ListFlows.go b/service/bedrockagent/api_op_ListFlows.go new file mode 100644 index 00000000000..b144ffa7107 --- /dev/null +++ b/service/bedrockagent/api_op_ListFlows.go @@ -0,0 +1,250 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of flows and information about each flow. For more information, +// see [Manage a flow in Amazon Bedrock]in the Amazon Bedrock User Guide. +// +// [Manage a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-manage.html +func (c *Client) ListFlows(ctx context.Context, params *ListFlowsInput, optFns ...func(*Options)) (*ListFlowsOutput, error) { + if params == nil { + params = &ListFlowsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListFlows", params, optFns, c.addOperationListFlowsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListFlowsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListFlowsInput struct { + + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + MaxResults *int32 + + // If the total number of results is greater than the maxResults value provided in + // the request, enter the token returned in the nextToken field in the response in + // this field to return the next batch of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListFlowsOutput struct { + + // A list, each member of which contains information about a flow. + // + // This member is required. + FlowSummaries []types.FlowSummary + + // If the total number of results is greater than the maxResults value provided in + // the request, use this token when making another request in the nextToken field + // to return the next batch of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListFlowsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListFlows{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFlows{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListFlows"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFlows(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListFlowsPaginatorOptions is the paginator options for ListFlows +type ListFlowsPaginatorOptions struct { + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListFlowsPaginator is a paginator for ListFlows +type ListFlowsPaginator struct { + options ListFlowsPaginatorOptions + client ListFlowsAPIClient + params *ListFlowsInput + nextToken *string + firstPage bool +} + +// NewListFlowsPaginator returns a new ListFlowsPaginator +func NewListFlowsPaginator(client ListFlowsAPIClient, params *ListFlowsInput, optFns ...func(*ListFlowsPaginatorOptions)) *ListFlowsPaginator { + if params == nil { + params = &ListFlowsInput{} + } + + options := ListFlowsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListFlowsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFlowsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListFlows page. +func (p *ListFlowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListFlows(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListFlowsAPIClient is a client that implements the ListFlows operation. +type ListFlowsAPIClient interface { + ListFlows(context.Context, *ListFlowsInput, ...func(*Options)) (*ListFlowsOutput, error) +} + +var _ ListFlowsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListFlows(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListFlows", + } +} diff --git a/service/bedrockagent/api_op_ListPrompts.go b/service/bedrockagent/api_op_ListPrompts.go new file mode 100644 index 00000000000..a79f7283e22 --- /dev/null +++ b/service/bedrockagent/api_op_ListPrompts.go @@ -0,0 +1,254 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of prompts from the Prompt management tool and information about +// each prompt. For more information, see [View information about prompts using Prompt management]in the Amazon Bedrock User Guide. +// +// [View information about prompts using Prompt management]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-view.html +func (c *Client) ListPrompts(ctx context.Context, params *ListPromptsInput, optFns ...func(*Options)) (*ListPromptsOutput, error) { + if params == nil { + params = &ListPromptsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPrompts", params, optFns, c.addOperationListPromptsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPromptsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPromptsInput struct { + + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + MaxResults *int32 + + // If the total number of results is greater than the maxResults value provided in + // the request, enter the token returned in the nextToken field in the response in + // this field to return the next batch of results. + NextToken *string + + // The unique identifier of the prompt. + PromptIdentifier *string + + noSmithyDocumentSerde +} + +type ListPromptsOutput struct { + + // A list, each member of which contains information about a prompt using Prompt + // management. + // + // This member is required. + PromptSummaries []types.PromptSummary + + // If the total number of results is greater than the maxResults value provided in + // the request, use this token when making another request in the nextToken field + // to return the next batch of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPromptsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListPrompts{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPrompts{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListPrompts"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPrompts(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListPromptsPaginatorOptions is the paginator options for ListPrompts +type ListPromptsPaginatorOptions struct { + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListPromptsPaginator is a paginator for ListPrompts +type ListPromptsPaginator struct { + options ListPromptsPaginatorOptions + client ListPromptsAPIClient + params *ListPromptsInput + nextToken *string + firstPage bool +} + +// NewListPromptsPaginator returns a new ListPromptsPaginator +func NewListPromptsPaginator(client ListPromptsAPIClient, params *ListPromptsInput, optFns ...func(*ListPromptsPaginatorOptions)) *ListPromptsPaginator { + if params == nil { + params = &ListPromptsInput{} + } + + options := ListPromptsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPromptsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPromptsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPrompts page. +func (p *ListPromptsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPromptsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListPrompts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListPromptsAPIClient is a client that implements the ListPrompts operation. +type ListPromptsAPIClient interface { + ListPrompts(context.Context, *ListPromptsInput, ...func(*Options)) (*ListPromptsOutput, error) +} + +var _ ListPromptsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListPrompts(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListPrompts", + } +} diff --git a/service/bedrockagent/api_op_PrepareFlow.go b/service/bedrockagent/api_op_PrepareFlow.go new file mode 100644 index 00000000000..f59d55e266b --- /dev/null +++ b/service/bedrockagent/api_op_PrepareFlow.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Prepares the DRAFT version of a flow so that it can be invoked. For more +// information, see [Test a flow in Amazon Bedrock]in the Amazon Bedrock User Guide. +// +// [Test a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-test.html +func (c *Client) PrepareFlow(ctx context.Context, params *PrepareFlowInput, optFns ...func(*Options)) (*PrepareFlowOutput, error) { + if params == nil { + params = &PrepareFlowInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PrepareFlow", params, optFns, c.addOperationPrepareFlowMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PrepareFlowOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PrepareFlowInput struct { + + // The unique identifier of the flow. + // + // This member is required. + FlowIdentifier *string + + noSmithyDocumentSerde +} + +type PrepareFlowOutput struct { + + // The unique identifier of the flow. + // + // This member is required. + Id *string + + // The status of the flow. When you submit this request, the status will be + // NotPrepared . If preparation succeeds, the status becomes Prepared . If it + // fails, the status becomes FAILED . + // + // This member is required. + Status types.FlowStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPrepareFlowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpPrepareFlow{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPrepareFlow{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PrepareFlow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPrepareFlowValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPrepareFlow(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPrepareFlow(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PrepareFlow", + } +} diff --git a/service/bedrockagent/api_op_UpdateAgent.go b/service/bedrockagent/api_op_UpdateAgent.go index f83b37ddb9b..b848a5e0f84 100644 --- a/service/bedrockagent/api_op_UpdateAgent.go +++ b/service/bedrockagent/api_op_UpdateAgent.go @@ -71,6 +71,9 @@ type UpdateAgentInput struct { // should interact with users. Instruction *string + // Specifies the new memory configuration for the agent. + MemoryConfiguration *types.MemoryConfiguration + // Contains configurations to override prompts in different parts of an agent // sequence. For more information, see [Advanced prompts]. // diff --git a/service/bedrockagent/api_op_UpdateDataSource.go b/service/bedrockagent/api_op_UpdateDataSource.go index 86a8b33dc59..7ddb94abb62 100644 --- a/service/bedrockagent/api_op_UpdateDataSource.go +++ b/service/bedrockagent/api_op_UpdateDataSource.go @@ -11,10 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates configurations for a data source. +// Updates the configurations for a data source connector. // -// You can't change the chunkingConfiguration after you create the data source. -// Specify the existing chunkingConfiguration . +// You can't change the chunkingConfiguration after you create the data source +// connector. Specify the existing chunkingConfiguration . func (c *Client) UpdateDataSource(ctx context.Context, params *UpdateDataSourceInput, optFns ...func(*Options)) (*UpdateDataSourceOutput, error) { if params == nil { params = &UpdateDataSourceInput{} @@ -32,7 +32,7 @@ func (c *Client) UpdateDataSource(ctx context.Context, params *UpdateDataSourceI type UpdateDataSourceInput struct { - // Contains details about the storage configuration of the data source. + // The connection configuration for the data source that you want to update. // // This member is required. DataSourceConfiguration *types.DataSourceConfiguration @@ -42,7 +42,7 @@ type UpdateDataSourceInput struct { // This member is required. DataSourceId *string - // The unique identifier of the knowledge base to which the data source belongs. + // The unique identifier of the knowledge base for the data source. // // This member is required. KnowledgeBaseId *string @@ -52,7 +52,7 @@ type UpdateDataSourceInput struct { // This member is required. Name *string - // The data deletion policy of the updated data source. + // The data deletion policy for the data source that you want to update. DataDeletionPolicy types.DataDeletionPolicy // Specifies a new description for the data source. diff --git a/service/bedrockagent/api_op_UpdateFlow.go b/service/bedrockagent/api_op_UpdateFlow.go new file mode 100644 index 00000000000..3041c7b39dd --- /dev/null +++ b/service/bedrockagent/api_op_UpdateFlow.go @@ -0,0 +1,220 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Modifies a flow. Include both fields that you want to keep and fields that you +// want to change. For more information, see [How it works]and [Create a flow in Amazon Bedrock] in the Amazon Bedrock User Guide. +// +// [How it works]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html +// [Create a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-create.html +func (c *Client) UpdateFlow(ctx context.Context, params *UpdateFlowInput, optFns ...func(*Options)) (*UpdateFlowOutput, error) { + if params == nil { + params = &UpdateFlowInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateFlow", params, optFns, c.addOperationUpdateFlowMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateFlowOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateFlowInput struct { + + // The Amazon Resource Name (ARN) of the service role with permissions to create + // and manage a flow. For more information, see [Create a service role for flows in Amazon Bedrock]in the Amazon Bedrock User Guide. + // + // [Create a service role for flows in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html + // + // This member is required. + ExecutionRoleArn *string + + // The unique identifier of the flow. + // + // This member is required. + FlowIdentifier *string + + // A name for the flow. + // + // This member is required. + Name *string + + // The Amazon Resource Name (ARN) of the KMS key to encrypt the flow. + CustomerEncryptionKeyArn *string + + // A definition of the nodes and the connections between the nodes in the flow. + Definition *types.FlowDefinition + + // A description for the flow. + Description *string + + noSmithyDocumentSerde +} + +type UpdateFlowOutput struct { + + // The Amazon Resource Name (ARN) of the flow. + // + // This member is required. + Arn *string + + // The time at which the flow was created. + // + // This member is required. + CreatedAt *time.Time + + // The Amazon Resource Name (ARN) of the service role with permissions to create a + // flow. For more information, see [Create a service role for flows in Amazon Bedrock]in the Amazon Bedrock User Guide. + // + // [Create a service role for flows in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html + // + // This member is required. + ExecutionRoleArn *string + + // The unique identifier of the flow. + // + // This member is required. + Id *string + + // The name of the flow. + // + // This member is required. + Name *string + + // The status of the flow. When you submit this request, the status will be + // NotPrepared . If updating fails, the status becomes Failed . + // + // This member is required. + Status types.FlowStatus + + // The time at which the flow was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The version of the flow. When you update a flow, the version updated is the + // DRAFT version. + // + // This member is required. + Version *string + + // The Amazon Resource Name (ARN) of the KMS key that the flow was encrypted with. + CustomerEncryptionKeyArn *string + + // A definition of the nodes and the connections between nodes in the flow. + Definition *types.FlowDefinition + + // The description of the flow. + Description *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateFlowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateFlow{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateFlow{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateFlow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateFlowValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFlow(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateFlow(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateFlow", + } +} diff --git a/service/bedrockagent/api_op_UpdateFlowAlias.go b/service/bedrockagent/api_op_UpdateFlowAlias.go new file mode 100644 index 00000000000..34426638c47 --- /dev/null +++ b/service/bedrockagent/api_op_UpdateFlowAlias.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Modifies the alias of a flow. Include both fields that you want to keep and +// ones that you want to change. For more information, see [Deploy a flow in Amazon Bedrock]in the Amazon Bedrock +// User Guide. +// +// [Deploy a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html +func (c *Client) UpdateFlowAlias(ctx context.Context, params *UpdateFlowAliasInput, optFns ...func(*Options)) (*UpdateFlowAliasOutput, error) { + if params == nil { + params = &UpdateFlowAliasInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateFlowAlias", params, optFns, c.addOperationUpdateFlowAliasMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateFlowAliasOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateFlowAliasInput struct { + + // The unique identifier of the alias. + // + // This member is required. + AliasIdentifier *string + + // The unique identifier of the flow. + // + // This member is required. + FlowIdentifier *string + + // The name of the flow alias. + // + // This member is required. + Name *string + + // Contains information about the version to which to map the alias. + // + // This member is required. + RoutingConfiguration []types.FlowAliasRoutingConfigurationListItem + + // A description for the flow alias. + Description *string + + noSmithyDocumentSerde +} + +type UpdateFlowAliasOutput struct { + + // The Amazon Resource Name (ARN) of the flow. + // + // This member is required. + Arn *string + + // The time at which the flow was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique identifier of the flow. + // + // This member is required. + FlowId *string + + // The unique identifier of the alias. + // + // This member is required. + Id *string + + // The name of the flow alias. + // + // This member is required. + Name *string + + // Contains information about the version that the alias is mapped to. + // + // This member is required. + RoutingConfiguration []types.FlowAliasRoutingConfigurationListItem + + // The time at which the flow alias was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The description of the flow. + Description *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateFlowAliasMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateFlowAlias{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateFlowAlias{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateFlowAlias"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateFlowAliasValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFlowAlias(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateFlowAlias(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateFlowAlias", + } +} diff --git a/service/bedrockagent/api_op_UpdatePrompt.go b/service/bedrockagent/api_op_UpdatePrompt.go new file mode 100644 index 00000000000..44eafa3dbd7 --- /dev/null +++ b/service/bedrockagent/api_op_UpdatePrompt.go @@ -0,0 +1,211 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagent/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Modifies a prompt in your prompt library. Include both fields that you want to +// keep and fields that you want to replace. For more information, see [Prompt management in Amazon Bedrock]and [Edit prompts in your prompt library] in the +// Amazon Bedrock User Guide. +// +// [Edit prompts in your prompt library]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-manage.html#prompt-management-edit +// [Prompt management in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html +func (c *Client) UpdatePrompt(ctx context.Context, params *UpdatePromptInput, optFns ...func(*Options)) (*UpdatePromptOutput, error) { + if params == nil { + params = &UpdatePromptInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePrompt", params, optFns, c.addOperationUpdatePromptMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePromptOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePromptInput struct { + + // A name for the prompt. + // + // This member is required. + Name *string + + // The unique identifier of the prompt. + // + // This member is required. + PromptIdentifier *string + + // The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt. + CustomerEncryptionKeyArn *string + + // The name of the default variant for the prompt. This value must match the name + // field in the relevant [PromptVariant]object. + // + // [PromptVariant]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html + DefaultVariant *string + + // A description for the prompt. + Description *string + + // A list of objects, each containing details about a variant of the prompt. + Variants []types.PromptVariant + + noSmithyDocumentSerde +} + +type UpdatePromptOutput struct { + + // The Amazon Resource Name (ARN) of the prompt. + // + // This member is required. + Arn *string + + // The time at which the prompt was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique identifier of the prompt. + // + // This member is required. + Id *string + + // The name of the prompt. + // + // This member is required. + Name *string + + // The time at which the prompt was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The version of the prompt. When you update a prompt, the version updated is the + // DRAFT version. + // + // This member is required. + Version *string + + // The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt. + CustomerEncryptionKeyArn *string + + // The name of the default variant for the prompt. This value must match the name + // field in the relevant [PromptVariant]object. + // + // [PromptVariant]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html + DefaultVariant *string + + // The description of the prompt. + Description *string + + // A list of objects, each containing details about a variant of the prompt. + Variants []types.PromptVariant + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePromptMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePrompt{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePrompt{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdatePrompt"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdatePromptValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePrompt(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdatePrompt(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdatePrompt", + } +} diff --git a/service/bedrockagent/deserializers.go b/service/bedrockagent/deserializers.go index 6c6b1269595..050d3ec2926 100644 --- a/service/bedrockagent/deserializers.go +++ b/service/bedrockagent/deserializers.go @@ -851,14 +851,14 @@ func awsRestjson1_deserializeOpDocumentCreateDataSourceOutput(v **CreateDataSour return nil } -type awsRestjson1_deserializeOpCreateKnowledgeBase struct { +type awsRestjson1_deserializeOpCreateFlow struct { } -func (*awsRestjson1_deserializeOpCreateKnowledgeBase) ID() string { +func (*awsRestjson1_deserializeOpCreateFlow) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateFlow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -872,9 +872,9 @@ func (m *awsRestjson1_deserializeOpCreateKnowledgeBase) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateKnowledgeBase(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateFlow(response, &metadata) } - output := &CreateKnowledgeBaseOutput{} + output := &CreateFlowOutput{} out.Result = output var buff [1024]byte @@ -895,7 +895,7 @@ func (m *awsRestjson1_deserializeOpCreateKnowledgeBase) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateFlowOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -908,7 +908,7 @@ func (m *awsRestjson1_deserializeOpCreateKnowledgeBase) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateFlow(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -977,7 +977,7 @@ func awsRestjson1_deserializeOpErrorCreateKnowledgeBase(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(v **CreateKnowledgeBaseOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateFlowOutput(v **CreateFlowOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -990,20 +990,118 @@ func awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(v **CreateKnowl return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateKnowledgeBaseOutput + var sv *CreateFlowOutput if *v == nil { - sv = &CreateKnowledgeBaseOutput{} + sv = &CreateFlowOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBase": - if err := awsRestjson1_deserializeDocumentKnowledgeBase(&sv.KnowledgeBase, value); err != nil { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "customerEncryptionKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.CustomerEncryptionKeyArn = ptr.String(jtv) + } + + case "definition": + if err := awsRestjson1_deserializeDocumentFlowDefinition(&sv.Definition, value); err != nil { return err } + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "executionRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowExecutionRoleArn to be of type string, got %T instead", value) + } + sv.ExecutionRoleArn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowStatus to be of type string, got %T instead", value) + } + sv.Status = types.FlowStatus(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DraftVersion to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + default: _, _ = key, value @@ -1013,14 +1111,14 @@ func awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(v **CreateKnowl return nil } -type awsRestjson1_deserializeOpDeleteAgent struct { +type awsRestjson1_deserializeOpCreateFlowAlias struct { } -func (*awsRestjson1_deserializeOpDeleteAgent) ID() string { +func (*awsRestjson1_deserializeOpCreateFlowAlias) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteAgent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateFlowAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1034,9 +1132,9 @@ func (m *awsRestjson1_deserializeOpDeleteAgent) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAgent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateFlowAlias(response, &metadata) } - output := &DeleteAgentOutput{} + output := &CreateFlowAliasOutput{} out.Result = output var buff [1024]byte @@ -1057,7 +1155,7 @@ func (m *awsRestjson1_deserializeOpDeleteAgent) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteAgentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateFlowAliasOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1070,7 +1168,7 @@ func (m *awsRestjson1_deserializeOpDeleteAgent) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteAgent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateFlowAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1123,6 +1221,9 @@ func awsRestjson1_deserializeOpErrorDeleteAgent(response *smithyhttp.Response, m case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -1139,7 +1240,7 @@ func awsRestjson1_deserializeOpErrorDeleteAgent(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentDeleteAgentOutput(v **DeleteAgentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateFlowAliasOutput(v **CreateFlowAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1152,31 +1253,89 @@ func awsRestjson1_deserializeOpDocumentDeleteAgentOutput(v **DeleteAgentOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteAgentOutput + var sv *CreateFlowAliasOutput if *v == nil { - sv = &DeleteAgentOutput{} + sv = &CreateFlowAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentId": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected FlowAliasArn to be of type string, got %T instead", value) } - sv.AgentId = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "agentStatus": + case "createdAt": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) } - sv.AgentStatus = types.AgentStatus(jtv) + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "flowId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.FlowId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowAliasId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "routingConfiguration": + if err := awsRestjson1_deserializeDocumentFlowAliasRoutingConfiguration(&sv.RoutingConfiguration, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) } default: @@ -1188,14 +1347,14 @@ func awsRestjson1_deserializeOpDocumentDeleteAgentOutput(v **DeleteAgentOutput, return nil } -type awsRestjson1_deserializeOpDeleteAgentActionGroup struct { +type awsRestjson1_deserializeOpCreateFlowVersion struct { } -func (*awsRestjson1_deserializeOpDeleteAgentActionGroup) ID() string { +func (*awsRestjson1_deserializeOpCreateFlowVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteAgentActionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateFlowVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1209,15 +1368,43 @@ func (m *awsRestjson1_deserializeOpDeleteAgentActionGroup) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAgentActionGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateFlowVersion(response, &metadata) } - output := &DeleteAgentActionGroupOutput{} + output := &CreateFlowVersionOutput{} out.Result = output + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCreateFlowVersionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteAgentActionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateFlowVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1270,6 +1457,9 @@ func awsRestjson1_deserializeOpErrorDeleteAgentActionGroup(response *smithyhttp. case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -1286,176 +1476,116 @@ func awsRestjson1_deserializeOpErrorDeleteAgentActionGroup(response *smithyhttp. } } -type awsRestjson1_deserializeOpDeleteAgentAlias struct { -} - -func (*awsRestjson1_deserializeOpDeleteAgentAlias) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteAgentAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err +func awsRestjson1_deserializeOpDocumentCreateFlowVersionOutput(v **CreateFlowVersionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - response, ok := out.RawResponse.(*smithyhttp.Response) + shape, ok := value.(map[string]interface{}) if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + return fmt.Errorf("unexpected JSON type %v", value) } - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAgentAlias(response, &metadata) + var sv *CreateFlowVersionOutput + if *v == nil { + sv = &CreateFlowVersionOutput{} + } else { + sv = *v } - output := &DeleteAgentAliasOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDeleteAgentAliasOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteAgentAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError + case "customerEncryptionKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.CustomerEncryptionKeyArn = ptr.String(jtv) + } - } -} + case "definition": + if err := awsRestjson1_deserializeDocumentFlowDefinition(&sv.Definition, value); err != nil { + return err + } -func awsRestjson1_deserializeOpDocumentDeleteAgentAliasOutput(v **DeleteAgentAliasOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "executionRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowExecutionRoleArn to be of type string, got %T instead", value) + } + sv.ExecutionRoleArn = ptr.String(jtv) + } - var sv *DeleteAgentAliasOutput - if *v == nil { - sv = &DeleteAgentAliasOutput{} - } else { - sv = *v - } + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } - for key, value := range shape { - switch key { - case "agentAliasId": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AgentAliasId to be of type string, got %T instead", value) + return fmt.Errorf("expected FlowName to be of type string, got %T instead", value) } - sv.AgentAliasId = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "agentAliasStatus": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AgentAliasStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected FlowStatus to be of type string, got %T instead", value) } - sv.AgentAliasStatus = types.AgentAliasStatus(jtv) + sv.Status = types.FlowStatus(jtv) } - case "agentId": + case "version": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected NumericalVersion to be of type string, got %T instead", value) } - sv.AgentId = ptr.String(jtv) + sv.Version = ptr.String(jtv) } default: @@ -1467,14 +1597,14 @@ func awsRestjson1_deserializeOpDocumentDeleteAgentAliasOutput(v **DeleteAgentAli return nil } -type awsRestjson1_deserializeOpDeleteAgentVersion struct { +type awsRestjson1_deserializeOpCreateKnowledgeBase struct { } -func (*awsRestjson1_deserializeOpDeleteAgentVersion) ID() string { +func (*awsRestjson1_deserializeOpCreateKnowledgeBase) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteAgentVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1488,9 +1618,9 @@ func (m *awsRestjson1_deserializeOpDeleteAgentVersion) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAgentVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateKnowledgeBase(response, &metadata) } - output := &DeleteAgentVersionOutput{} + output := &CreateKnowledgeBaseOutput{} out.Result = output var buff [1024]byte @@ -1511,7 +1641,7 @@ func (m *awsRestjson1_deserializeOpDeleteAgentVersion) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteAgentVersionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1524,7 +1654,7 @@ func (m *awsRestjson1_deserializeOpDeleteAgentVersion) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteAgentVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1574,8 +1704,8 @@ func awsRestjson1_deserializeOpErrorDeleteAgentVersion(response *smithyhttp.Resp case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -1593,7 +1723,7 @@ func awsRestjson1_deserializeOpErrorDeleteAgentVersion(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentDeleteAgentVersionOutput(v **DeleteAgentVersionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(v **CreateKnowledgeBaseOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1606,40 +1736,18 @@ func awsRestjson1_deserializeOpDocumentDeleteAgentVersionOutput(v **DeleteAgentV return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteAgentVersionOutput + var sv *CreateKnowledgeBaseOutput if *v == nil { - sv = &DeleteAgentVersionOutput{} + sv = &CreateKnowledgeBaseOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.AgentId = ptr.String(jtv) - } - - case "agentStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) - } - sv.AgentStatus = types.AgentStatus(jtv) - } - - case "agentVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NumericalVersion to be of type string, got %T instead", value) - } - sv.AgentVersion = ptr.String(jtv) + case "knowledgeBase": + if err := awsRestjson1_deserializeDocumentKnowledgeBase(&sv.KnowledgeBase, value); err != nil { + return err } default: @@ -1651,14 +1759,14 @@ func awsRestjson1_deserializeOpDocumentDeleteAgentVersionOutput(v **DeleteAgentV return nil } -type awsRestjson1_deserializeOpDeleteDataSource struct { +type awsRestjson1_deserializeOpCreatePrompt struct { } -func (*awsRestjson1_deserializeOpDeleteDataSource) ID() string { +func (*awsRestjson1_deserializeOpCreatePrompt) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreatePrompt) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1672,9 +1780,9 @@ func (m *awsRestjson1_deserializeOpDeleteDataSource) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataSource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreatePrompt(response, &metadata) } - output := &DeleteDataSourceOutput{} + output := &CreatePromptOutput{} out.Result = output var buff [1024]byte @@ -1695,7 +1803,7 @@ func (m *awsRestjson1_deserializeOpDeleteDataSource) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteDataSourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreatePromptOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1708,7 +1816,7 @@ func (m *awsRestjson1_deserializeOpDeleteDataSource) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreatePrompt(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1758,8 +1866,8 @@ func awsRestjson1_deserializeOpErrorDeleteDataSource(response *smithyhttp.Respon case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -1777,7 +1885,7 @@ func awsRestjson1_deserializeOpErrorDeleteDataSource(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentDeleteDataSourceOutput(v **DeleteDataSourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreatePromptOutput(v **CreatePromptOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1790,59 +1898,126 @@ func awsRestjson1_deserializeOpDocumentDeleteDataSourceOutput(v **DeleteDataSour return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteDataSourceOutput + var sv *CreatePromptOutput if *v == nil { - sv = &DeleteDataSourceOutput{} + sv = &CreatePromptOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "dataSourceId": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected PromptArn to be of type string, got %T instead", value) } - sv.DataSourceId = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "knowledgeBaseId": + case "createdAt": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) } - sv.KnowledgeBaseId = ptr.String(jtv) + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) } - case "status": + case "customerEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DataSourceStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) } - sv.Status = types.DataSourceStatus(jtv) + sv.CustomerEncryptionKeyArn = ptr.String(jtv) } - default: - _, _ = key, value + case "defaultVariant": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptVariantName to be of type string, got %T instead", value) + } + sv.DefaultVariant = ptr.String(jtv) + } - } - } - *v = sv - return nil -} + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } -type awsRestjson1_deserializeOpDeleteKnowledgeBase struct { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + case "variants": + if err := awsRestjson1_deserializeDocumentPromptVariantList(&sv.Variants, value); err != nil { + return err + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteKnowledgeBase) ID() string { +type awsRestjson1_deserializeOpCreatePromptVersion struct { +} + +func (*awsRestjson1_deserializeOpCreatePromptVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreatePromptVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1856,9 +2031,9 @@ func (m *awsRestjson1_deserializeOpDeleteKnowledgeBase) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreatePromptVersion(response, &metadata) } - output := &DeleteKnowledgeBaseOutput{} + output := &CreatePromptVersionOutput{} out.Result = output var buff [1024]byte @@ -1879,7 +2054,7 @@ func (m *awsRestjson1_deserializeOpDeleteKnowledgeBase) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteKnowledgeBaseOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreatePromptVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1892,7 +2067,7 @@ func (m *awsRestjson1_deserializeOpDeleteKnowledgeBase) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreatePromptVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1945,6 +2120,9 @@ func awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response *smithyhttp.Res case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -1961,7 +2139,7 @@ func awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentDeleteKnowledgeBaseOutput(v **DeleteKnowledgeBaseOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreatePromptVersionOutput(v **CreatePromptVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1974,148 +2152,126 @@ func awsRestjson1_deserializeOpDocumentDeleteKnowledgeBaseOutput(v **DeleteKnowl return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteKnowledgeBaseOutput + var sv *CreatePromptVersionOutput if *v == nil { - sv = &DeleteKnowledgeBaseOutput{} + sv = &CreatePromptVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBaseId": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected PromptArn to be of type string, got %T instead", value) } - sv.KnowledgeBaseId = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "status": + case "createdAt": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KnowledgeBaseStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) } - sv.Status = types.KnowledgeBaseStatus(jtv) + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDisassociateAgentKnowledgeBase struct { -} - -func (*awsRestjson1_deserializeOpDisassociateAgentKnowledgeBase) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDisassociateAgentKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateAgentKnowledgeBase(response, &metadata) - } - output := &DisassociateAgentKnowledgeBaseOutput{} - out.Result = output - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDisassociateAgentKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "customerEncryptionKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.CustomerEncryptionKeyArn = ptr.String(jtv) + } - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case "defaultVariant": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptVariantName to be of type string, got %T instead", value) + } + sv.DefaultVariant = ptr.String(jtv) + } - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case "variants": + if err := awsRestjson1_deserializeDocumentPromptVariantList(&sv.Variants, value); err != nil { + return err + } - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) + default: + _, _ = key, value - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, } - return genericError - } + *v = sv + return nil } -type awsRestjson1_deserializeOpGetAgent struct { +type awsRestjson1_deserializeOpDeleteAgent struct { } -func (*awsRestjson1_deserializeOpGetAgent) ID() string { +func (*awsRestjson1_deserializeOpDeleteAgent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAgent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAgent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2129,9 +2285,9 @@ func (m *awsRestjson1_deserializeOpGetAgent) HandleDeserialize(ctx context.Conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAgent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAgent(response, &metadata) } - output := &GetAgentOutput{} + output := &DeleteAgentOutput{} out.Result = output var buff [1024]byte @@ -2152,7 +2308,7 @@ func (m *awsRestjson1_deserializeOpGetAgent) HandleDeserialize(ctx context.Conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetAgentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteAgentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2165,7 +2321,7 @@ func (m *awsRestjson1_deserializeOpGetAgent) HandleDeserialize(ctx context.Conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAgent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAgent(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2209,6 +2365,9 @@ func awsRestjson1_deserializeOpErrorGetAgent(response *smithyhttp.Response, meta case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -2231,7 +2390,7 @@ func awsRestjson1_deserializeOpErrorGetAgent(response *smithyhttp.Response, meta } } -func awsRestjson1_deserializeOpDocumentGetAgentOutput(v **GetAgentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteAgentOutput(v **DeleteAgentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2244,22 +2403,35 @@ func awsRestjson1_deserializeOpDocumentGetAgentOutput(v **GetAgentOutput, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetAgentOutput + var sv *DeleteAgentOutput if *v == nil { - sv = &GetAgentOutput{} + sv = &DeleteAgentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agent": - if err := awsRestjson1_deserializeDocumentAgent(&sv.Agent, value); err != nil { - return err - } - - default: - _, _ = key, value + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) + } + + case "agentStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) + } + sv.AgentStatus = types.AgentStatus(jtv) + } + + default: + _, _ = key, value } } @@ -2267,14 +2439,14 @@ func awsRestjson1_deserializeOpDocumentGetAgentOutput(v **GetAgentOutput, value return nil } -type awsRestjson1_deserializeOpGetAgentActionGroup struct { +type awsRestjson1_deserializeOpDeleteAgentActionGroup struct { } -func (*awsRestjson1_deserializeOpGetAgentActionGroup) ID() string { +func (*awsRestjson1_deserializeOpDeleteAgentActionGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAgentActionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAgentActionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2288,43 +2460,15 @@ func (m *awsRestjson1_deserializeOpGetAgentActionGroup) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAgentActionGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAgentActionGroup(response, &metadata) } - output := &GetAgentActionGroupOutput{} + output := &DeleteAgentActionGroupOutput{} out.Result = output - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentGetAgentActionGroupOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAgentActionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAgentActionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2368,6 +2512,9 @@ func awsRestjson1_deserializeOpErrorGetAgentActionGroup(response *smithyhttp.Res case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -2390,50 +2537,14 @@ func awsRestjson1_deserializeOpErrorGetAgentActionGroup(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentGetAgentActionGroupOutput(v **GetAgentActionGroupOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetAgentActionGroupOutput - if *v == nil { - sv = &GetAgentActionGroupOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "agentActionGroup": - if err := awsRestjson1_deserializeDocumentAgentActionGroup(&sv.AgentActionGroup, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetAgentAlias struct { +type awsRestjson1_deserializeOpDeleteAgentAlias struct { } -func (*awsRestjson1_deserializeOpGetAgentAlias) ID() string { +func (*awsRestjson1_deserializeOpDeleteAgentAlias) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAgentAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAgentAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2447,9 +2558,9 @@ func (m *awsRestjson1_deserializeOpGetAgentAlias) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAgentAlias(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAgentAlias(response, &metadata) } - output := &GetAgentAliasOutput{} + output := &DeleteAgentAliasOutput{} out.Result = output var buff [1024]byte @@ -2470,7 +2581,7 @@ func (m *awsRestjson1_deserializeOpGetAgentAlias) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetAgentAliasOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteAgentAliasOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2483,7 +2594,7 @@ func (m *awsRestjson1_deserializeOpGetAgentAlias) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAgentAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAgentAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2549,7 +2660,7 @@ func awsRestjson1_deserializeOpErrorGetAgentAlias(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetAgentAliasOutput(v **GetAgentAliasOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteAgentAliasOutput(v **DeleteAgentAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2562,18 +2673,40 @@ func awsRestjson1_deserializeOpDocumentGetAgentAliasOutput(v **GetAgentAliasOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetAgentAliasOutput + var sv *DeleteAgentAliasOutput if *v == nil { - sv = &GetAgentAliasOutput{} + sv = &DeleteAgentAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentAlias": - if err := awsRestjson1_deserializeDocumentAgentAlias(&sv.AgentAlias, value); err != nil { - return err + case "agentAliasId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentAliasId to be of type string, got %T instead", value) + } + sv.AgentAliasId = ptr.String(jtv) + } + + case "agentAliasStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentAliasStatus to be of type string, got %T instead", value) + } + sv.AgentAliasStatus = types.AgentAliasStatus(jtv) + } + + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) } default: @@ -2585,14 +2718,14 @@ func awsRestjson1_deserializeOpDocumentGetAgentAliasOutput(v **GetAgentAliasOutp return nil } -type awsRestjson1_deserializeOpGetAgentKnowledgeBase struct { +type awsRestjson1_deserializeOpDeleteAgentVersion struct { } -func (*awsRestjson1_deserializeOpGetAgentKnowledgeBase) ID() string { +func (*awsRestjson1_deserializeOpDeleteAgentVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAgentKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAgentVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2606,9 +2739,9 @@ func (m *awsRestjson1_deserializeOpGetAgentKnowledgeBase) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAgentKnowledgeBase(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAgentVersion(response, &metadata) } - output := &GetAgentKnowledgeBaseOutput{} + output := &DeleteAgentVersionOutput{} out.Result = output var buff [1024]byte @@ -2629,7 +2762,7 @@ func (m *awsRestjson1_deserializeOpGetAgentKnowledgeBase) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetAgentKnowledgeBaseOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteAgentVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2642,7 +2775,7 @@ func (m *awsRestjson1_deserializeOpGetAgentKnowledgeBase) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAgentKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAgentVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2686,6 +2819,9 @@ func awsRestjson1_deserializeOpErrorGetAgentKnowledgeBase(response *smithyhttp.R case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -2708,7 +2844,7 @@ func awsRestjson1_deserializeOpErrorGetAgentKnowledgeBase(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentGetAgentKnowledgeBaseOutput(v **GetAgentKnowledgeBaseOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteAgentVersionOutput(v **DeleteAgentVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2721,18 +2857,40 @@ func awsRestjson1_deserializeOpDocumentGetAgentKnowledgeBaseOutput(v **GetAgentK return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetAgentKnowledgeBaseOutput + var sv *DeleteAgentVersionOutput if *v == nil { - sv = &GetAgentKnowledgeBaseOutput{} + sv = &DeleteAgentVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentKnowledgeBase": - if err := awsRestjson1_deserializeDocumentAgentKnowledgeBase(&sv.AgentKnowledgeBase, value); err != nil { - return err + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) + } + + case "agentStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) + } + sv.AgentStatus = types.AgentStatus(jtv) + } + + case "agentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NumericalVersion to be of type string, got %T instead", value) + } + sv.AgentVersion = ptr.String(jtv) } default: @@ -2744,14 +2902,14 @@ func awsRestjson1_deserializeOpDocumentGetAgentKnowledgeBaseOutput(v **GetAgentK return nil } -type awsRestjson1_deserializeOpGetAgentVersion struct { +type awsRestjson1_deserializeOpDeleteDataSource struct { } -func (*awsRestjson1_deserializeOpGetAgentVersion) ID() string { +func (*awsRestjson1_deserializeOpDeleteDataSource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAgentVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2765,9 +2923,9 @@ func (m *awsRestjson1_deserializeOpGetAgentVersion) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAgentVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataSource(response, &metadata) } - output := &GetAgentVersionOutput{} + output := &DeleteDataSourceOutput{} out.Result = output var buff [1024]byte @@ -2788,7 +2946,7 @@ func (m *awsRestjson1_deserializeOpGetAgentVersion) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetAgentVersionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteDataSourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2801,7 +2959,7 @@ func (m *awsRestjson1_deserializeOpGetAgentVersion) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAgentVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2845,6 +3003,9 @@ func awsRestjson1_deserializeOpErrorGetAgentVersion(response *smithyhttp.Respons case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -2867,7 +3028,7 @@ func awsRestjson1_deserializeOpErrorGetAgentVersion(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentGetAgentVersionOutput(v **GetAgentVersionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteDataSourceOutput(v **DeleteDataSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2880,18 +3041,40 @@ func awsRestjson1_deserializeOpDocumentGetAgentVersionOutput(v **GetAgentVersion return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetAgentVersionOutput + var sv *DeleteDataSourceOutput if *v == nil { - sv = &GetAgentVersionOutput{} + sv = &DeleteDataSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentVersion": - if err := awsRestjson1_deserializeDocumentAgentVersion(&sv.AgentVersion, value); err != nil { - return err + case "dataSourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.DataSourceId = ptr.String(jtv) + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataSourceStatus to be of type string, got %T instead", value) + } + sv.Status = types.DataSourceStatus(jtv) } default: @@ -2903,14 +3086,14 @@ func awsRestjson1_deserializeOpDocumentGetAgentVersionOutput(v **GetAgentVersion return nil } -type awsRestjson1_deserializeOpGetDataSource struct { +type awsRestjson1_deserializeOpDeleteFlow struct { } -func (*awsRestjson1_deserializeOpGetDataSource) ID() string { +func (*awsRestjson1_deserializeOpDeleteFlow) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteFlow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2924,9 +3107,9 @@ func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetDataSource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteFlow(response, &metadata) } - output := &GetDataSourceOutput{} + output := &DeleteFlowOutput{} out.Result = output var buff [1024]byte @@ -2947,7 +3130,7 @@ func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetDataSourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteFlowOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2960,7 +3143,7 @@ func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteFlow(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3004,6 +3187,9 @@ func awsRestjson1_deserializeOpErrorGetDataSource(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3026,7 +3212,7 @@ func awsRestjson1_deserializeOpErrorGetDataSource(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteFlowOutput(v **DeleteFlowOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3039,18 +3225,22 @@ func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetDataSourceOutput + var sv *DeleteFlowOutput if *v == nil { - sv = &GetDataSourceOutput{} + sv = &DeleteFlowOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "dataSource": - if err := awsRestjson1_deserializeDocumentDataSource(&sv.DataSource, value); err != nil { - return err + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) } default: @@ -3062,14 +3252,14 @@ func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutp return nil } -type awsRestjson1_deserializeOpGetIngestionJob struct { +type awsRestjson1_deserializeOpDeleteFlowAlias struct { } -func (*awsRestjson1_deserializeOpGetIngestionJob) ID() string { +func (*awsRestjson1_deserializeOpDeleteFlowAlias) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetIngestionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteFlowAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3083,9 +3273,9 @@ func (m *awsRestjson1_deserializeOpGetIngestionJob) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetIngestionJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteFlowAlias(response, &metadata) } - output := &GetIngestionJobOutput{} + output := &DeleteFlowAliasOutput{} out.Result = output var buff [1024]byte @@ -3106,7 +3296,7 @@ func (m *awsRestjson1_deserializeOpGetIngestionJob) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetIngestionJobOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteFlowAliasOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3119,7 +3309,7 @@ func (m *awsRestjson1_deserializeOpGetIngestionJob) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetIngestionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteFlowAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3163,6 +3353,9 @@ func awsRestjson1_deserializeOpErrorGetIngestionJob(response *smithyhttp.Respons case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3185,7 +3378,7 @@ func awsRestjson1_deserializeOpErrorGetIngestionJob(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentGetIngestionJobOutput(v **GetIngestionJobOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteFlowAliasOutput(v **DeleteFlowAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3198,18 +3391,31 @@ func awsRestjson1_deserializeOpDocumentGetIngestionJobOutput(v **GetIngestionJob return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetIngestionJobOutput + var sv *DeleteFlowAliasOutput if *v == nil { - sv = &GetIngestionJobOutput{} + sv = &DeleteFlowAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ingestionJob": - if err := awsRestjson1_deserializeDocumentIngestionJob(&sv.IngestionJob, value); err != nil { - return err + case "flowId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.FlowId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowAliasId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) } default: @@ -3221,14 +3427,14 @@ func awsRestjson1_deserializeOpDocumentGetIngestionJobOutput(v **GetIngestionJob return nil } -type awsRestjson1_deserializeOpGetKnowledgeBase struct { +type awsRestjson1_deserializeOpDeleteFlowVersion struct { } -func (*awsRestjson1_deserializeOpGetKnowledgeBase) ID() string { +func (*awsRestjson1_deserializeOpDeleteFlowVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteFlowVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3242,9 +3448,9 @@ func (m *awsRestjson1_deserializeOpGetKnowledgeBase) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetKnowledgeBase(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteFlowVersion(response, &metadata) } - output := &GetKnowledgeBaseOutput{} + output := &DeleteFlowVersionOutput{} out.Result = output var buff [1024]byte @@ -3265,7 +3471,7 @@ func (m *awsRestjson1_deserializeOpGetKnowledgeBase) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteFlowVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3278,7 +3484,7 @@ func (m *awsRestjson1_deserializeOpGetKnowledgeBase) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteFlowVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3322,6 +3528,9 @@ func awsRestjson1_deserializeOpErrorGetKnowledgeBase(response *smithyhttp.Respon case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3344,7 +3553,7 @@ func awsRestjson1_deserializeOpErrorGetKnowledgeBase(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(v **GetKnowledgeBaseOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteFlowVersionOutput(v **DeleteFlowVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3357,18 +3566,31 @@ func awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(v **GetKnowledgeBa return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetKnowledgeBaseOutput + var sv *DeleteFlowVersionOutput if *v == nil { - sv = &GetKnowledgeBaseOutput{} + sv = &DeleteFlowVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBase": - if err := awsRestjson1_deserializeDocumentKnowledgeBase(&sv.KnowledgeBase, value); err != nil { - return err + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NumericalVersion to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) } default: @@ -3380,14 +3602,14 @@ func awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(v **GetKnowledgeBa return nil } -type awsRestjson1_deserializeOpListAgentActionGroups struct { +type awsRestjson1_deserializeOpDeleteKnowledgeBase struct { } -func (*awsRestjson1_deserializeOpListAgentActionGroups) ID() string { +func (*awsRestjson1_deserializeOpDeleteKnowledgeBase) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAgentActionGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3401,9 +3623,9 @@ func (m *awsRestjson1_deserializeOpListAgentActionGroups) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAgentActionGroups(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response, &metadata) } - output := &ListAgentActionGroupsOutput{} + output := &DeleteKnowledgeBaseOutput{} out.Result = output var buff [1024]byte @@ -3424,7 +3646,7 @@ func (m *awsRestjson1_deserializeOpListAgentActionGroups) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAgentActionGroupsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteKnowledgeBaseOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3437,7 +3659,7 @@ func (m *awsRestjson1_deserializeOpListAgentActionGroups) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAgentActionGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3481,6 +3703,9 @@ func awsRestjson1_deserializeOpErrorListAgentActionGroups(response *smithyhttp.R case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3503,7 +3728,7 @@ func awsRestjson1_deserializeOpErrorListAgentActionGroups(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListAgentActionGroupsOutput(v **ListAgentActionGroupsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteKnowledgeBaseOutput(v **DeleteKnowledgeBaseOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3516,27 +3741,31 @@ func awsRestjson1_deserializeOpDocumentListAgentActionGroupsOutput(v **ListAgent return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAgentActionGroupsOutput + var sv *DeleteKnowledgeBaseOutput if *v == nil { - sv = &ListAgentActionGroupsOutput{} + sv = &DeleteKnowledgeBaseOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "actionGroupSummaries": - if err := awsRestjson1_deserializeDocumentActionGroupSummaries(&sv.ActionGroupSummaries, value); err != nil { - return err + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) } - case "nextToken": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected KnowledgeBaseStatus to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.Status = types.KnowledgeBaseStatus(jtv) } default: @@ -3548,14 +3777,14 @@ func awsRestjson1_deserializeOpDocumentListAgentActionGroupsOutput(v **ListAgent return nil } -type awsRestjson1_deserializeOpListAgentAliases struct { +type awsRestjson1_deserializeOpDeletePrompt struct { } -func (*awsRestjson1_deserializeOpListAgentAliases) ID() string { +func (*awsRestjson1_deserializeOpDeletePrompt) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAgentAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeletePrompt) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3569,9 +3798,9 @@ func (m *awsRestjson1_deserializeOpListAgentAliases) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAgentAliases(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeletePrompt(response, &metadata) } - output := &ListAgentAliasesOutput{} + output := &DeletePromptOutput{} out.Result = output var buff [1024]byte @@ -3592,7 +3821,7 @@ func (m *awsRestjson1_deserializeOpListAgentAliases) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAgentAliasesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeletePromptOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3605,7 +3834,7 @@ func (m *awsRestjson1_deserializeOpListAgentAliases) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAgentAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeletePrompt(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3649,6 +3878,9 @@ func awsRestjson1_deserializeOpErrorListAgentAliases(response *smithyhttp.Respon case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3671,7 +3903,7 @@ func awsRestjson1_deserializeOpErrorListAgentAliases(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListAgentAliasesOutput(v **ListAgentAliasesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeletePromptOutput(v **DeletePromptOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3684,27 +3916,31 @@ func awsRestjson1_deserializeOpDocumentListAgentAliasesOutput(v **ListAgentAlias return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAgentAliasesOutput + var sv *DeletePromptOutput if *v == nil { - sv = &ListAgentAliasesOutput{} + sv = &DeletePromptOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentAliasSummaries": - if err := awsRestjson1_deserializeDocumentAgentAliasSummaries(&sv.AgentAliasSummaries, value); err != nil { - return err + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) } - case "nextToken": + case "version": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected NumericalVersion to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.Version = ptr.String(jtv) } default: @@ -3716,14 +3952,14 @@ func awsRestjson1_deserializeOpDocumentListAgentAliasesOutput(v **ListAgentAlias return nil } -type awsRestjson1_deserializeOpListAgentKnowledgeBases struct { +type awsRestjson1_deserializeOpDisassociateAgentKnowledgeBase struct { } -func (*awsRestjson1_deserializeOpListAgentKnowledgeBases) ID() string { +func (*awsRestjson1_deserializeOpDisassociateAgentKnowledgeBase) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAgentKnowledgeBases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisassociateAgentKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3737,43 +3973,15 @@ func (m *awsRestjson1_deserializeOpListAgentKnowledgeBases) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAgentKnowledgeBases(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisassociateAgentKnowledgeBase(response, &metadata) } - output := &ListAgentKnowledgeBasesOutput{} + output := &DisassociateAgentKnowledgeBaseOutput{} out.Result = output - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListAgentKnowledgeBasesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAgentKnowledgeBases(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisassociateAgentKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3817,6 +4025,9 @@ func awsRestjson1_deserializeOpErrorListAgentKnowledgeBases(response *smithyhttp case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3839,59 +4050,14 @@ func awsRestjson1_deserializeOpErrorListAgentKnowledgeBases(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListAgentKnowledgeBasesOutput(v **ListAgentKnowledgeBasesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListAgentKnowledgeBasesOutput - if *v == nil { - sv = &ListAgentKnowledgeBasesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "agentKnowledgeBaseSummaries": - if err := awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummaries(&sv.AgentKnowledgeBaseSummaries, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListAgents struct { +type awsRestjson1_deserializeOpGetAgent struct { } -func (*awsRestjson1_deserializeOpListAgents) ID() string { +func (*awsRestjson1_deserializeOpGetAgent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAgents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAgent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3905,9 +4071,9 @@ func (m *awsRestjson1_deserializeOpListAgents) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAgents(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAgent(response, &metadata) } - output := &ListAgentsOutput{} + output := &GetAgentOutput{} out.Result = output var buff [1024]byte @@ -3928,7 +4094,7 @@ func (m *awsRestjson1_deserializeOpListAgents) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAgentsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAgentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3941,7 +4107,7 @@ func (m *awsRestjson1_deserializeOpListAgents) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAgents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAgent(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3988,6 +4154,9 @@ func awsRestjson1_deserializeOpErrorListAgents(response *smithyhttp.Response, me case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -4004,7 +4173,7 @@ func awsRestjson1_deserializeOpErrorListAgents(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListAgentsOutput(v **ListAgentsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAgentOutput(v **GetAgentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4017,29 +4186,20 @@ func awsRestjson1_deserializeOpDocumentListAgentsOutput(v **ListAgentsOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAgentsOutput + var sv *GetAgentOutput if *v == nil { - sv = &ListAgentsOutput{} + sv = &GetAgentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentSummaries": - if err := awsRestjson1_deserializeDocumentAgentSummaries(&sv.AgentSummaries, value); err != nil { + case "agent": + if err := awsRestjson1_deserializeDocumentAgent(&sv.Agent, value); err != nil { return err } - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -4049,14 +4209,14 @@ func awsRestjson1_deserializeOpDocumentListAgentsOutput(v **ListAgentsOutput, va return nil } -type awsRestjson1_deserializeOpListAgentVersions struct { +type awsRestjson1_deserializeOpGetAgentActionGroup struct { } -func (*awsRestjson1_deserializeOpListAgentVersions) ID() string { +func (*awsRestjson1_deserializeOpGetAgentActionGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAgentVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAgentActionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4070,9 +4230,9 @@ func (m *awsRestjson1_deserializeOpListAgentVersions) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAgentVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAgentActionGroup(response, &metadata) } - output := &ListAgentVersionsOutput{} + output := &GetAgentActionGroupOutput{} out.Result = output var buff [1024]byte @@ -4093,7 +4253,7 @@ func (m *awsRestjson1_deserializeOpListAgentVersions) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAgentVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAgentActionGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4106,7 +4266,7 @@ func (m *awsRestjson1_deserializeOpListAgentVersions) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAgentVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAgentActionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4172,7 +4332,7 @@ func awsRestjson1_deserializeOpErrorListAgentVersions(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListAgentVersionsOutput(v **ListAgentVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAgentActionGroupOutput(v **GetAgentActionGroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4185,29 +4345,20 @@ func awsRestjson1_deserializeOpDocumentListAgentVersionsOutput(v **ListAgentVers return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAgentVersionsOutput + var sv *GetAgentActionGroupOutput if *v == nil { - sv = &ListAgentVersionsOutput{} + sv = &GetAgentActionGroupOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentVersionSummaries": - if err := awsRestjson1_deserializeDocumentAgentVersionSummaries(&sv.AgentVersionSummaries, value); err != nil { + case "agentActionGroup": + if err := awsRestjson1_deserializeDocumentAgentActionGroup(&sv.AgentActionGroup, value); err != nil { return err } - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -4217,14 +4368,14 @@ func awsRestjson1_deserializeOpDocumentListAgentVersionsOutput(v **ListAgentVers return nil } -type awsRestjson1_deserializeOpListDataSources struct { +type awsRestjson1_deserializeOpGetAgentAlias struct { } -func (*awsRestjson1_deserializeOpListDataSources) ID() string { +func (*awsRestjson1_deserializeOpGetAgentAlias) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDataSources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAgentAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4238,9 +4389,9 @@ func (m *awsRestjson1_deserializeOpListDataSources) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDataSources(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAgentAlias(response, &metadata) } - output := &ListDataSourcesOutput{} + output := &GetAgentAliasOutput{} out.Result = output var buff [1024]byte @@ -4261,7 +4412,7 @@ func (m *awsRestjson1_deserializeOpListDataSources) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDataSourcesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAgentAliasOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4274,7 +4425,7 @@ func (m *awsRestjson1_deserializeOpListDataSources) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDataSources(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAgentAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4340,7 +4491,7 @@ func awsRestjson1_deserializeOpErrorListDataSources(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListDataSourcesOutput(v **ListDataSourcesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAgentAliasOutput(v **GetAgentAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4353,29 +4504,20 @@ func awsRestjson1_deserializeOpDocumentListDataSourcesOutput(v **ListDataSources return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDataSourcesOutput + var sv *GetAgentAliasOutput if *v == nil { - sv = &ListDataSourcesOutput{} + sv = &GetAgentAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "dataSourceSummaries": - if err := awsRestjson1_deserializeDocumentDataSourceSummaries(&sv.DataSourceSummaries, value); err != nil { + case "agentAlias": + if err := awsRestjson1_deserializeDocumentAgentAlias(&sv.AgentAlias, value); err != nil { return err } - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -4385,14 +4527,14 @@ func awsRestjson1_deserializeOpDocumentListDataSourcesOutput(v **ListDataSources return nil } -type awsRestjson1_deserializeOpListIngestionJobs struct { +type awsRestjson1_deserializeOpGetAgentKnowledgeBase struct { } -func (*awsRestjson1_deserializeOpListIngestionJobs) ID() string { +func (*awsRestjson1_deserializeOpGetAgentKnowledgeBase) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListIngestionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAgentKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4406,9 +4548,9 @@ func (m *awsRestjson1_deserializeOpListIngestionJobs) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListIngestionJobs(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAgentKnowledgeBase(response, &metadata) } - output := &ListIngestionJobsOutput{} + output := &GetAgentKnowledgeBaseOutput{} out.Result = output var buff [1024]byte @@ -4429,7 +4571,7 @@ func (m *awsRestjson1_deserializeOpListIngestionJobs) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListIngestionJobsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAgentKnowledgeBaseOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4442,7 +4584,7 @@ func (m *awsRestjson1_deserializeOpListIngestionJobs) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListIngestionJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAgentKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4508,7 +4650,7 @@ func awsRestjson1_deserializeOpErrorListIngestionJobs(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListIngestionJobsOutput(v **ListIngestionJobsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAgentKnowledgeBaseOutput(v **GetAgentKnowledgeBaseOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4521,29 +4663,20 @@ func awsRestjson1_deserializeOpDocumentListIngestionJobsOutput(v **ListIngestion return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListIngestionJobsOutput + var sv *GetAgentKnowledgeBaseOutput if *v == nil { - sv = &ListIngestionJobsOutput{} + sv = &GetAgentKnowledgeBaseOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ingestionJobSummaries": - if err := awsRestjson1_deserializeDocumentIngestionJobSummaries(&sv.IngestionJobSummaries, value); err != nil { + case "agentKnowledgeBase": + if err := awsRestjson1_deserializeDocumentAgentKnowledgeBase(&sv.AgentKnowledgeBase, value); err != nil { return err } - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -4553,14 +4686,14 @@ func awsRestjson1_deserializeOpDocumentListIngestionJobsOutput(v **ListIngestion return nil } -type awsRestjson1_deserializeOpListKnowledgeBases struct { +type awsRestjson1_deserializeOpGetAgentVersion struct { } -func (*awsRestjson1_deserializeOpListKnowledgeBases) ID() string { +func (*awsRestjson1_deserializeOpGetAgentVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAgentVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4574,9 +4707,9 @@ func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListKnowledgeBases(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAgentVersion(response, &metadata) } - output := &ListKnowledgeBasesOutput{} + output := &GetAgentVersionOutput{} out.Result = output var buff [1024]byte @@ -4597,7 +4730,7 @@ func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAgentVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4610,7 +4743,7 @@ func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListKnowledgeBases(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAgentVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4657,6 +4790,9 @@ func awsRestjson1_deserializeOpErrorListKnowledgeBases(response *smithyhttp.Resp case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -4673,7 +4809,7 @@ func awsRestjson1_deserializeOpErrorListKnowledgeBases(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledgeBasesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAgentVersionOutput(v **GetAgentVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4686,29 +4822,20 @@ func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledg return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListKnowledgeBasesOutput + var sv *GetAgentVersionOutput if *v == nil { - sv = &ListKnowledgeBasesOutput{} + sv = &GetAgentVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBaseSummaries": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseSummaries(&sv.KnowledgeBaseSummaries, value); err != nil { + case "agentVersion": + if err := awsRestjson1_deserializeDocumentAgentVersion(&sv.AgentVersion, value); err != nil { return err } - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -4718,14 +4845,14 @@ func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledg return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpGetDataSource struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpGetDataSource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4739,9 +4866,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetDataSource(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &GetDataSourceOutput{} out.Result = output var buff [1024]byte @@ -4762,7 +4889,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetDataSourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4775,7 +4902,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4841,7 +4968,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4854,17 +4981,17 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *GetDataSourceOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &GetDataSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { + case "dataSource": + if err := awsRestjson1_deserializeDocumentDataSource(&sv.DataSource, value); err != nil { return err } @@ -4877,14 +5004,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpPrepareAgent struct { +type awsRestjson1_deserializeOpGetFlow struct { } -func (*awsRestjson1_deserializeOpPrepareAgent) ID() string { +func (*awsRestjson1_deserializeOpGetFlow) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPrepareAgent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetFlow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4898,9 +5025,9 @@ func (m *awsRestjson1_deserializeOpPrepareAgent) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPrepareAgent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetFlow(response, &metadata) } - output := &PrepareAgentOutput{} + output := &GetFlowOutput{} out.Result = output var buff [1024]byte @@ -4921,7 +5048,7 @@ func (m *awsRestjson1_deserializeOpPrepareAgent) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPrepareAgentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetFlowOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4934,7 +5061,7 @@ func (m *awsRestjson1_deserializeOpPrepareAgent) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorPrepareAgent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetFlow(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4978,18 +5105,12 @@ func awsRestjson1_deserializeOpErrorPrepareAgent(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5006,7 +5127,7 @@ func awsRestjson1_deserializeOpErrorPrepareAgent(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentPrepareAgentOutput(v **PrepareAgentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetFlowOutput(v **GetFlowOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5019,43 +5140,97 @@ func awsRestjson1_deserializeOpDocumentPrepareAgentOutput(v **PrepareAgentOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PrepareAgentOutput + var sv *GetFlowOutput if *v == nil { - sv = &PrepareAgentOutput{} + sv = &GetFlowOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentId": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected FlowArn to be of type string, got %T instead", value) } - sv.AgentId = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "agentStatus": + case "createdAt": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) } - sv.AgentStatus = types.AgentStatus(jtv) + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) } - case "agentVersion": + case "customerEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Version to be of type string, got %T instead", value) + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) } - sv.AgentVersion = ptr.String(jtv) + sv.CustomerEncryptionKeyArn = ptr.String(jtv) } - case "preparedAt": + case "definition": + if err := awsRestjson1_deserializeDocumentFlowDefinition(&sv.Definition, value); err != nil { + return err + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "executionRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowExecutionRoleArn to be of type string, got %T instead", value) + } + sv.ExecutionRoleArn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowStatus to be of type string, got %T instead", value) + } + sv.Status = types.FlowStatus(jtv) + } + + case "updatedAt": if value != nil { jtv, ok := value.(string) if !ok { @@ -5065,7 +5240,21 @@ func awsRestjson1_deserializeOpDocumentPrepareAgentOutput(v **PrepareAgentOutput if err != nil { return err } - sv.PreparedAt = ptr.Time(t) + sv.UpdatedAt = ptr.Time(t) + } + + case "validations": + if err := awsRestjson1_deserializeDocumentFlowValidations(&sv.Validations, value); err != nil { + return err + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DraftVersion to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) } default: @@ -5077,14 +5266,14 @@ func awsRestjson1_deserializeOpDocumentPrepareAgentOutput(v **PrepareAgentOutput return nil } -type awsRestjson1_deserializeOpStartIngestionJob struct { +type awsRestjson1_deserializeOpGetFlowAlias struct { } -func (*awsRestjson1_deserializeOpStartIngestionJob) ID() string { +func (*awsRestjson1_deserializeOpGetFlowAlias) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartIngestionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetFlowAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5098,9 +5287,9 @@ func (m *awsRestjson1_deserializeOpStartIngestionJob) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartIngestionJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetFlowAlias(response, &metadata) } - output := &StartIngestionJobOutput{} + output := &GetFlowAliasOutput{} out.Result = output var buff [1024]byte @@ -5121,7 +5310,7 @@ func (m *awsRestjson1_deserializeOpStartIngestionJob) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartIngestionJobOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetFlowAliasOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5134,7 +5323,7 @@ func (m *awsRestjson1_deserializeOpStartIngestionJob) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartIngestionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetFlowAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5178,18 +5367,12 @@ func awsRestjson1_deserializeOpErrorStartIngestionJob(response *smithyhttp.Respo case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5206,7 +5389,7 @@ func awsRestjson1_deserializeOpErrorStartIngestionJob(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentStartIngestionJobOutput(v **StartIngestionJobOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetFlowAliasOutput(v **GetFlowAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5219,20 +5402,91 @@ func awsRestjson1_deserializeOpDocumentStartIngestionJobOutput(v **StartIngestio return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartIngestionJobOutput + var sv *GetFlowAliasOutput if *v == nil { - sv = &StartIngestionJobOutput{} + sv = &GetFlowAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ingestionJob": - if err := awsRestjson1_deserializeDocumentIngestionJob(&sv.IngestionJob, value); err != nil { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowAliasArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "flowId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.FlowId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowAliasId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "routingConfiguration": + if err := awsRestjson1_deserializeDocumentFlowAliasRoutingConfiguration(&sv.RoutingConfiguration, value); err != nil { return err } + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + default: _, _ = key, value @@ -5242,14 +5496,14 @@ func awsRestjson1_deserializeOpDocumentStartIngestionJobOutput(v **StartIngestio return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpGetFlowVersion struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpGetFlowVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetFlowVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5263,15 +5517,43 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetFlowVersion(response, &metadata) } - output := &TagResourceOutput{} + output := &GetFlowVersionOutput{} out.Result = output + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetFlowVersionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetFlowVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5321,9 +5603,6 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5340,14 +5619,135 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +func awsRestjson1_deserializeOpDocumentGetFlowVersionOutput(v **GetFlowVersionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetFlowVersionOutput + if *v == nil { + sv = &GetFlowVersionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "customerEncryptionKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.CustomerEncryptionKeyArn = ptr.String(jtv) + } + + case "definition": + if err := awsRestjson1_deserializeDocumentFlowDefinition(&sv.Definition, value); err != nil { + return err + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "executionRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowExecutionRoleArn to be of type string, got %T instead", value) + } + sv.ExecutionRoleArn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowStatus to be of type string, got %T instead", value) + } + sv.Status = types.FlowStatus(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NumericalVersion to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpGetIngestionJob struct { +} + +func (*awsRestjson1_deserializeOpGetIngestionJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetIngestionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5361,15 +5761,43 @@ func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetIngestionJob(response, &metadata) } - output := &UntagResourceOutput{} + output := &GetIngestionJobOutput{} out.Result = output + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetIngestionJobOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetIngestionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5435,14 +5863,50 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateAgent struct { -} +func awsRestjson1_deserializeOpDocumentGetIngestionJobOutput(v **GetIngestionJobOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } -func (*awsRestjson1_deserializeOpUpdateAgent) ID() string { + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetIngestionJobOutput + if *v == nil { + sv = &GetIngestionJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ingestionJob": + if err := awsRestjson1_deserializeDocumentIngestionJob(&sv.IngestionJob, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetKnowledgeBase struct { +} + +func (*awsRestjson1_deserializeOpGetKnowledgeBase) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAgent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5456,9 +5920,9 @@ func (m *awsRestjson1_deserializeOpUpdateAgent) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAgent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetKnowledgeBase(response, &metadata) } - output := &UpdateAgentOutput{} + output := &GetKnowledgeBaseOutput{} out.Result = output var buff [1024]byte @@ -5479,7 +5943,7 @@ func (m *awsRestjson1_deserializeOpUpdateAgent) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateAgentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5492,7 +5956,7 @@ func (m *awsRestjson1_deserializeOpUpdateAgent) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAgent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5536,18 +6000,12 @@ func awsRestjson1_deserializeOpErrorUpdateAgent(response *smithyhttp.Response, m case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5564,7 +6022,7 @@ func awsRestjson1_deserializeOpErrorUpdateAgent(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentUpdateAgentOutput(v **UpdateAgentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(v **GetKnowledgeBaseOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5577,17 +6035,17 @@ func awsRestjson1_deserializeOpDocumentUpdateAgentOutput(v **UpdateAgentOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateAgentOutput + var sv *GetKnowledgeBaseOutput if *v == nil { - sv = &UpdateAgentOutput{} + sv = &GetKnowledgeBaseOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agent": - if err := awsRestjson1_deserializeDocumentAgent(&sv.Agent, value); err != nil { + case "knowledgeBase": + if err := awsRestjson1_deserializeDocumentKnowledgeBase(&sv.KnowledgeBase, value); err != nil { return err } @@ -5600,14 +6058,14 @@ func awsRestjson1_deserializeOpDocumentUpdateAgentOutput(v **UpdateAgentOutput, return nil } -type awsRestjson1_deserializeOpUpdateAgentActionGroup struct { +type awsRestjson1_deserializeOpGetPrompt struct { } -func (*awsRestjson1_deserializeOpUpdateAgentActionGroup) ID() string { +func (*awsRestjson1_deserializeOpGetPrompt) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAgentActionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetPrompt) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5621,9 +6079,9 @@ func (m *awsRestjson1_deserializeOpUpdateAgentActionGroup) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAgentActionGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetPrompt(response, &metadata) } - output := &UpdateAgentActionGroupOutput{} + output := &GetPromptOutput{} out.Result = output var buff [1024]byte @@ -5644,7 +6102,7 @@ func (m *awsRestjson1_deserializeOpUpdateAgentActionGroup) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateAgentActionGroupOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetPromptOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5657,7 +6115,7 @@ func (m *awsRestjson1_deserializeOpUpdateAgentActionGroup) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAgentActionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetPrompt(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5701,18 +6159,12 @@ func awsRestjson1_deserializeOpErrorUpdateAgentActionGroup(response *smithyhttp. case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5729,7 +6181,7 @@ func awsRestjson1_deserializeOpErrorUpdateAgentActionGroup(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentUpdateAgentActionGroupOutput(v **UpdateAgentActionGroupOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPromptOutput(v **GetPromptOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5742,20 +6194,109 @@ func awsRestjson1_deserializeOpDocumentUpdateAgentActionGroupOutput(v **UpdateAg return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateAgentActionGroupOutput + var sv *GetPromptOutput if *v == nil { - sv = &UpdateAgentActionGroupOutput{} + sv = &GetPromptOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentActionGroup": - if err := awsRestjson1_deserializeDocumentAgentActionGroup(&sv.AgentActionGroup, value); err != nil { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "customerEncryptionKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.CustomerEncryptionKeyArn = ptr.String(jtv) + } + + case "defaultVariant": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptVariantName to be of type string, got %T instead", value) + } + sv.DefaultVariant = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + case "variants": + if err := awsRestjson1_deserializeDocumentPromptVariantList(&sv.Variants, value); err != nil { return err } + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + default: _, _ = key, value @@ -5765,14 +6306,14 @@ func awsRestjson1_deserializeOpDocumentUpdateAgentActionGroupOutput(v **UpdateAg return nil } -type awsRestjson1_deserializeOpUpdateAgentAlias struct { +type awsRestjson1_deserializeOpListAgentActionGroups struct { } -func (*awsRestjson1_deserializeOpUpdateAgentAlias) ID() string { +func (*awsRestjson1_deserializeOpListAgentActionGroups) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAgentAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAgentActionGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5786,9 +6327,9 @@ func (m *awsRestjson1_deserializeOpUpdateAgentAlias) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAgentAlias(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAgentActionGroups(response, &metadata) } - output := &UpdateAgentAliasOutput{} + output := &ListAgentActionGroupsOutput{} out.Result = output var buff [1024]byte @@ -5809,7 +6350,7 @@ func (m *awsRestjson1_deserializeOpUpdateAgentAlias) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateAgentAliasOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAgentActionGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5822,7 +6363,7 @@ func (m *awsRestjson1_deserializeOpUpdateAgentAlias) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAgentAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAgentActionGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5866,18 +6407,12 @@ func awsRestjson1_deserializeOpErrorUpdateAgentAlias(response *smithyhttp.Respon case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5894,7 +6429,7 @@ func awsRestjson1_deserializeOpErrorUpdateAgentAlias(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentUpdateAgentAliasOutput(v **UpdateAgentAliasOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAgentActionGroupsOutput(v **ListAgentActionGroupsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5907,20 +6442,29 @@ func awsRestjson1_deserializeOpDocumentUpdateAgentAliasOutput(v **UpdateAgentAli return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateAgentAliasOutput + var sv *ListAgentActionGroupsOutput if *v == nil { - sv = &UpdateAgentAliasOutput{} + sv = &ListAgentActionGroupsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentAlias": - if err := awsRestjson1_deserializeDocumentAgentAlias(&sv.AgentAlias, value); err != nil { + case "actionGroupSummaries": + if err := awsRestjson1_deserializeDocumentActionGroupSummaries(&sv.ActionGroupSummaries, value); err != nil { return err } + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -5930,14 +6474,14 @@ func awsRestjson1_deserializeOpDocumentUpdateAgentAliasOutput(v **UpdateAgentAli return nil } -type awsRestjson1_deserializeOpUpdateAgentKnowledgeBase struct { +type awsRestjson1_deserializeOpListAgentAliases struct { } -func (*awsRestjson1_deserializeOpUpdateAgentKnowledgeBase) ID() string { +func (*awsRestjson1_deserializeOpListAgentAliases) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAgentKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAgentAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5951,9 +6495,9 @@ func (m *awsRestjson1_deserializeOpUpdateAgentKnowledgeBase) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAgentKnowledgeBase(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAgentAliases(response, &metadata) } - output := &UpdateAgentKnowledgeBaseOutput{} + output := &ListAgentAliasesOutput{} out.Result = output var buff [1024]byte @@ -5974,7 +6518,7 @@ func (m *awsRestjson1_deserializeOpUpdateAgentKnowledgeBase) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateAgentKnowledgeBaseOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAgentAliasesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5987,7 +6531,7 @@ func (m *awsRestjson1_deserializeOpUpdateAgentKnowledgeBase) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAgentKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAgentAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6031,9 +6575,6 @@ func awsRestjson1_deserializeOpErrorUpdateAgentKnowledgeBase(response *smithyhtt case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -6056,7 +6597,7 @@ func awsRestjson1_deserializeOpErrorUpdateAgentKnowledgeBase(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentUpdateAgentKnowledgeBaseOutput(v **UpdateAgentKnowledgeBaseOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAgentAliasesOutput(v **ListAgentAliasesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6069,20 +6610,29 @@ func awsRestjson1_deserializeOpDocumentUpdateAgentKnowledgeBaseOutput(v **Update return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateAgentKnowledgeBaseOutput + var sv *ListAgentAliasesOutput if *v == nil { - sv = &UpdateAgentKnowledgeBaseOutput{} + sv = &ListAgentAliasesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "agentKnowledgeBase": - if err := awsRestjson1_deserializeDocumentAgentKnowledgeBase(&sv.AgentKnowledgeBase, value); err != nil { + case "agentAliasSummaries": + if err := awsRestjson1_deserializeDocumentAgentAliasSummaries(&sv.AgentAliasSummaries, value); err != nil { return err } + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -6092,14 +6642,14 @@ func awsRestjson1_deserializeOpDocumentUpdateAgentKnowledgeBaseOutput(v **Update return nil } -type awsRestjson1_deserializeOpUpdateDataSource struct { +type awsRestjson1_deserializeOpListAgentKnowledgeBases struct { } -func (*awsRestjson1_deserializeOpUpdateDataSource) ID() string { +func (*awsRestjson1_deserializeOpListAgentKnowledgeBases) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAgentKnowledgeBases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6113,9 +6663,9 @@ func (m *awsRestjson1_deserializeOpUpdateDataSource) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataSource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAgentKnowledgeBases(response, &metadata) } - output := &UpdateDataSourceOutput{} + output := &ListAgentKnowledgeBasesOutput{} out.Result = output var buff [1024]byte @@ -6136,7 +6686,7 @@ func (m *awsRestjson1_deserializeOpUpdateDataSource) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateDataSourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAgentKnowledgeBasesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6149,7 +6699,7 @@ func (m *awsRestjson1_deserializeOpUpdateDataSource) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAgentKnowledgeBases(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6193,9 +6743,6 @@ func awsRestjson1_deserializeOpErrorUpdateDataSource(response *smithyhttp.Respon case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -6218,7 +6765,7 @@ func awsRestjson1_deserializeOpErrorUpdateDataSource(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentUpdateDataSourceOutput(v **UpdateDataSourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAgentKnowledgeBasesOutput(v **ListAgentKnowledgeBasesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6231,20 +6778,29 @@ func awsRestjson1_deserializeOpDocumentUpdateDataSourceOutput(v **UpdateDataSour return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateDataSourceOutput + var sv *ListAgentKnowledgeBasesOutput if *v == nil { - sv = &UpdateDataSourceOutput{} + sv = &ListAgentKnowledgeBasesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "dataSource": - if err := awsRestjson1_deserializeDocumentDataSource(&sv.DataSource, value); err != nil { + case "agentKnowledgeBaseSummaries": + if err := awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummaries(&sv.AgentKnowledgeBaseSummaries, value); err != nil { return err } + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -6254,14 +6810,14 @@ func awsRestjson1_deserializeOpDocumentUpdateDataSourceOutput(v **UpdateDataSour return nil } -type awsRestjson1_deserializeOpUpdateKnowledgeBase struct { +type awsRestjson1_deserializeOpListAgents struct { } -func (*awsRestjson1_deserializeOpUpdateKnowledgeBase) ID() string { +func (*awsRestjson1_deserializeOpListAgents) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAgents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6275,9 +6831,9 @@ func (m *awsRestjson1_deserializeOpUpdateKnowledgeBase) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateKnowledgeBase(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAgents(response, &metadata) } - output := &UpdateKnowledgeBaseOutput{} + output := &ListAgentsOutput{} out.Result = output var buff [1024]byte @@ -6298,7 +6854,7 @@ func (m *awsRestjson1_deserializeOpUpdateKnowledgeBase) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAgentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6311,7 +6867,7 @@ func (m *awsRestjson1_deserializeOpUpdateKnowledgeBase) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAgents(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6355,15 +6911,9 @@ func awsRestjson1_deserializeOpErrorUpdateKnowledgeBase(response *smithyhttp.Res case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -6380,7 +6930,7 @@ func awsRestjson1_deserializeOpErrorUpdateKnowledgeBase(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseOutput(v **UpdateKnowledgeBaseOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAgentsOutput(v **ListAgentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6393,20 +6943,29 @@ func awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseOutput(v **UpdateKnowl return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateKnowledgeBaseOutput + var sv *ListAgentsOutput if *v == nil { - sv = &UpdateKnowledgeBaseOutput{} + sv = &ListAgentsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBase": - if err := awsRestjson1_deserializeDocumentKnowledgeBase(&sv.KnowledgeBase, value); err != nil { + case "agentSummaries": + if err := awsRestjson1_deserializeDocumentAgentSummaries(&sv.AgentSummaries, value); err != nil { return err } + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -6416,12 +6975,37 @@ func awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseOutput(v **UpdateKnowl return nil } -func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AccessDeniedException{} +type awsRestjson1_deserializeOpListAgentVersions struct { +} + +func (*awsRestjson1_deserializeOpListAgentVersions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAgentVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListAgentVersions(response, &metadata) + } + output := &ListAgentVersionsOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -6432,36 +7016,45 @@ func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Res Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentListAgentVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictException{} +func awsRestjson1_deserializeOpErrorListAgentVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -6471,65 +7064,116 @@ func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Respons return err } - err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +func awsRestjson1_deserializeOpDocumentListAgentVersionsOutput(v **ListAgentVersionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - return output -} + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } -func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalServerException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + var sv *ListAgentVersionsOutput + if *v == nil { + sv = &ListAgentVersionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentVersionSummaries": + if err := awsRestjson1_deserializeDocumentAgentVersionSummaries(&sv.AgentVersionSummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), } - return err } + *v = sv + return nil +} - err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) +type awsRestjson1_deserializeOpListDataSources struct { +} + +func (*awsRestjson1_deserializeOpListDataSources) ID() string { + return "OperationDeserializer" +} +func (m *awsRestjson1_deserializeOpListDataSources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListDataSources(response, &metadata) + } + output := &ListDataSourcesOutput{} + out.Result = output -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -6540,36 +7184,45 @@ func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentListDataSourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceQuotaExceededException{} +func awsRestjson1_deserializeOpErrorListDataSources(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -6579,29 +7232,116 @@ func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithy return err } - err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +func awsRestjson1_deserializeOpDocumentListDataSourcesOutput(v **ListDataSourcesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - return output + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDataSourcesOutput + if *v == nil { + sv = &ListDataSourcesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dataSourceSummaries": + if err := awsRestjson1_deserializeDocumentDataSourceSummaries(&sv.DataSourceSummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ThrottlingException{} +type awsRestjson1_deserializeOpListFlowAliases struct { +} + +func (*awsRestjson1_deserializeOpListFlowAliases) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListFlowAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListFlowAliases(response, &metadata) + } + output := &ListFlowAliasesOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -6612,47 +7352,44 @@ func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Respo Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentListFlowAliasesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ValidationException{} +func awsRestjson1_deserializeOpErrorListFlowAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentValidationException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6664,11 +7401,40 @@ func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - return output + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListFlowAliasesOutput(v **ListFlowAliasesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6681,22 +7447,27 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *ListFlowAliasesOutput if *v == nil { - sv = &types.AccessDeniedException{} + sv = &ListFlowAliasesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "flowAliasSummaries": + if err := awsRestjson1_deserializeDocumentFlowAliasSummaries(&sv.FlowAliasSummaries, value); err != nil { + return err + } + + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -6708,95 +7479,8253 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } -func awsRestjson1_deserializeDocumentActionGroupExecutor(v *types.ActionGroupExecutor, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil +type awsRestjson1_deserializeOpListFlows struct { +} + +func (*awsRestjson1_deserializeOpListFlows) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListFlows) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err } - shape, ok := value.(map[string]interface{}) + response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { - return fmt.Errorf("unexpected JSON type %v", value) + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } - var uv types.ActionGroupExecutor -loop: - for key, value := range shape { - if value == nil { - continue - } - switch key { - case "customControl": - var mv types.CustomControlMethod - if value != nil { + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListFlows(response, &metadata) + } + output := &ListFlowsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListFlowsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListFlows(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListFlowsOutput(v **ListFlowsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListFlowsOutput + if *v == nil { + sv = &ListFlowsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "flowSummaries": + if err := awsRestjson1_deserializeDocumentFlowSummaries(&sv.FlowSummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListFlowVersions struct { +} + +func (*awsRestjson1_deserializeOpListFlowVersions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListFlowVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListFlowVersions(response, &metadata) + } + output := &ListFlowVersionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListFlowVersionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListFlowVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListFlowVersionsOutput(v **ListFlowVersionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListFlowVersionsOutput + if *v == nil { + sv = &ListFlowVersionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "flowVersionSummaries": + if err := awsRestjson1_deserializeDocumentFlowVersionSummaries(&sv.FlowVersionSummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListIngestionJobs struct { +} + +func (*awsRestjson1_deserializeOpListIngestionJobs) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListIngestionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListIngestionJobs(response, &metadata) + } + output := &ListIngestionJobsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListIngestionJobsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListIngestionJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListIngestionJobsOutput(v **ListIngestionJobsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListIngestionJobsOutput + if *v == nil { + sv = &ListIngestionJobsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ingestionJobSummaries": + if err := awsRestjson1_deserializeDocumentIngestionJobSummaries(&sv.IngestionJobSummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListKnowledgeBases struct { +} + +func (*awsRestjson1_deserializeOpListKnowledgeBases) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListKnowledgeBases(response, &metadata) + } + output := &ListKnowledgeBasesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListKnowledgeBases(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledgeBasesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListKnowledgeBasesOutput + if *v == nil { + sv = &ListKnowledgeBasesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "knowledgeBaseSummaries": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseSummaries(&sv.KnowledgeBaseSummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListPrompts struct { +} + +func (*awsRestjson1_deserializeOpListPrompts) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListPrompts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListPrompts(response, &metadata) + } + output := &ListPromptsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListPromptsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListPrompts(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListPromptsOutput(v **ListPromptsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListPromptsOutput + if *v == nil { + sv = &ListPromptsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "promptSummaries": + if err := awsRestjson1_deserializeDocumentPromptSummaries(&sv.PromptSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPrepareAgent struct { +} + +func (*awsRestjson1_deserializeOpPrepareAgent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPrepareAgent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPrepareAgent(response, &metadata) + } + output := &PrepareAgentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentPrepareAgentOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPrepareAgent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPrepareAgentOutput(v **PrepareAgentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PrepareAgentOutput + if *v == nil { + sv = &PrepareAgentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) + } + + case "agentStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) + } + sv.AgentStatus = types.AgentStatus(jtv) + } + + case "agentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.AgentVersion = ptr.String(jtv) + } + + case "preparedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.PreparedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPrepareFlow struct { +} + +func (*awsRestjson1_deserializeOpPrepareFlow) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPrepareFlow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPrepareFlow(response, &metadata) + } + output := &PrepareFlowOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentPrepareFlowOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPrepareFlow(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPrepareFlowOutput(v **PrepareFlowOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PrepareFlowOutput + if *v == nil { + sv = &PrepareFlowOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowStatus to be of type string, got %T instead", value) + } + sv.Status = types.FlowStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartIngestionJob struct { +} + +func (*awsRestjson1_deserializeOpStartIngestionJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartIngestionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorStartIngestionJob(response, &metadata) + } + output := &StartIngestionJobOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentStartIngestionJobOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartIngestionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartIngestionJobOutput(v **StartIngestionJobOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartIngestionJobOutput + if *v == nil { + sv = &StartIngestionJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ingestionJob": + if err := awsRestjson1_deserializeDocumentIngestionJob(&sv.IngestionJob, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateAgent struct { +} + +func (*awsRestjson1_deserializeOpUpdateAgent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAgent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAgent(response, &metadata) + } + output := &UpdateAgentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdateAgentOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateAgent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateAgentOutput(v **UpdateAgentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateAgentOutput + if *v == nil { + sv = &UpdateAgentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agent": + if err := awsRestjson1_deserializeDocumentAgent(&sv.Agent, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateAgentActionGroup struct { +} + +func (*awsRestjson1_deserializeOpUpdateAgentActionGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAgentActionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAgentActionGroup(response, &metadata) + } + output := &UpdateAgentActionGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdateAgentActionGroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateAgentActionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateAgentActionGroupOutput(v **UpdateAgentActionGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateAgentActionGroupOutput + if *v == nil { + sv = &UpdateAgentActionGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentActionGroup": + if err := awsRestjson1_deserializeDocumentAgentActionGroup(&sv.AgentActionGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateAgentAlias struct { +} + +func (*awsRestjson1_deserializeOpUpdateAgentAlias) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAgentAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAgentAlias(response, &metadata) + } + output := &UpdateAgentAliasOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdateAgentAliasOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateAgentAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateAgentAliasOutput(v **UpdateAgentAliasOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateAgentAliasOutput + if *v == nil { + sv = &UpdateAgentAliasOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentAlias": + if err := awsRestjson1_deserializeDocumentAgentAlias(&sv.AgentAlias, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateAgentKnowledgeBase struct { +} + +func (*awsRestjson1_deserializeOpUpdateAgentKnowledgeBase) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAgentKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAgentKnowledgeBase(response, &metadata) + } + output := &UpdateAgentKnowledgeBaseOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdateAgentKnowledgeBaseOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateAgentKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateAgentKnowledgeBaseOutput(v **UpdateAgentKnowledgeBaseOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateAgentKnowledgeBaseOutput + if *v == nil { + sv = &UpdateAgentKnowledgeBaseOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentKnowledgeBase": + if err := awsRestjson1_deserializeDocumentAgentKnowledgeBase(&sv.AgentKnowledgeBase, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateDataSource struct { +} + +func (*awsRestjson1_deserializeOpUpdateDataSource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataSource(response, &metadata) + } + output := &UpdateDataSourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdateDataSourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateDataSourceOutput(v **UpdateDataSourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateDataSourceOutput + if *v == nil { + sv = &UpdateDataSourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dataSource": + if err := awsRestjson1_deserializeDocumentDataSource(&sv.DataSource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateFlow struct { +} + +func (*awsRestjson1_deserializeOpUpdateFlow) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateFlow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateFlow(response, &metadata) + } + output := &UpdateFlowOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdateFlowOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateFlow(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateFlowOutput(v **UpdateFlowOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateFlowOutput + if *v == nil { + sv = &UpdateFlowOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "customerEncryptionKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.CustomerEncryptionKeyArn = ptr.String(jtv) + } + + case "definition": + if err := awsRestjson1_deserializeDocumentFlowDefinition(&sv.Definition, value); err != nil { + return err + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "executionRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowExecutionRoleArn to be of type string, got %T instead", value) + } + sv.ExecutionRoleArn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowStatus to be of type string, got %T instead", value) + } + sv.Status = types.FlowStatus(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DraftVersion to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateFlowAlias struct { +} + +func (*awsRestjson1_deserializeOpUpdateFlowAlias) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateFlowAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateFlowAlias(response, &metadata) + } + output := &UpdateFlowAliasOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdateFlowAliasOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateFlowAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateFlowAliasOutput(v **UpdateFlowAliasOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateFlowAliasOutput + if *v == nil { + sv = &UpdateFlowAliasOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowAliasArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "flowId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.FlowId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowAliasId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "routingConfiguration": + if err := awsRestjson1_deserializeDocumentFlowAliasRoutingConfiguration(&sv.RoutingConfiguration, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateKnowledgeBase struct { +} + +func (*awsRestjson1_deserializeOpUpdateKnowledgeBase) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateKnowledgeBase(response, &metadata) + } + output := &UpdateKnowledgeBaseOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseOutput(v **UpdateKnowledgeBaseOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateKnowledgeBaseOutput + if *v == nil { + sv = &UpdateKnowledgeBaseOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "knowledgeBase": + if err := awsRestjson1_deserializeDocumentKnowledgeBase(&sv.KnowledgeBase, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdatePrompt struct { +} + +func (*awsRestjson1_deserializeOpUpdatePrompt) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdatePrompt) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdatePrompt(response, &metadata) + } + output := &UpdatePromptOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdatePromptOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdatePrompt(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdatePromptOutput(v **UpdatePromptOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdatePromptOutput + if *v == nil { + sv = &UpdatePromptOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "customerEncryptionKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.CustomerEncryptionKeyArn = ptr.String(jtv) + } + + case "defaultVariant": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptVariantName to be of type string, got %T instead", value) + } + sv.DefaultVariant = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + case "variants": + if err := awsRestjson1_deserializeDocumentPromptVariantList(&sv.Variants, value); err != nil { + return err + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentActionGroupExecutor(v *types.ActionGroupExecutor, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.ActionGroupExecutor +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "customControl": + var mv types.CustomControlMethod + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomControlMethod to be of type string, got %T instead", value) + } + mv = types.CustomControlMethod(jtv) + } + uv = &types.ActionGroupExecutorMemberCustomControl{Value: mv} + break loop + + case "lambda": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LambdaArn to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.ActionGroupExecutorMemberLambda{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentActionGroupSummaries(v *[]types.ActionGroupSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ActionGroupSummary + if *v == nil { + cv = []types.ActionGroupSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ActionGroupSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentActionGroupSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentActionGroupSummary(v **types.ActionGroupSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ActionGroupSummary + if *v == nil { + sv = &types.ActionGroupSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actionGroupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.ActionGroupId = ptr.String(jtv) + } + + case "actionGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.ActionGroupName = ptr.String(jtv) + } + + case "actionGroupState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActionGroupState to be of type string, got %T instead", value) + } + sv.ActionGroupState = types.ActionGroupState(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgent(v **types.Agent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Agent + if *v == nil { + sv = &types.Agent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentArn to be of type string, got %T instead", value) + } + sv.AgentArn = ptr.String(jtv) + } + + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) + } + + case "agentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.AgentName = ptr.String(jtv) + } + + case "agentResourceRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentRoleArn to be of type string, got %T instead", value) + } + sv.AgentResourceRoleArn = ptr.String(jtv) + } + + case "agentStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) + } + sv.AgentStatus = types.AgentStatus(jtv) + } + + case "agentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DraftVersion to be of type string, got %T instead", value) + } + sv.AgentVersion = ptr.String(jtv) + } + + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "customerEncryptionKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.CustomerEncryptionKeyArn = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "failureReasons": + if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { + return err + } + + case "foundationModel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelIdentifier to be of type string, got %T instead", value) + } + sv.FoundationModel = ptr.String(jtv) + } + + case "guardrailConfiguration": + if err := awsRestjson1_deserializeDocumentGuardrailConfiguration(&sv.GuardrailConfiguration, value); err != nil { + return err + } + + case "idleSessionTTLInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected SessionTTL to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.IdleSessionTTLInSeconds = ptr.Int32(int32(i64)) + } + + case "instruction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Instruction to be of type string, got %T instead", value) + } + sv.Instruction = ptr.String(jtv) + } + + case "memoryConfiguration": + if err := awsRestjson1_deserializeDocumentMemoryConfiguration(&sv.MemoryConfiguration, value); err != nil { + return err + } + + case "preparedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.PreparedAt = ptr.Time(t) + } + + case "promptOverrideConfiguration": + if err := awsRestjson1_deserializeDocumentPromptOverrideConfiguration(&sv.PromptOverrideConfiguration, value); err != nil { + return err + } + + case "recommendedActions": + if err := awsRestjson1_deserializeDocumentRecommendedActions(&sv.RecommendedActions, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentActionGroup(v **types.AgentActionGroup, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentActionGroup + if *v == nil { + sv = &types.AgentActionGroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actionGroupExecutor": + if err := awsRestjson1_deserializeDocumentActionGroupExecutor(&sv.ActionGroupExecutor, value); err != nil { + return err + } + + case "actionGroupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.ActionGroupId = ptr.String(jtv) + } + + case "actionGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.ActionGroupName = ptr.String(jtv) + } + + case "actionGroupState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActionGroupState to be of type string, got %T instead", value) + } + sv.ActionGroupState = types.ActionGroupState(jtv) + } + + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) + } + + case "agentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.AgentVersion = ptr.String(jtv) + } + + case "apiSchema": + if err := awsRestjson1_deserializeDocumentAPISchema(&sv.ApiSchema, value); err != nil { + return err + } + + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "functionSchema": + if err := awsRestjson1_deserializeDocumentFunctionSchema(&sv.FunctionSchema, value); err != nil { + return err + } + + case "parentActionSignature": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActionGroupSignature to be of type string, got %T instead", value) + } + sv.ParentActionSignature = types.ActionGroupSignature(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentAlias(v **types.AgentAlias, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentAlias + if *v == nil { + sv = &types.AgentAlias{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentAliasArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentAliasArn to be of type string, got %T instead", value) + } + sv.AgentAliasArn = ptr.String(jtv) + } + + case "agentAliasHistoryEvents": + if err := awsRestjson1_deserializeDocumentAgentAliasHistoryEvents(&sv.AgentAliasHistoryEvents, value); err != nil { + return err + } + + case "agentAliasId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentAliasId to be of type string, got %T instead", value) + } + sv.AgentAliasId = ptr.String(jtv) + } + + case "agentAliasName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.AgentAliasName = ptr.String(jtv) + } + + case "agentAliasStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentAliasStatus to be of type string, got %T instead", value) + } + sv.AgentAliasStatus = types.AgentAliasStatus(jtv) + } + + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) + } + + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "failureReasons": + if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { + return err + } + + case "routingConfiguration": + if err := awsRestjson1_deserializeDocumentAgentAliasRoutingConfiguration(&sv.RoutingConfiguration, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentAliasHistoryEvent(v **types.AgentAliasHistoryEvent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentAliasHistoryEvent + if *v == nil { + sv = &types.AgentAliasHistoryEvent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.EndDate = ptr.Time(t) + } + + case "routingConfiguration": + if err := awsRestjson1_deserializeDocumentAgentAliasRoutingConfiguration(&sv.RoutingConfiguration, value); err != nil { + return err + } + + case "startDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.StartDate = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentAliasHistoryEvents(v *[]types.AgentAliasHistoryEvent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AgentAliasHistoryEvent + if *v == nil { + cv = []types.AgentAliasHistoryEvent{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AgentAliasHistoryEvent + destAddr := &col + if err := awsRestjson1_deserializeDocumentAgentAliasHistoryEvent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAgentAliasRoutingConfiguration(v *[]types.AgentAliasRoutingConfigurationListItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AgentAliasRoutingConfigurationListItem + if *v == nil { + cv = []types.AgentAliasRoutingConfigurationListItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AgentAliasRoutingConfigurationListItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentAgentAliasRoutingConfigurationListItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAgentAliasRoutingConfigurationListItem(v **types.AgentAliasRoutingConfigurationListItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentAliasRoutingConfigurationListItem + if *v == nil { + sv = &types.AgentAliasRoutingConfigurationListItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.AgentVersion = ptr.String(jtv) + } + + case "provisionedThroughput": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProvisionedModelIdentifier to be of type string, got %T instead", value) + } + sv.ProvisionedThroughput = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentAliasSummaries(v *[]types.AgentAliasSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AgentAliasSummary + if *v == nil { + cv = []types.AgentAliasSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AgentAliasSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAgentAliasSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAgentAliasSummary(v **types.AgentAliasSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentAliasSummary + if *v == nil { + sv = &types.AgentAliasSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentAliasId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentAliasId to be of type string, got %T instead", value) + } + sv.AgentAliasId = ptr.String(jtv) + } + + case "agentAliasName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.AgentAliasName = ptr.String(jtv) + } + + case "agentAliasStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentAliasStatus to be of type string, got %T instead", value) + } + sv.AgentAliasStatus = types.AgentAliasStatus(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "routingConfiguration": + if err := awsRestjson1_deserializeDocumentAgentAliasRoutingConfiguration(&sv.RoutingConfiguration, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentFlowNodeConfiguration(v **types.AgentFlowNodeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentFlowNodeConfiguration + if *v == nil { + sv = &types.AgentFlowNodeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentAliasArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentAliasArn to be of type string, got %T instead", value) + } + sv.AgentAliasArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentKnowledgeBase(v **types.AgentKnowledgeBase, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentKnowledgeBase + if *v == nil { + sv = &types.AgentKnowledgeBase{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) + } + + case "agentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.AgentVersion = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "knowledgeBaseState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KnowledgeBaseState to be of type string, got %T instead", value) + } + sv.KnowledgeBaseState = types.KnowledgeBaseState(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummaries(v *[]types.AgentKnowledgeBaseSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AgentKnowledgeBaseSummary + if *v == nil { + cv = []types.AgentKnowledgeBaseSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AgentKnowledgeBaseSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummary(v **types.AgentKnowledgeBaseSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentKnowledgeBaseSummary + if *v == nil { + sv = &types.AgentKnowledgeBaseSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "knowledgeBaseState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KnowledgeBaseState to be of type string, got %T instead", value) + } + sv.KnowledgeBaseState = types.KnowledgeBaseState(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentSummaries(v *[]types.AgentSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AgentSummary + if *v == nil { + cv = []types.AgentSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AgentSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAgentSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAgentSummary(v **types.AgentSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentSummary + if *v == nil { + sv = &types.AgentSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) + } + + case "agentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.AgentName = ptr.String(jtv) + } + + case "agentStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) + } + sv.AgentStatus = types.AgentStatus(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "guardrailConfiguration": + if err := awsRestjson1_deserializeDocumentGuardrailConfiguration(&sv.GuardrailConfiguration, value); err != nil { + return err + } + + case "latestAgentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.LatestAgentVersion = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentVersion(v **types.AgentVersion, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentVersion + if *v == nil { + sv = &types.AgentVersion{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentArn to be of type string, got %T instead", value) + } + sv.AgentArn = ptr.String(jtv) + } + + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) + } + + case "agentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.AgentName = ptr.String(jtv) + } + + case "agentResourceRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentRoleArn to be of type string, got %T instead", value) + } + sv.AgentResourceRoleArn = ptr.String(jtv) + } + + case "agentStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) + } + sv.AgentStatus = types.AgentStatus(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "customerEncryptionKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.CustomerEncryptionKeyArn = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "failureReasons": + if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { + return err + } + + case "foundationModel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelIdentifier to be of type string, got %T instead", value) + } + sv.FoundationModel = ptr.String(jtv) + } + + case "guardrailConfiguration": + if err := awsRestjson1_deserializeDocumentGuardrailConfiguration(&sv.GuardrailConfiguration, value); err != nil { + return err + } + + case "idleSessionTTLInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected SessionTTL to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.IdleSessionTTLInSeconds = ptr.Int32(int32(i64)) + } + + case "instruction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Instruction to be of type string, got %T instead", value) + } + sv.Instruction = ptr.String(jtv) + } + + case "memoryConfiguration": + if err := awsRestjson1_deserializeDocumentMemoryConfiguration(&sv.MemoryConfiguration, value); err != nil { + return err + } + + case "promptOverrideConfiguration": + if err := awsRestjson1_deserializeDocumentPromptOverrideConfiguration(&sv.PromptOverrideConfiguration, value); err != nil { + return err + } + + case "recommendedActions": + if err := awsRestjson1_deserializeDocumentRecommendedActions(&sv.RecommendedActions, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NumericalVersion to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentVersionSummaries(v *[]types.AgentVersionSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AgentVersionSummary + if *v == nil { + cv = []types.AgentVersionSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AgentVersionSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAgentVersionSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAgentVersionSummary(v **types.AgentVersionSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentVersionSummary + if *v == nil { + sv = &types.AgentVersionSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.AgentName = ptr.String(jtv) + } + + case "agentStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) + } + sv.AgentStatus = types.AgentStatus(jtv) + } + + case "agentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.AgentVersion = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "guardrailConfiguration": + if err := awsRestjson1_deserializeDocumentGuardrailConfiguration(&sv.GuardrailConfiguration, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAPISchema(v *types.APISchema, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.APISchema +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "payload": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Payload to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.APISchemaMemberPayload{Value: mv} + break loop + + case "s3": + var mv types.S3Identifier + destAddr := &mv + if err := awsRestjson1_deserializeDocumentS3Identifier(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.APISchemaMemberS3{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentBedrockEmbeddingModelConfiguration(v **types.BedrockEmbeddingModelConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BedrockEmbeddingModelConfiguration + if *v == nil { + sv = &types.BedrockEmbeddingModelConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dimensions": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Dimensions to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Dimensions = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBedrockFoundationModelConfiguration(v **types.BedrockFoundationModelConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BedrockFoundationModelConfiguration + if *v == nil { + sv = &types.BedrockFoundationModelConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "modelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BedrockModelArn to be of type string, got %T instead", value) + } + sv.ModelArn = ptr.String(jtv) + } + + case "parsingPrompt": + if err := awsRestjson1_deserializeDocumentParsingPrompt(&sv.ParsingPrompt, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentChunkingConfiguration(v **types.ChunkingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ChunkingConfiguration + if *v == nil { + sv = &types.ChunkingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "chunkingStrategy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChunkingStrategy to be of type string, got %T instead", value) + } + sv.ChunkingStrategy = types.ChunkingStrategy(jtv) + } + + case "fixedSizeChunkingConfiguration": + if err := awsRestjson1_deserializeDocumentFixedSizeChunkingConfiguration(&sv.FixedSizeChunkingConfiguration, value); err != nil { + return err + } + + case "hierarchicalChunkingConfiguration": + if err := awsRestjson1_deserializeDocumentHierarchicalChunkingConfiguration(&sv.HierarchicalChunkingConfiguration, value); err != nil { + return err + } + + case "semanticChunkingConfiguration": + if err := awsRestjson1_deserializeDocumentSemanticChunkingConfiguration(&sv.SemanticChunkingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCollectorFlowNodeConfiguration(v **types.CollectorFlowNodeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CollectorFlowNodeConfiguration + if *v == nil { + sv = &types.CollectorFlowNodeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConditionFlowNodeConfiguration(v **types.ConditionFlowNodeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConditionFlowNodeConfiguration + if *v == nil { + sv = &types.ConditionFlowNodeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "conditions": + if err := awsRestjson1_deserializeDocumentFlowConditions(&sv.Conditions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConfluenceCrawlerConfiguration(v **types.ConfluenceCrawlerConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConfluenceCrawlerConfiguration + if *v == nil { + sv = &types.ConfluenceCrawlerConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "filterConfiguration": + if err := awsRestjson1_deserializeDocumentCrawlFilterConfiguration(&sv.FilterConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConfluenceDataSourceConfiguration(v **types.ConfluenceDataSourceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConfluenceDataSourceConfiguration + if *v == nil { + sv = &types.ConfluenceDataSourceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "crawlerConfiguration": + if err := awsRestjson1_deserializeDocumentConfluenceCrawlerConfiguration(&sv.CrawlerConfiguration, value); err != nil { + return err + } + + case "sourceConfiguration": + if err := awsRestjson1_deserializeDocumentConfluenceSourceConfiguration(&sv.SourceConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConfluenceSourceConfiguration(v **types.ConfluenceSourceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConfluenceSourceConfiguration + if *v == nil { + sv = &types.ConfluenceSourceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "authType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConfluenceAuthType to be of type string, got %T instead", value) + } + sv.AuthType = types.ConfluenceAuthType(jtv) + } + + case "credentialsSecretArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) + } + sv.CredentialsSecretArn = ptr.String(jtv) + } + + case "hostType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConfluenceHostType to be of type string, got %T instead", value) + } + sv.HostType = types.ConfluenceHostType(jtv) + } + + case "hostUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HttpsUrl to be of type string, got %T instead", value) + } + sv.HostUrl = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCrawlFilterConfiguration(v **types.CrawlFilterConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CrawlFilterConfiguration + if *v == nil { + sv = &types.CrawlFilterConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "patternObjectFilter": + if err := awsRestjson1_deserializeDocumentPatternObjectFilterConfiguration(&sv.PatternObjectFilter, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CrawlFilterConfigurationType to be of type string, got %T instead", value) + } + sv.Type = types.CrawlFilterConfigurationType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCustomTransformationConfiguration(v **types.CustomTransformationConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CustomTransformationConfiguration + if *v == nil { + sv = &types.CustomTransformationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "intermediateStorage": + if err := awsRestjson1_deserializeDocumentIntermediateStorage(&sv.IntermediateStorage, value); err != nil { + return err + } + + case "transformations": + if err := awsRestjson1_deserializeDocumentTransformations(&sv.Transformations, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDataSource(v **types.DataSource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DataSource + if *v == nil { + sv = &types.DataSource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "dataDeletionPolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataDeletionPolicy to be of type string, got %T instead", value) + } + sv.DataDeletionPolicy = types.DataDeletionPolicy(jtv) + } + + case "dataSourceConfiguration": + if err := awsRestjson1_deserializeDocumentDataSourceConfiguration(&sv.DataSourceConfiguration, value); err != nil { + return err + } + + case "dataSourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.DataSourceId = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "failureReasons": + if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { + return err + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "serverSideEncryptionConfiguration": + if err := awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataSourceStatus to be of type string, got %T instead", value) + } + sv.Status = types.DataSourceStatus(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + case "vectorIngestionConfiguration": + if err := awsRestjson1_deserializeDocumentVectorIngestionConfiguration(&sv.VectorIngestionConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDataSourceConfiguration(v **types.DataSourceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DataSourceConfiguration + if *v == nil { + sv = &types.DataSourceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "confluenceConfiguration": + if err := awsRestjson1_deserializeDocumentConfluenceDataSourceConfiguration(&sv.ConfluenceConfiguration, value); err != nil { + return err + } + + case "s3Configuration": + if err := awsRestjson1_deserializeDocumentS3DataSourceConfiguration(&sv.S3Configuration, value); err != nil { + return err + } + + case "salesforceConfiguration": + if err := awsRestjson1_deserializeDocumentSalesforceDataSourceConfiguration(&sv.SalesforceConfiguration, value); err != nil { + return err + } + + case "sharePointConfiguration": + if err := awsRestjson1_deserializeDocumentSharePointDataSourceConfiguration(&sv.SharePointConfiguration, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataSourceType to be of type string, got %T instead", value) + } + sv.Type = types.DataSourceType(jtv) + } + + case "webConfiguration": + if err := awsRestjson1_deserializeDocumentWebDataSourceConfiguration(&sv.WebConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDataSourceSummaries(v *[]types.DataSourceSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.DataSourceSummary + if *v == nil { + cv = []types.DataSourceSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DataSourceSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentDataSourceSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDataSourceSummary(v **types.DataSourceSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DataSourceSummary + if *v == nil { + sv = &types.DataSourceSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dataSourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.DataSourceId = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataSourceStatus to be of type string, got %T instead", value) + } + sv.Status = types.DataSourceStatus(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEmbeddingModelConfiguration(v **types.EmbeddingModelConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EmbeddingModelConfiguration + if *v == nil { + sv = &types.EmbeddingModelConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "bedrockEmbeddingModelConfiguration": + if err := awsRestjson1_deserializeDocumentBedrockEmbeddingModelConfiguration(&sv.BedrockEmbeddingModelConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEnabledMemoryTypes(v *[]types.MemoryType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.MemoryType + if *v == nil { + cv = []types.MemoryType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MemoryType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MemoryType to be of type string, got %T instead", value) + } + col = types.MemoryType(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFailureReasons(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFilterList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FilterPattern to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFixedSizeChunkingConfiguration(v **types.FixedSizeChunkingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FixedSizeChunkingConfiguration + if *v == nil { + sv = &types.FixedSizeChunkingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "maxTokens": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxTokens = ptr.Int32(int32(i64)) + } + + case "overlapPercentage": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.OverlapPercentage = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowAliasRoutingConfiguration(v *[]types.FlowAliasRoutingConfigurationListItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.FlowAliasRoutingConfigurationListItem + if *v == nil { + cv = []types.FlowAliasRoutingConfigurationListItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FlowAliasRoutingConfigurationListItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentFlowAliasRoutingConfigurationListItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFlowAliasRoutingConfigurationListItem(v **types.FlowAliasRoutingConfigurationListItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowAliasRoutingConfigurationListItem + if *v == nil { + sv = &types.FlowAliasRoutingConfigurationListItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "flowVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.FlowVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowAliasSummaries(v *[]types.FlowAliasSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.FlowAliasSummary + if *v == nil { + cv = []types.FlowAliasSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FlowAliasSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentFlowAliasSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFlowAliasSummary(v **types.FlowAliasSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowAliasSummary + if *v == nil { + sv = &types.FlowAliasSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowAliasArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "flowId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.FlowId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowAliasId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "routingConfiguration": + if err := awsRestjson1_deserializeDocumentFlowAliasRoutingConfiguration(&sv.RoutingConfiguration, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowCondition(v **types.FlowCondition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowCondition + if *v == nil { + sv = &types.FlowCondition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "expression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowConditionExpression to be of type string, got %T instead", value) + } + sv.Expression = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowConditionName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowConditionalConnectionConfiguration(v **types.FlowConditionalConnectionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowConditionalConnectionConfiguration + if *v == nil { + sv = &types.FlowConditionalConnectionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "condition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowConditionName to be of type string, got %T instead", value) + } + sv.Condition = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowConditions(v *[]types.FlowCondition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.FlowCondition + if *v == nil { + cv = []types.FlowCondition{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FlowCondition + destAddr := &col + if err := awsRestjson1_deserializeDocumentFlowCondition(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFlowConnection(v **types.FlowConnection, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowConnection + if *v == nil { + sv = &types.FlowConnection{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsRestjson1_deserializeDocumentFlowConnectionConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowConnectionName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowNodeName to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + case "target": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowNodeName to be of type string, got %T instead", value) + } + sv.Target = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowConnectionType to be of type string, got %T instead", value) + } + sv.Type = types.FlowConnectionType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowConnectionConfiguration(v *types.FlowConnectionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.FlowConnectionConfiguration +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "conditional": + var mv types.FlowConditionalConnectionConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentFlowConditionalConnectionConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowConnectionConfigurationMemberConditional{Value: mv} + break loop + + case "data": + var mv types.FlowDataConnectionConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentFlowDataConnectionConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowConnectionConfigurationMemberData{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentFlowConnections(v *[]types.FlowConnection, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.FlowConnection + if *v == nil { + cv = []types.FlowConnection{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FlowConnection + destAddr := &col + if err := awsRestjson1_deserializeDocumentFlowConnection(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFlowDataConnectionConfiguration(v **types.FlowDataConnectionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowDataConnectionConfiguration + if *v == nil { + sv = &types.FlowDataConnectionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "sourceOutput": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowNodeOutputName to be of type string, got %T instead", value) + } + sv.SourceOutput = ptr.String(jtv) + } + + case "targetInput": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowNodeInputName to be of type string, got %T instead", value) + } + sv.TargetInput = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowDefinition(v **types.FlowDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowDefinition + if *v == nil { + sv = &types.FlowDefinition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connections": + if err := awsRestjson1_deserializeDocumentFlowConnections(&sv.Connections, value); err != nil { + return err + } + + case "nodes": + if err := awsRestjson1_deserializeDocumentFlowNodes(&sv.Nodes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowNode(v **types.FlowNode, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowNode + if *v == nil { + sv = &types.FlowNode{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsRestjson1_deserializeDocumentFlowNodeConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "inputs": + if err := awsRestjson1_deserializeDocumentFlowNodeInputs(&sv.Inputs, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowNodeName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "outputs": + if err := awsRestjson1_deserializeDocumentFlowNodeOutputs(&sv.Outputs, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowNodeType to be of type string, got %T instead", value) + } + sv.Type = types.FlowNodeType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowNodeConfiguration(v *types.FlowNodeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.FlowNodeConfiguration +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "agent": + var mv types.AgentFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentAgentFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberAgent{Value: mv} + break loop + + case "collector": + var mv types.CollectorFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentCollectorFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberCollector{Value: mv} + break loop + + case "condition": + var mv types.ConditionFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentConditionFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberCondition{Value: mv} + break loop + + case "input": + var mv types.InputFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentInputFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberInput{Value: mv} + break loop + + case "iterator": + var mv types.IteratorFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentIteratorFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberIterator{Value: mv} + break loop + + case "knowledgeBase": + var mv types.KnowledgeBaseFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentKnowledgeBaseFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberKnowledgeBase{Value: mv} + break loop + + case "lambdaFunction": + var mv types.LambdaFunctionFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentLambdaFunctionFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberLambdaFunction{Value: mv} + break loop + + case "lex": + var mv types.LexFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentLexFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberLex{Value: mv} + break loop + + case "output": + var mv types.OutputFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentOutputFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberOutput{Value: mv} + break loop + + case "prompt": + var mv types.PromptFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentPromptFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberPrompt{Value: mv} + break loop + + case "retrieval": + var mv types.RetrievalFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentRetrievalFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberRetrieval{Value: mv} + break loop + + case "storage": + var mv types.StorageFlowNodeConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentStorageFlowNodeConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FlowNodeConfigurationMemberStorage{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentFlowNodeInput(v **types.FlowNodeInput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowNodeInput + if *v == nil { + sv = &types.FlowNodeInput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "expression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowNodeInputExpression to be of type string, got %T instead", value) + } + sv.Expression = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowNodeInputName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowNodeIODataType to be of type string, got %T instead", value) + } + sv.Type = types.FlowNodeIODataType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowNodeInputs(v *[]types.FlowNodeInput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.FlowNodeInput + if *v == nil { + cv = []types.FlowNodeInput{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FlowNodeInput + destAddr := &col + if err := awsRestjson1_deserializeDocumentFlowNodeInput(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFlowNodeOutput(v **types.FlowNodeOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowNodeOutput + if *v == nil { + sv = &types.FlowNodeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowNodeOutputName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowNodeIODataType to be of type string, got %T instead", value) + } + sv.Type = types.FlowNodeIODataType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowNodeOutputs(v *[]types.FlowNodeOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.FlowNodeOutput + if *v == nil { + cv = []types.FlowNodeOutput{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FlowNodeOutput + destAddr := &col + if err := awsRestjson1_deserializeDocumentFlowNodeOutput(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFlowNodes(v *[]types.FlowNode, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.FlowNode + if *v == nil { + cv = []types.FlowNode{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FlowNode + destAddr := &col + if err := awsRestjson1_deserializeDocumentFlowNode(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFlowSummaries(v *[]types.FlowSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.FlowSummary + if *v == nil { + cv = []types.FlowSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FlowSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentFlowSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFlowSummary(v **types.FlowSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowSummary + if *v == nil { + sv = &types.FlowSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowStatus to be of type string, got %T instead", value) + } + sv.Status = types.FlowStatus(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DraftVersion to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowValidation(v **types.FlowValidation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowValidation + if *v == nil { + sv = &types.FlowValidation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "severity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowValidationSeverity to be of type string, got %T instead", value) + } + sv.Severity = types.FlowValidationSeverity(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowValidations(v *[]types.FlowValidation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.FlowValidation + if *v == nil { + cv = []types.FlowValidation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FlowValidation + destAddr := &col + if err := awsRestjson1_deserializeDocumentFlowValidation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFlowVersionSummaries(v *[]types.FlowVersionSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.FlowVersionSummary + if *v == nil { + cv = []types.FlowVersionSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FlowVersionSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentFlowVersionSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFlowVersionSummary(v **types.FlowVersionSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlowVersionSummary + if *v == nil { + sv = &types.FlowVersionSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlowStatus to be of type string, got %T instead", value) + } + sv.Status = types.FlowStatus(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NumericalVersion to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFunction(v **types.Function, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Function + if *v == nil { + sv = &types.Function{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FunctionDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "parameters": + if err := awsRestjson1_deserializeDocumentParameterMap(&sv.Parameters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFunctions(v *[]types.Function, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Function + if *v == nil { + cv = []types.Function{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Function + destAddr := &col + if err := awsRestjson1_deserializeDocumentFunction(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFunctionSchema(v *types.FunctionSchema, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.FunctionSchema +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "functions": + var mv []types.Function + if err := awsRestjson1_deserializeDocumentFunctions(&mv, value); err != nil { + return err + } + uv = &types.FunctionSchemaMemberFunctions{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentGuardrailConfiguration(v **types.GuardrailConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GuardrailConfiguration + if *v == nil { + sv = &types.GuardrailConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "guardrailIdentifier": + if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CustomControlMethod to be of type string, got %T instead", value) + return fmt.Errorf("expected GuardrailIdentifier to be of type string, got %T instead", value) } - mv = types.CustomControlMethod(jtv) + sv.GuardrailIdentifier = ptr.String(jtv) } - uv = &types.ActionGroupExecutorMemberCustomControl{Value: mv} - break loop - case "lambda": - var mv string + case "guardrailVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LambdaArn to be of type string, got %T instead", value) + return fmt.Errorf("expected GuardrailVersion to be of type string, got %T instead", value) } - mv = jtv + sv.GuardrailVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentHierarchicalChunkingConfiguration(v **types.HierarchicalChunkingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.HierarchicalChunkingConfiguration + if *v == nil { + sv = &types.HierarchicalChunkingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "levelConfigurations": + if err := awsRestjson1_deserializeDocumentHierarchicalChunkingLevelConfigurations(&sv.LevelConfigurations, value); err != nil { + return err + } + + case "overlapTokens": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.OverlapTokens = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentHierarchicalChunkingLevelConfiguration(v **types.HierarchicalChunkingLevelConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.HierarchicalChunkingLevelConfiguration + if *v == nil { + sv = &types.HierarchicalChunkingLevelConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "maxTokens": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxTokens = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentHierarchicalChunkingLevelConfigurations(v *[]types.HierarchicalChunkingLevelConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.HierarchicalChunkingLevelConfiguration + if *v == nil { + cv = []types.HierarchicalChunkingLevelConfiguration{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.HierarchicalChunkingLevelConfiguration + destAddr := &col + if err := awsRestjson1_deserializeDocumentHierarchicalChunkingLevelConfiguration(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentInferenceConfiguration(v **types.InferenceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InferenceConfiguration + if *v == nil { + sv = &types.InferenceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "maximumLength": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumLength to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumLength = ptr.Int32(int32(i64)) + } + + case "stopSequences": + if err := awsRestjson1_deserializeDocumentStopSequences(&sv.StopSequences, value); err != nil { + return err + } + + case "temperature": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Temperature = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Temperature = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Temperature to be a JSON Number, got %T instead", value) + + } + } + + case "topK": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TopK to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TopK = ptr.Int32(int32(i64)) } - uv = &types.ActionGroupExecutorMemberLambda{Value: mv} - break loop - default: - uv = &types.UnknownUnionMember{Tag: key} - break loop + case "topP": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TopP = ptr.Float32(float32(f64)) - } - } - *v = uv - return nil -} + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() -func awsRestjson1_deserializeDocumentActionGroupSummaries(v *[]types.ActionGroupSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) - var cv []types.ActionGroupSummary - if *v == nil { - cv = []types.ActionGroupSummary{} - } else { - cv = *v - } + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) - for _, value := range shape { - var col types.ActionGroupSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentActionGroupSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + } + sv.TopP = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected TopP to be a JSON Number, got %T instead", value) + + } + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentActionGroupSummary(v **types.ActionGroupSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentIngestionJob(v **types.IngestionJob, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6809,49 +15738,81 @@ func awsRestjson1_deserializeDocumentActionGroupSummary(v **types.ActionGroupSum return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ActionGroupSummary + var sv *types.IngestionJob if *v == nil { - sv = &types.ActionGroupSummary{} + sv = &types.IngestionJob{} } else { sv = *v } for key, value := range shape { switch key { - case "actionGroupId": + case "dataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Id to be of type string, got %T instead", value) } - sv.ActionGroupId = ptr.String(jtv) + sv.DataSourceId = ptr.String(jtv) } - case "actionGroupName": + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.ActionGroupName = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "actionGroupState": + case "failureReasons": + if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { + return err + } + + case "ingestionJobId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ActionGroupState to be of type string, got %T instead", value) + return fmt.Errorf("expected Id to be of type string, got %T instead", value) } - sv.ActionGroupState = types.ActionGroupState(jtv) + sv.IngestionJobId = ptr.String(jtv) } - case "description": + case "knowledgeBaseId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected Id to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "startedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.StartedAt = ptr.Time(t) + } + + case "statistics": + if err := awsRestjson1_deserializeDocumentIngestionJobStatistics(&sv.Statistics, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IngestionJobStatus to be of type string, got %T instead", value) + } + sv.Status = types.IngestionJobStatus(jtv) } case "updatedAt": @@ -6876,7 +15837,7 @@ func awsRestjson1_deserializeDocumentActionGroupSummary(v **types.ActionGroupSum return nil } -func awsRestjson1_deserializeDocumentAgent(v **types.Agent, value interface{}) error { +func awsRestjson1_deserializeDocumentIngestionJobStatistics(v **types.IngestionJobStatistics, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6889,184 +15850,104 @@ func awsRestjson1_deserializeDocumentAgent(v **types.Agent, value interface{}) e return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Agent + var sv *types.IngestionJobStatistics if *v == nil { - sv = &types.Agent{} + sv = &types.IngestionJobStatistics{} } else { sv = *v } for key, value := range shape { switch key { - case "agentArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AgentArn to be of type string, got %T instead", value) - } - sv.AgentArn = ptr.String(jtv) - } - - case "agentId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.AgentId = ptr.String(jtv) - } - - case "agentName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.AgentName = ptr.String(jtv) - } - - case "agentResourceRoleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AgentRoleArn to be of type string, got %T instead", value) - } - sv.AgentResourceRoleArn = ptr.String(jtv) - } - - case "agentStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) - } - sv.AgentStatus = types.AgentStatus(jtv) - } - - case "agentVersion": + case "numberOfDocumentsDeleted": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected DraftVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) } - sv.AgentVersion = ptr.String(jtv) - } - - case "clientToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + i64, err := jtv.Int64() + if err != nil { + return err } - sv.ClientToken = ptr.String(jtv) + sv.NumberOfDocumentsDeleted = i64 } - case "createdAt": + case "numberOfDocumentsFailed": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) } - t, err := smithytime.ParseDateTime(jtv) + i64, err := jtv.Int64() if err != nil { return err } - sv.CreatedAt = ptr.Time(t) - } - - case "customerEncryptionKeyArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) - } - sv.CustomerEncryptionKeyArn = ptr.String(jtv) + sv.NumberOfDocumentsFailed = i64 } - case "description": + case "numberOfDocumentsScanned": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) } - sv.Description = ptr.String(jtv) - } - - case "failureReasons": - if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { - return err - } - - case "foundationModel": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ModelIdentifier to be of type string, got %T instead", value) + i64, err := jtv.Int64() + if err != nil { + return err } - sv.FoundationModel = ptr.String(jtv) - } - - case "guardrailConfiguration": - if err := awsRestjson1_deserializeDocumentGuardrailConfiguration(&sv.GuardrailConfiguration, value); err != nil { - return err + sv.NumberOfDocumentsScanned = i64 } - case "idleSessionTTLInSeconds": + case "numberOfMetadataDocumentsModified": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected SessionTTL to be json.Number, got %T instead", value) + return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.IdleSessionTTLInSeconds = ptr.Int32(int32(i64)) + sv.NumberOfMetadataDocumentsModified = i64 } - case "instruction": + case "numberOfMetadataDocumentsScanned": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Instruction to be of type string, got %T instead", value) + return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) } - sv.Instruction = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfMetadataDocumentsScanned = i64 } - case "preparedAt": + case "numberOfModifiedDocumentsIndexed": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) } - t, err := smithytime.ParseDateTime(jtv) + i64, err := jtv.Int64() if err != nil { return err } - sv.PreparedAt = ptr.Time(t) - } - - case "promptOverrideConfiguration": - if err := awsRestjson1_deserializeDocumentPromptOverrideConfiguration(&sv.PromptOverrideConfiguration, value); err != nil { - return err - } - - case "recommendedActions": - if err := awsRestjson1_deserializeDocumentRecommendedActions(&sv.RecommendedActions, value); err != nil { - return err + sv.NumberOfModifiedDocumentsIndexed = i64 } - case "updatedAt": + case "numberOfNewDocumentsIndexed": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) } - t, err := smithytime.ParseDateTime(jtv) + i64, err := jtv.Int64() if err != nil { return err } - sv.UpdatedAt = ptr.Time(t) + sv.NumberOfNewDocumentsIndexed = i64 } default: @@ -7078,7 +15959,41 @@ func awsRestjson1_deserializeDocumentAgent(v **types.Agent, value interface{}) e return nil } -func awsRestjson1_deserializeDocumentAgentActionGroup(v **types.AgentActionGroup, value interface{}) error { +func awsRestjson1_deserializeDocumentIngestionJobSummaries(v *[]types.IngestionJobSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.IngestionJobSummary + if *v == nil { + cv = []types.IngestionJobSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.IngestionJobSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentIngestionJobSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentIngestionJobSummary(v **types.IngestionJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7091,80 +16006,79 @@ func awsRestjson1_deserializeDocumentAgentActionGroup(v **types.AgentActionGroup return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AgentActionGroup + var sv *types.IngestionJobSummary if *v == nil { - sv = &types.AgentActionGroup{} + sv = &types.IngestionJobSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "actionGroupExecutor": - if err := awsRestjson1_deserializeDocumentActionGroupExecutor(&sv.ActionGroupExecutor, value); err != nil { - return err - } - - case "actionGroupId": + case "dataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Id to be of type string, got %T instead", value) } - sv.ActionGroupId = ptr.String(jtv) + sv.DataSourceId = ptr.String(jtv) } - case "actionGroupName": + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.ActionGroupName = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "actionGroupState": + case "ingestionJobId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ActionGroupState to be of type string, got %T instead", value) + return fmt.Errorf("expected Id to be of type string, got %T instead", value) } - sv.ActionGroupState = types.ActionGroupState(jtv) + sv.IngestionJobId = ptr.String(jtv) } - case "agentId": + case "knowledgeBaseId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Id to be of type string, got %T instead", value) } - sv.AgentId = ptr.String(jtv) + sv.KnowledgeBaseId = ptr.String(jtv) } - case "agentVersion": + case "startedAt": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Version to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) } - sv.AgentVersion = ptr.String(jtv) + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.StartedAt = ptr.Time(t) } - case "apiSchema": - if err := awsRestjson1_deserializeDocumentAPISchema(&sv.ApiSchema, value); err != nil { + case "statistics": + if err := awsRestjson1_deserializeDocumentIngestionJobStatistics(&sv.Statistics, value); err != nil { return err } - case "clientToken": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + return fmt.Errorf("expected IngestionJobStatus to be of type string, got %T instead", value) } - sv.ClientToken = ptr.String(jtv) + sv.Status = types.IngestionJobStatus(jtv) } - case "createdAt": + case "updatedAt": if value != nil { jtv, ok := value.(string) if !ok { @@ -7174,43 +16088,114 @@ func awsRestjson1_deserializeDocumentAgentActionGroup(v **types.AgentActionGroup if err != nil { return err } - sv.CreatedAt = ptr.Time(t) + sv.UpdatedAt = ptr.Time(t) } - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } + default: + _, _ = key, value - case "functionSchema": - if err := awsRestjson1_deserializeDocumentFunctionSchema(&sv.FunctionSchema, value); err != nil { + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInputFlowNodeConfiguration(v **types.InputFlowNodeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InputFlowNodeConfiguration + if *v == nil { + sv = &types.InputFlowNodeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIntermediateStorage(v **types.IntermediateStorage, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IntermediateStorage + if *v == nil { + sv = &types.IntermediateStorage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "s3Location": + if err := awsRestjson1_deserializeDocumentS3Location(&sv.S3Location, value); err != nil { return err } - case "parentActionSignature": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ActionGroupSignature to be of type string, got %T instead", value) - } - sv.ParentActionSignature = types.ActionGroupSignature(jtv) - } + default: + _, _ = key, value - case "updatedAt": + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) } - sv.UpdatedAt = ptr.Time(t) + sv.Message = ptr.String(jtv) } default: @@ -7222,7 +16207,38 @@ func awsRestjson1_deserializeDocumentAgentActionGroup(v **types.AgentActionGroup return nil } -func awsRestjson1_deserializeDocumentAgentAlias(v **types.AgentAlias, value interface{}) error { +func awsRestjson1_deserializeDocumentIteratorFlowNodeConfiguration(v **types.IteratorFlowNodeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IteratorFlowNodeConfiguration + if *v == nil { + sv = &types.IteratorFlowNodeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKnowledgeBase(v **types.KnowledgeBase, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7235,103 +16251,94 @@ func awsRestjson1_deserializeDocumentAgentAlias(v **types.AgentAlias, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AgentAlias + var sv *types.KnowledgeBase if *v == nil { - sv = &types.AgentAlias{} + sv = &types.KnowledgeBase{} } else { sv = *v } for key, value := range shape { switch key { - case "agentAliasArn": + case "createdAt": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AgentAliasArn to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) } - sv.AgentAliasArn = ptr.String(jtv) - } - - case "agentAliasHistoryEvents": - if err := awsRestjson1_deserializeDocumentAgentAliasHistoryEvents(&sv.AgentAliasHistoryEvents, value); err != nil { - return err + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) } - case "agentAliasId": + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AgentAliasId to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.AgentAliasId = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "agentAliasName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.AgentAliasName = ptr.String(jtv) + case "failureReasons": + if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { + return err } - case "agentAliasStatus": + case "knowledgeBaseArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AgentAliasStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected KnowledgeBaseArn to be of type string, got %T instead", value) } - sv.AgentAliasStatus = types.AgentAliasStatus(jtv) + sv.KnowledgeBaseArn = ptr.String(jtv) } - case "agentId": + case "knowledgeBaseConfiguration": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseConfiguration(&sv.KnowledgeBaseConfiguration, value); err != nil { + return err + } + + case "knowledgeBaseId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Id to be of type string, got %T instead", value) } - sv.AgentId = ptr.String(jtv) + sv.KnowledgeBaseId = ptr.String(jtv) } - case "clientToken": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.ClientToken = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "createdAt": + case "roleArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected KnowledgeBaseRoleArn to be of type string, got %T instead", value) } - sv.CreatedAt = ptr.Time(t) + sv.RoleArn = ptr.String(jtv) } - case "description": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected KnowledgeBaseStatus to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) - } - - case "failureReasons": - if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { - return err + sv.Status = types.KnowledgeBaseStatus(jtv) } - case "routingConfiguration": - if err := awsRestjson1_deserializeDocumentAgentAliasRoutingConfiguration(&sv.RoutingConfiguration, value); err != nil { + case "storageConfiguration": + if err := awsRestjson1_deserializeDocumentStorageConfiguration(&sv.StorageConfiguration, value); err != nil { return err } @@ -7357,7 +16364,7 @@ func awsRestjson1_deserializeDocumentAgentAlias(v **types.AgentAlias, value inte return nil } -func awsRestjson1_deserializeDocumentAgentAliasHistoryEvent(v **types.AgentAliasHistoryEvent, value interface{}) error { +func awsRestjson1_deserializeDocumentKnowledgeBaseConfiguration(v **types.KnowledgeBaseConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7370,44 +16377,76 @@ func awsRestjson1_deserializeDocumentAgentAliasHistoryEvent(v **types.AgentAlias return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AgentAliasHistoryEvent + var sv *types.KnowledgeBaseConfiguration if *v == nil { - sv = &types.AgentAliasHistoryEvent{} + sv = &types.KnowledgeBaseConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "endDate": + case "type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected KnowledgeBaseType to be of type string, got %T instead", value) } - sv.EndDate = ptr.Time(t) + sv.Type = types.KnowledgeBaseType(jtv) } - case "routingConfiguration": - if err := awsRestjson1_deserializeDocumentAgentAliasRoutingConfiguration(&sv.RoutingConfiguration, value); err != nil { + case "vectorKnowledgeBaseConfiguration": + if err := awsRestjson1_deserializeDocumentVectorKnowledgeBaseConfiguration(&sv.VectorKnowledgeBaseConfiguration, value); err != nil { return err } - case "startDate": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKnowledgeBaseFlowNodeConfiguration(v **types.KnowledgeBaseFlowNodeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KnowledgeBaseFlowNodeConfiguration + if *v == nil { + sv = &types.KnowledgeBaseFlowNodeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "knowledgeBaseId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + return fmt.Errorf("expected KnowledgeBaseId to be of type string, got %T instead", value) } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "modelId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelIdentifier to be of type string, got %T instead", value) } - sv.StartDate = ptr.Time(t) + sv.ModelId = ptr.String(jtv) } default: @@ -7419,7 +16458,7 @@ func awsRestjson1_deserializeDocumentAgentAliasHistoryEvent(v **types.AgentAlias return nil } -func awsRestjson1_deserializeDocumentAgentAliasHistoryEvents(v *[]types.AgentAliasHistoryEvent, value interface{}) error { +func awsRestjson1_deserializeDocumentKnowledgeBaseSummaries(v *[]types.KnowledgeBaseSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7432,17 +16471,17 @@ func awsRestjson1_deserializeDocumentAgentAliasHistoryEvents(v *[]types.AgentAli return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AgentAliasHistoryEvent + var cv []types.KnowledgeBaseSummary if *v == nil { - cv = []types.AgentAliasHistoryEvent{} + cv = []types.KnowledgeBaseSummary{} } else { cv = *v } for _, value := range shape { - var col types.AgentAliasHistoryEvent + var col types.KnowledgeBaseSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentAgentAliasHistoryEvent(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentKnowledgeBaseSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -7453,7 +16492,7 @@ func awsRestjson1_deserializeDocumentAgentAliasHistoryEvents(v *[]types.AgentAli return nil } -func awsRestjson1_deserializeDocumentAgentAliasRoutingConfiguration(v *[]types.AgentAliasRoutingConfigurationListItem, value interface{}) error { +func awsRestjson1_deserializeDocumentKnowledgeBaseSummary(v **types.KnowledgeBaseSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7461,33 +16500,119 @@ func awsRestjson1_deserializeDocumentAgentAliasRoutingConfiguration(v *[]types.A return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AgentAliasRoutingConfigurationListItem + var sv *types.KnowledgeBaseSummary if *v == nil { - cv = []types.AgentAliasRoutingConfigurationListItem{} + sv = &types.KnowledgeBaseSummary{} } else { - cv = *v + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KnowledgeBaseStatus to be of type string, got %T instead", value) + } + sv.Status = types.KnowledgeBaseStatus(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLambdaFunctionFlowNodeConfiguration(v **types.LambdaFunctionFlowNodeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LambdaFunctionFlowNodeConfiguration + if *v == nil { + sv = &types.LambdaFunctionFlowNodeConfiguration{} + } else { + sv = *v } - for _, value := range shape { - var col types.AgentAliasRoutingConfigurationListItem - destAddr := &col - if err := awsRestjson1_deserializeDocumentAgentAliasRoutingConfigurationListItem(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "lambdaArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LambdaArn to be of type string, got %T instead", value) + } + sv.LambdaArn = ptr.String(jtv) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentAgentAliasRoutingConfigurationListItem(v **types.AgentAliasRoutingConfigurationListItem, value interface{}) error { +func awsRestjson1_deserializeDocumentLexFlowNodeConfiguration(v **types.LexFlowNodeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7500,31 +16625,31 @@ func awsRestjson1_deserializeDocumentAgentAliasRoutingConfigurationListItem(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AgentAliasRoutingConfigurationListItem + var sv *types.LexFlowNodeConfiguration if *v == nil { - sv = &types.AgentAliasRoutingConfigurationListItem{} + sv = &types.LexFlowNodeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "agentVersion": + case "botAliasArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Version to be of type string, got %T instead", value) + return fmt.Errorf("expected LexBotAliasArn to be of type string, got %T instead", value) } - sv.AgentVersion = ptr.String(jtv) + sv.BotAliasArn = ptr.String(jtv) } - case "provisionedThroughput": + case "localeId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ProvisionedModelIdentifier to be of type string, got %T instead", value) + return fmt.Errorf("expected LexBotLocaleId to be of type string, got %T instead", value) } - sv.ProvisionedThroughput = ptr.String(jtv) + sv.LocaleId = ptr.String(jtv) } default: @@ -7536,7 +16661,7 @@ func awsRestjson1_deserializeDocumentAgentAliasRoutingConfigurationListItem(v ** return nil } -func awsRestjson1_deserializeDocumentAgentAliasSummaries(v *[]types.AgentAliasSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentMemoryConfiguration(v **types.MemoryConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7544,33 +16669,48 @@ func awsRestjson1_deserializeDocumentAgentAliasSummaries(v *[]types.AgentAliasSu return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AgentAliasSummary + var sv *types.MemoryConfiguration if *v == nil { - cv = []types.AgentAliasSummary{} + sv = &types.MemoryConfiguration{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.AgentAliasSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentAgentAliasSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "enabledMemoryTypes": + if err := awsRestjson1_deserializeDocumentEnabledMemoryTypes(&sv.EnabledMemoryTypes, value); err != nil { + return err + } + + case "storageDays": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected StorageDays to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StorageDays = ptr.Int32(int32(i64)) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentAgentAliasSummary(v **types.AgentAliasSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentMongoDbAtlasConfiguration(v **types.MongoDbAtlasConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7583,80 +16723,72 @@ func awsRestjson1_deserializeDocumentAgentAliasSummary(v **types.AgentAliasSumma return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AgentAliasSummary + var sv *types.MongoDbAtlasConfiguration if *v == nil { - sv = &types.AgentAliasSummary{} + sv = &types.MongoDbAtlasConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "agentAliasId": + case "collectionName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AgentAliasId to be of type string, got %T instead", value) + return fmt.Errorf("expected MongoDbAtlasCollectionName to be of type string, got %T instead", value) } - sv.AgentAliasId = ptr.String(jtv) + sv.CollectionName = ptr.String(jtv) } - case "agentAliasName": + case "credentialsSecretArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) } - sv.AgentAliasName = ptr.String(jtv) + sv.CredentialsSecretArn = ptr.String(jtv) } - case "agentAliasStatus": + case "databaseName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AgentAliasStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected MongoDbAtlasDatabaseName to be of type string, got %T instead", value) } - sv.AgentAliasStatus = types.AgentAliasStatus(jtv) + sv.DatabaseName = ptr.String(jtv) } - case "createdAt": + case "endpoint": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected MongoDbAtlasEndpoint to be of type string, got %T instead", value) } - sv.CreatedAt = ptr.Time(t) + sv.Endpoint = ptr.String(jtv) } - case "description": + case "endpointServiceName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected MongoDbAtlasEndpointServiceName to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.EndpointServiceName = ptr.String(jtv) } - case "routingConfiguration": - if err := awsRestjson1_deserializeDocumentAgentAliasRoutingConfiguration(&sv.RoutingConfiguration, value); err != nil { + case "fieldMapping": + if err := awsRestjson1_deserializeDocumentMongoDbAtlasFieldMapping(&sv.FieldMapping, value); err != nil { return err } - case "updatedAt": + case "vectorIndexName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected MongoDbAtlasIndexName to be of type string, got %T instead", value) } - sv.UpdatedAt = ptr.Time(t) + sv.VectorIndexName = ptr.String(jtv) } default: @@ -7668,7 +16800,7 @@ func awsRestjson1_deserializeDocumentAgentAliasSummary(v **types.AgentAliasSumma return nil } -func awsRestjson1_deserializeDocumentAgentKnowledgeBase(v **types.AgentKnowledgeBase, value interface{}) error { +func awsRestjson1_deserializeDocumentMongoDbAtlasFieldMapping(v **types.MongoDbAtlasFieldMapping, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7681,84 +16813,152 @@ func awsRestjson1_deserializeDocumentAgentKnowledgeBase(v **types.AgentKnowledge return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AgentKnowledgeBase + var sv *types.MongoDbAtlasFieldMapping if *v == nil { - sv = &types.AgentKnowledgeBase{} + sv = &types.MongoDbAtlasFieldMapping{} } else { sv = *v } for key, value := range shape { switch key { - case "agentId": + case "metadataField": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) } - sv.AgentId = ptr.String(jtv) + sv.MetadataField = ptr.String(jtv) } - case "agentVersion": + case "textField": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Version to be of type string, got %T instead", value) + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) } - sv.AgentVersion = ptr.String(jtv) + sv.TextField = ptr.String(jtv) } - case "createdAt": + case "vectorField": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) } - sv.CreatedAt = ptr.Time(t) + sv.VectorField = ptr.String(jtv) } - case "description": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOpenSearchServerlessConfiguration(v **types.OpenSearchServerlessConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpenSearchServerlessConfiguration + if *v == nil { + sv = &types.OpenSearchServerlessConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "collectionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected OpenSearchServerlessCollectionArn to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.CollectionArn = ptr.String(jtv) } - case "knowledgeBaseId": + case "fieldMapping": + if err := awsRestjson1_deserializeDocumentOpenSearchServerlessFieldMapping(&sv.FieldMapping, value); err != nil { + return err + } + + case "vectorIndexName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected OpenSearchServerlessIndexName to be of type string, got %T instead", value) } - sv.KnowledgeBaseId = ptr.String(jtv) + sv.VectorIndexName = ptr.String(jtv) } - case "knowledgeBaseState": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOpenSearchServerlessFieldMapping(v **types.OpenSearchServerlessFieldMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpenSearchServerlessFieldMapping + if *v == nil { + sv = &types.OpenSearchServerlessFieldMapping{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "metadataField": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KnowledgeBaseState to be of type string, got %T instead", value) + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) } - sv.KnowledgeBaseState = types.KnowledgeBaseState(jtv) + sv.MetadataField = ptr.String(jtv) } - case "updatedAt": + case "textField": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + sv.TextField = ptr.String(jtv) + } + + case "vectorField": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) } - sv.UpdatedAt = ptr.Time(t) + sv.VectorField = ptr.String(jtv) } default: @@ -7770,7 +16970,7 @@ func awsRestjson1_deserializeDocumentAgentKnowledgeBase(v **types.AgentKnowledge return nil } -func awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummaries(v *[]types.AgentKnowledgeBaseSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentOutputFlowNodeConfiguration(v **types.OutputFlowNodeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7778,33 +16978,30 @@ func awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummaries(v *[]types.Agen return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AgentKnowledgeBaseSummary + var sv *types.OutputFlowNodeConfiguration if *v == nil { - cv = []types.AgentKnowledgeBaseSummary{} + sv = &types.OutputFlowNodeConfiguration{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.AgentKnowledgeBaseSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummary(v **types.AgentKnowledgeBaseSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentParameterDetail(v **types.ParameterDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7817,9 +17014,9 @@ func awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummary(v **types.AgentKn return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AgentKnowledgeBaseSummary + var sv *types.ParameterDetail if *v == nil { - sv = &types.AgentKnowledgeBaseSummary{} + sv = &types.ParameterDetail{} } else { sv = *v } @@ -7830,40 +17027,27 @@ func awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummary(v **types.AgentKn if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected ParameterDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } - case "knowledgeBaseId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.KnowledgeBaseId = ptr.String(jtv) - } - - case "knowledgeBaseState": + case "required": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected KnowledgeBaseState to be of type string, got %T instead", value) + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.KnowledgeBaseState = types.KnowledgeBaseState(jtv) + sv.Required = ptr.Bool(jtv) } - case "updatedAt": + case "type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected Type to be of type string, got %T instead", value) } - sv.UpdatedAt = ptr.Time(t) + sv.Type = types.Type(jtv) } default: @@ -7875,7 +17059,7 @@ func awsRestjson1_deserializeDocumentAgentKnowledgeBaseSummary(v **types.AgentKn return nil } -func awsRestjson1_deserializeDocumentAgentSummaries(v *[]types.AgentSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentParameterMap(v *map[string]types.ParameterDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7883,33 +17067,34 @@ func awsRestjson1_deserializeDocumentAgentSummaries(v *[]types.AgentSummary, val return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AgentSummary + var mv map[string]types.ParameterDetail if *v == nil { - cv = []types.AgentSummary{} + mv = map[string]types.ParameterDetail{} } else { - cv = *v + mv = *v } - for _, value := range shape { - var col types.AgentSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentAgentSummary(&destAddr, value); err != nil { + for key, value := range shape { + var parsedVal types.ParameterDetail + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentParameterDetail(&destAddr, value); err != nil { return err } - col = *destAddr - cv = append(cv, col) + parsedVal = *destAddr + mv[key] = parsedVal } - *v = cv + *v = mv return nil } -func awsRestjson1_deserializeDocumentAgentSummary(v **types.AgentSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentParsingConfiguration(v **types.ParsingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7922,76 +17107,27 @@ func awsRestjson1_deserializeDocumentAgentSummary(v **types.AgentSummary, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AgentSummary + var sv *types.ParsingConfiguration if *v == nil { - sv = &types.AgentSummary{} + sv = &types.ParsingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "agentId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.AgentId = ptr.String(jtv) - } - - case "agentName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.AgentName = ptr.String(jtv) - } - - case "agentStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) - } - sv.AgentStatus = types.AgentStatus(jtv) - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "guardrailConfiguration": - if err := awsRestjson1_deserializeDocumentGuardrailConfiguration(&sv.GuardrailConfiguration, value); err != nil { + case "bedrockFoundationModelConfiguration": + if err := awsRestjson1_deserializeDocumentBedrockFoundationModelConfiguration(&sv.BedrockFoundationModelConfiguration, value); err != nil { return err } - case "latestAgentVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Version to be of type string, got %T instead", value) - } - sv.LatestAgentVersion = ptr.String(jtv) - } - - case "updatedAt": + case "parsingStrategy": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + return fmt.Errorf("expected ParsingStrategy to be of type string, got %T instead", value) } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(t) + sv.ParsingStrategy = types.ParsingStrategy(jtv) } default: @@ -8003,7 +17139,7 @@ func awsRestjson1_deserializeDocumentAgentSummary(v **types.AgentSummary, value return nil } -func awsRestjson1_deserializeDocumentAgentVersion(v **types.AgentVersion, value interface{}) error { +func awsRestjson1_deserializeDocumentParsingPrompt(v **types.ParsingPrompt, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8016,162 +17152,108 @@ func awsRestjson1_deserializeDocumentAgentVersion(v **types.AgentVersion, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AgentVersion + var sv *types.ParsingPrompt if *v == nil { - sv = &types.AgentVersion{} + sv = &types.ParsingPrompt{} } else { sv = *v } for key, value := range shape { switch key { - case "agentArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AgentArn to be of type string, got %T instead", value) - } - sv.AgentArn = ptr.String(jtv) - } - - case "agentId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.AgentId = ptr.String(jtv) - } - - case "agentName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.AgentName = ptr.String(jtv) - } - - case "agentResourceRoleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AgentRoleArn to be of type string, got %T instead", value) - } - sv.AgentResourceRoleArn = ptr.String(jtv) - } - - case "agentStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) - } - sv.AgentStatus = types.AgentStatus(jtv) - } - - case "createdAt": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(t) - } - - case "customerEncryptionKeyArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) - } - sv.CustomerEncryptionKeyArn = ptr.String(jtv) - } - - case "description": + case "parsingPromptText": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected ParsingPromptText to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) - } - - case "failureReasons": - if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { - return err + sv.ParsingPromptText = ptr.String(jtv) } - case "foundationModel": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ModelIdentifier to be of type string, got %T instead", value) - } - sv.FoundationModel = ptr.String(jtv) - } + default: + _, _ = key, value - case "guardrailConfiguration": - if err := awsRestjson1_deserializeDocumentGuardrailConfiguration(&sv.GuardrailConfiguration, value); err != nil { - return err - } + } + } + *v = sv + return nil +} - case "idleSessionTTLInSeconds": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected SessionTTL to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.IdleSessionTTLInSeconds = ptr.Int32(int32(i64)) - } +func awsRestjson1_deserializeDocumentPatternObjectFilter(v **types.PatternObjectFilter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "instruction": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Instruction to be of type string, got %T instead", value) - } - sv.Instruction = ptr.String(jtv) - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - case "promptOverrideConfiguration": - if err := awsRestjson1_deserializeDocumentPromptOverrideConfiguration(&sv.PromptOverrideConfiguration, value); err != nil { + var sv *types.PatternObjectFilter + if *v == nil { + sv = &types.PatternObjectFilter{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "exclusionFilters": + if err := awsRestjson1_deserializeDocumentFilterList(&sv.ExclusionFilters, value); err != nil { return err } - case "recommendedActions": - if err := awsRestjson1_deserializeDocumentRecommendedActions(&sv.RecommendedActions, value); err != nil { + case "inclusionFilters": + if err := awsRestjson1_deserializeDocumentFilterList(&sv.InclusionFilters, value); err != nil { return err } - case "updatedAt": + case "objectType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected FilteredObjectType to be of type string, got %T instead", value) } - sv.UpdatedAt = ptr.Time(t) + sv.ObjectType = ptr.String(jtv) } - case "version": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NumericalVersion to be of type string, got %T instead", value) - } - sv.Version = ptr.String(jtv) + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPatternObjectFilterConfiguration(v **types.PatternObjectFilterConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PatternObjectFilterConfiguration + if *v == nil { + sv = &types.PatternObjectFilterConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "filters": + if err := awsRestjson1_deserializeDocumentPatternObjectFilterList(&sv.Filters, value); err != nil { + return err } default: @@ -8183,7 +17265,7 @@ func awsRestjson1_deserializeDocumentAgentVersion(v **types.AgentVersion, value return nil } -func awsRestjson1_deserializeDocumentAgentVersionSummaries(v *[]types.AgentVersionSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPatternObjectFilterList(v *[]types.PatternObjectFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8196,17 +17278,17 @@ func awsRestjson1_deserializeDocumentAgentVersionSummaries(v *[]types.AgentVersi return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AgentVersionSummary + var cv []types.PatternObjectFilter if *v == nil { - cv = []types.AgentVersionSummary{} + cv = []types.PatternObjectFilter{} } else { cv = *v } for _, value := range shape { - var col types.AgentVersionSummary + var col types.PatternObjectFilter destAddr := &col - if err := awsRestjson1_deserializeDocumentAgentVersionSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentPatternObjectFilter(&destAddr, value); err != nil { return err } col = *destAddr @@ -8217,7 +17299,7 @@ func awsRestjson1_deserializeDocumentAgentVersionSummaries(v *[]types.AgentVersi return nil } -func awsRestjson1_deserializeDocumentAgentVersionSummary(v **types.AgentVersionSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPineconeConfiguration(v **types.PineconeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8230,80 +17312,45 @@ func awsRestjson1_deserializeDocumentAgentVersionSummary(v **types.AgentVersionS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AgentVersionSummary + var sv *types.PineconeConfiguration if *v == nil { - sv = &types.AgentVersionSummary{} + sv = &types.PineconeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "agentName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.AgentName = ptr.String(jtv) - } - - case "agentStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AgentStatus to be of type string, got %T instead", value) - } - sv.AgentStatus = types.AgentStatus(jtv) - } - - case "agentVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Version to be of type string, got %T instead", value) - } - sv.AgentVersion = ptr.String(jtv) - } - - case "createdAt": + case "connectionString": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected PineconeConnectionString to be of type string, got %T instead", value) } - sv.CreatedAt = ptr.Time(t) + sv.ConnectionString = ptr.String(jtv) } - case "description": + case "credentialsSecretArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.CredentialsSecretArn = ptr.String(jtv) } - case "guardrailConfiguration": - if err := awsRestjson1_deserializeDocumentGuardrailConfiguration(&sv.GuardrailConfiguration, value); err != nil { + case "fieldMapping": + if err := awsRestjson1_deserializeDocumentPineconeFieldMapping(&sv.FieldMapping, value); err != nil { return err } - case "updatedAt": + case "namespace": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected PineconeNamespace to be of type string, got %T instead", value) } - sv.UpdatedAt = ptr.Time(t) + sv.Namespace = ptr.String(jtv) } default: @@ -8315,7 +17362,7 @@ func awsRestjson1_deserializeDocumentAgentVersionSummary(v **types.AgentVersionS return nil } -func awsRestjson1_deserializeDocumentAPISchema(v *types.APISchema, value interface{}) error { +func awsRestjson1_deserializeDocumentPineconeFieldMapping(v **types.PineconeFieldMapping, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8328,46 +17375,43 @@ func awsRestjson1_deserializeDocumentAPISchema(v *types.APISchema, value interfa return fmt.Errorf("unexpected JSON type %v", value) } - var uv types.APISchema -loop: + var sv *types.PineconeFieldMapping + if *v == nil { + sv = &types.PineconeFieldMapping{} + } else { + sv = *v + } + for key, value := range shape { - if value == nil { - continue - } switch key { - case "payload": - var mv string + case "metadataField": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Payload to be of type string, got %T instead", value) + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) } - mv = jtv + sv.MetadataField = ptr.String(jtv) } - uv = &types.APISchemaMemberPayload{Value: mv} - break loop - case "s3": - var mv types.S3Identifier - destAddr := &mv - if err := awsRestjson1_deserializeDocumentS3Identifier(&destAddr, value); err != nil { - return err + case "textField": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) + } + sv.TextField = ptr.String(jtv) } - mv = *destAddr - uv = &types.APISchemaMemberS3{Value: mv} - break loop default: - uv = &types.UnknownUnionMember{Tag: key} - break loop + _, _ = key, value } } - *v = uv + *v = sv return nil } -func awsRestjson1_deserializeDocumentBedrockEmbeddingModelConfiguration(v **types.BedrockEmbeddingModelConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptConfiguration(v **types.PromptConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8380,26 +17424,63 @@ func awsRestjson1_deserializeDocumentBedrockEmbeddingModelConfiguration(v **type return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BedrockEmbeddingModelConfiguration + var sv *types.PromptConfiguration if *v == nil { - sv = &types.BedrockEmbeddingModelConfiguration{} + sv = &types.PromptConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "dimensions": + case "basePromptTemplate": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Dimensions to be json.Number, got %T instead", value) + return fmt.Errorf("expected BasePromptTemplate to be of type string, got %T instead", value) } - i64, err := jtv.Int64() - if err != nil { - return err + sv.BasePromptTemplate = ptr.String(jtv) + } + + case "inferenceConfiguration": + if err := awsRestjson1_deserializeDocumentInferenceConfiguration(&sv.InferenceConfiguration, value); err != nil { + return err + } + + case "parserMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationMode to be of type string, got %T instead", value) } - sv.Dimensions = ptr.Int32(int32(i64)) + sv.ParserMode = types.CreationMode(jtv) + } + + case "promptCreationMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationMode to be of type string, got %T instead", value) + } + sv.PromptCreationMode = types.CreationMode(jtv) + } + + case "promptState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptState to be of type string, got %T instead", value) + } + sv.PromptState = types.PromptState(jtv) + } + + case "promptType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptType to be of type string, got %T instead", value) + } + sv.PromptType = types.PromptType(jtv) } default: @@ -8411,7 +17492,7 @@ func awsRestjson1_deserializeDocumentBedrockEmbeddingModelConfiguration(v **type return nil } -func awsRestjson1_deserializeDocumentChunkingConfiguration(v **types.ChunkingConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptConfigurations(v *[]types.PromptConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8419,44 +17500,33 @@ func awsRestjson1_deserializeDocumentChunkingConfiguration(v **types.ChunkingCon return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ChunkingConfiguration + var cv []types.PromptConfiguration if *v == nil { - sv = &types.ChunkingConfiguration{} + cv = []types.PromptConfiguration{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "chunkingStrategy": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ChunkingStrategy to be of type string, got %T instead", value) - } - sv.ChunkingStrategy = types.ChunkingStrategy(jtv) - } - - case "fixedSizeChunkingConfiguration": - if err := awsRestjson1_deserializeDocumentFixedSizeChunkingConfiguration(&sv.FixedSizeChunkingConfiguration, value); err != nil { - return err - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.PromptConfiguration + destAddr := &col + if err := awsRestjson1_deserializeDocumentPromptConfiguration(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptFlowNodeConfiguration(v **types.PromptFlowNodeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8469,22 +17539,18 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConflictException + var sv *types.PromptFlowNodeConfiguration if *v == nil { - sv = &types.ConflictException{} + sv = &types.PromptFlowNodeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "sourceConfiguration": + if err := awsRestjson1_deserializeDocumentPromptFlowNodeSourceConfiguration(&sv.SourceConfiguration, value); err != nil { + return err } default: @@ -8496,7 +17562,7 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } -func awsRestjson1_deserializeDocumentDataSource(v **types.DataSource, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptFlowNodeInlineConfiguration(v **types.PromptFlowNodeInlineConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8509,113 +17575,41 @@ func awsRestjson1_deserializeDocumentDataSource(v **types.DataSource, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DataSource + var sv *types.PromptFlowNodeInlineConfiguration if *v == nil { - sv = &types.DataSource{} + sv = &types.PromptFlowNodeInlineConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "createdAt": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(t) - } - - case "dataDeletionPolicy": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DataDeletionPolicy to be of type string, got %T instead", value) - } - sv.DataDeletionPolicy = types.DataDeletionPolicy(jtv) - } - - case "dataSourceConfiguration": - if err := awsRestjson1_deserializeDocumentDataSourceConfiguration(&sv.DataSourceConfiguration, value); err != nil { - return err - } - - case "dataSourceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.DataSourceId = ptr.String(jtv) - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "failureReasons": - if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { + case "inferenceConfiguration": + if err := awsRestjson1_deserializeDocumentPromptInferenceConfiguration(&sv.InferenceConfiguration, value); err != nil { return err } - case "knowledgeBaseId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.KnowledgeBaseId = ptr.String(jtv) - } - - case "name": + case "modelId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected PromptModelIdentifier to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.ModelId = ptr.String(jtv) } - case "serverSideEncryptionConfiguration": - if err := awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { + case "templateConfiguration": + if err := awsRestjson1_deserializeDocumentPromptTemplateConfiguration(&sv.TemplateConfiguration, value); err != nil { return err } - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DataSourceStatus to be of type string, got %T instead", value) - } - sv.Status = types.DataSourceStatus(jtv) - } - - case "updatedAt": + case "templateType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + return fmt.Errorf("expected PromptTemplateType to be of type string, got %T instead", value) } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(t) - } - - case "vectorIngestionConfiguration": - if err := awsRestjson1_deserializeDocumentVectorIngestionConfiguration(&sv.VectorIngestionConfiguration, value); err != nil { - return err + sv.TemplateType = types.PromptTemplateType(jtv) } default: @@ -8627,7 +17621,7 @@ func awsRestjson1_deserializeDocumentDataSource(v **types.DataSource, value inte return nil } -func awsRestjson1_deserializeDocumentDataSourceConfiguration(v **types.DataSourceConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptFlowNodeResourceConfiguration(v **types.PromptFlowNodeResourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8640,27 +17634,22 @@ func awsRestjson1_deserializeDocumentDataSourceConfiguration(v **types.DataSourc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DataSourceConfiguration + var sv *types.PromptFlowNodeResourceConfiguration if *v == nil { - sv = &types.DataSourceConfiguration{} + sv = &types.PromptFlowNodeResourceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "s3Configuration": - if err := awsRestjson1_deserializeDocumentS3DataSourceConfiguration(&sv.S3Configuration, value); err != nil { - return err - } - - case "type": + case "promptArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DataSourceType to be of type string, got %T instead", value) + return fmt.Errorf("expected PromptArn to be of type string, got %T instead", value) } - sv.Type = types.DataSourceType(jtv) + sv.PromptArn = ptr.String(jtv) } default: @@ -8672,7 +17661,7 @@ func awsRestjson1_deserializeDocumentDataSourceConfiguration(v **types.DataSourc return nil } -func awsRestjson1_deserializeDocumentDataSourceSummaries(v *[]types.DataSourceSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptFlowNodeSourceConfiguration(v *types.PromptFlowNodeSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8680,33 +17669,49 @@ func awsRestjson1_deserializeDocumentDataSourceSummaries(v *[]types.DataSourceSu return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.DataSourceSummary - if *v == nil { - cv = []types.DataSourceSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.DataSourceSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentDataSourceSummary(&destAddr, value); err != nil { - return err + var uv types.PromptFlowNodeSourceConfiguration +loop: + for key, value := range shape { + if value == nil { + continue } - col = *destAddr - cv = append(cv, col) + switch key { + case "inline": + var mv types.PromptFlowNodeInlineConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentPromptFlowNodeInlineConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.PromptFlowNodeSourceConfigurationMemberInline{Value: mv} + break loop + case "resource": + var mv types.PromptFlowNodeResourceConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentPromptFlowNodeResourceConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.PromptFlowNodeSourceConfigurationMemberResource{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } } - *v = cv + *v = uv return nil } -func awsRestjson1_deserializeDocumentDataSourceSummary(v **types.DataSourceSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptInferenceConfiguration(v *types.PromptInferenceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8719,83 +17724,34 @@ func awsRestjson1_deserializeDocumentDataSourceSummary(v **types.DataSourceSumma return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DataSourceSummary - if *v == nil { - sv = &types.DataSourceSummary{} - } else { - sv = *v - } - + var uv types.PromptInferenceConfiguration +loop: for key, value := range shape { + if value == nil { + continue + } switch key { - case "dataSourceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.DataSourceId = ptr.String(jtv) - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "knowledgeBaseId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.KnowledgeBaseId = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DataSourceStatus to be of type string, got %T instead", value) - } - sv.Status = types.DataSourceStatus(jtv) - } - - case "updatedAt": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(t) + case "text": + var mv types.PromptModelInferenceConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentPromptModelInferenceConfiguration(&destAddr, value); err != nil { + return err } + mv = *destAddr + uv = &types.PromptInferenceConfigurationMemberText{Value: mv} + break loop default: - _, _ = key, value + uv = &types.UnknownUnionMember{Tag: key} + break loop } } - *v = sv + *v = uv return nil } -func awsRestjson1_deserializeDocumentEmbeddingModelConfiguration(v **types.EmbeddingModelConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptInputVariable(v **types.PromptInputVariable, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8808,18 +17764,22 @@ func awsRestjson1_deserializeDocumentEmbeddingModelConfiguration(v **types.Embed return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EmbeddingModelConfiguration + var sv *types.PromptInputVariable if *v == nil { - sv = &types.EmbeddingModelConfiguration{} + sv = &types.PromptInputVariable{} } else { sv = *v } for key, value := range shape { switch key { - case "bedrockEmbeddingModelConfiguration": - if err := awsRestjson1_deserializeDocumentBedrockEmbeddingModelConfiguration(&sv.BedrockEmbeddingModelConfiguration, value); err != nil { - return err + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptInputVariableName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) } default: @@ -8831,7 +17791,7 @@ func awsRestjson1_deserializeDocumentEmbeddingModelConfiguration(v **types.Embed return nil } -func awsRestjson1_deserializeDocumentFailureReasons(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptInputVariablesList(v *[]types.PromptInputVariable, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8844,22 +17804,20 @@ func awsRestjson1_deserializeDocumentFailureReasons(v *[]string, value interface return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.PromptInputVariable if *v == nil { - cv = []string{} + cv = []types.PromptInputVariable{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value) - } - col = jtv + var col types.PromptInputVariable + destAddr := &col + if err := awsRestjson1_deserializeDocumentPromptInputVariable(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -8867,7 +17825,7 @@ func awsRestjson1_deserializeDocumentFailureReasons(v *[]string, value interface return nil } -func awsRestjson1_deserializeDocumentFixedSizeChunkingConfiguration(v **types.FixedSizeChunkingConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptModelInferenceConfiguration(v **types.PromptModelInferenceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8880,9 +17838,9 @@ func awsRestjson1_deserializeDocumentFixedSizeChunkingConfiguration(v **types.Fi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FixedSizeChunkingConfiguration + var sv *types.PromptModelInferenceConfiguration if *v == nil { - sv = &types.FixedSizeChunkingConfiguration{} + sv = &types.PromptModelInferenceConfiguration{} } else { sv = *v } @@ -8893,7 +17851,7 @@ func awsRestjson1_deserializeDocumentFixedSizeChunkingConfiguration(v **types.Fi if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected MaximumLength to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { @@ -8902,17 +17860,90 @@ func awsRestjson1_deserializeDocumentFixedSizeChunkingConfiguration(v **types.Fi sv.MaxTokens = ptr.Int32(int32(i64)) } - case "overlapPercentage": + case "stopSequences": + if err := awsRestjson1_deserializeDocumentStopSequences(&sv.StopSequences, value); err != nil { + return err + } + + case "temperature": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Temperature = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Temperature = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Temperature to be a JSON Number, got %T instead", value) + + } + } + + case "topK": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected TopK to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.OverlapPercentage = ptr.Int32(int32(i64)) + sv.TopK = ptr.Int32(int32(i64)) + } + + case "topP": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TopP = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.TopP = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected TopP to be a JSON Number, got %T instead", value) + + } } default: @@ -8924,7 +17955,7 @@ func awsRestjson1_deserializeDocumentFixedSizeChunkingConfiguration(v **types.Fi return nil } -func awsRestjson1_deserializeDocumentFunction(v **types.Function, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptOverrideConfiguration(v **types.PromptOverrideConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8937,35 +17968,26 @@ func awsRestjson1_deserializeDocumentFunction(v **types.Function, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Function + var sv *types.PromptOverrideConfiguration if *v == nil { - sv = &types.Function{} + sv = &types.PromptOverrideConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FunctionDescription to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "name": + case "overrideLambda": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected LambdaArn to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.OverrideLambda = ptr.String(jtv) } - case "parameters": - if err := awsRestjson1_deserializeDocumentParameterMap(&sv.Parameters, value); err != nil { + case "promptConfigurations": + if err := awsRestjson1_deserializeDocumentPromptConfigurations(&sv.PromptConfigurations, value); err != nil { return err } @@ -8978,7 +18000,7 @@ func awsRestjson1_deserializeDocumentFunction(v **types.Function, value interfac return nil } -func awsRestjson1_deserializeDocumentFunctions(v *[]types.Function, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptSummaries(v *[]types.PromptSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8991,17 +18013,17 @@ func awsRestjson1_deserializeDocumentFunctions(v *[]types.Function, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Function + var cv []types.PromptSummary if *v == nil { - cv = []types.Function{} + cv = []types.PromptSummary{} } else { cv = *v } for _, value := range shape { - var col types.Function + var col types.PromptSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentFunction(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentPromptSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -9012,45 +18034,7 @@ func awsRestjson1_deserializeDocumentFunctions(v *[]types.Function, value interf return nil } -func awsRestjson1_deserializeDocumentFunctionSchema(v *types.FunctionSchema, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var uv types.FunctionSchema -loop: - for key, value := range shape { - if value == nil { - continue - } - switch key { - case "functions": - var mv []types.Function - if err := awsRestjson1_deserializeDocumentFunctions(&mv, value); err != nil { - return err - } - uv = &types.FunctionSchemaMemberFunctions{Value: mv} - break loop - - default: - uv = &types.UnknownUnionMember{Tag: key} - break loop - - } - } - *v = uv - return nil -} - -func awsRestjson1_deserializeDocumentGuardrailConfiguration(v **types.GuardrailConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptSummary(v **types.PromptSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9063,173 +18047,136 @@ func awsRestjson1_deserializeDocumentGuardrailConfiguration(v **types.GuardrailC return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailConfiguration + var sv *types.PromptSummary if *v == nil { - sv = &types.GuardrailConfiguration{} + sv = &types.PromptSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "guardrailIdentifier": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GuardrailIdentifier to be of type string, got %T instead", value) + return fmt.Errorf("expected PromptArn to be of type string, got %T instead", value) } - sv.GuardrailIdentifier = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "guardrailVersion": + case "createdAt": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GuardrailVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) } - sv.GuardrailVersion = ptr.String(jtv) + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInferenceConfiguration(v **types.InferenceConfiguration, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InferenceConfiguration - if *v == nil { - sv = &types.InferenceConfiguration{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "maximumLength": + case "description": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MaximumLength to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected PromptDescription to be of type string, got %T instead", value) } - sv.MaximumLength = ptr.Int32(int32(i64)) + sv.Description = ptr.String(jtv) } - case "stopSequences": - if err := awsRestjson1_deserializeDocumentStopSequences(&sv.StopSequences, value); err != nil { - return err + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) } - case "temperature": + case "name": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Temperature = ptr.Float32(float32(f64)) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.Temperature = ptr.Float32(float32(f64)) - - default: - return fmt.Errorf("expected Temperature to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptName to be of type string, got %T instead", value) } + sv.Name = ptr.String(jtv) } - case "topK": + case "updatedAt": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TopK to be json.Number, got %T instead", value) + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) } - i64, err := jtv.Int64() + t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } - sv.TopK = ptr.Int32(int32(i64)) + sv.UpdatedAt = ptr.Time(t) } - case "topP": + case "version": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.TopP = ptr.Float32(float32(f64)) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Version to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) + default: + _, _ = key, value - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) + } + } + *v = sv + return nil +} - } - sv.TopP = ptr.Float32(float32(f64)) +func awsRestjson1_deserializeDocumentPromptTemplateConfiguration(v *types.PromptTemplateConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - default: - return fmt.Errorf("expected TopP to be a JSON Number, got %T instead", value) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - } + var uv types.PromptTemplateConfiguration +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "text": + var mv types.TextPromptTemplateConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentTextPromptTemplateConfiguration(&destAddr, value); err != nil { + return err } + mv = *destAddr + uv = &types.PromptTemplateConfigurationMemberText{Value: mv} + break loop default: - _, _ = key, value + uv = &types.UnknownUnionMember{Tag: key} + break loop } } - *v = sv + *v = uv return nil } -func awsRestjson1_deserializeDocumentIngestionJob(v **types.IngestionJob, value interface{}) error { +func awsRestjson1_deserializeDocumentPromptVariant(v **types.PromptVariant, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9242,94 +18189,156 @@ func awsRestjson1_deserializeDocumentIngestionJob(v **types.IngestionJob, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.IngestionJob + var sv *types.PromptVariant if *v == nil { - sv = &types.IngestionJob{} + sv = &types.PromptVariant{} } else { sv = *v } for key, value := range shape { switch key { - case "dataSourceId": + case "inferenceConfiguration": + if err := awsRestjson1_deserializeDocumentPromptInferenceConfiguration(&sv.InferenceConfiguration, value); err != nil { + return err + } + + case "modelId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected PromptModelIdentifier to be of type string, got %T instead", value) } - sv.DataSourceId = ptr.String(jtv) + sv.ModelId = ptr.String(jtv) } - case "description": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected PromptVariantName to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "failureReasons": - if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { + case "templateConfiguration": + if err := awsRestjson1_deserializeDocumentPromptTemplateConfiguration(&sv.TemplateConfiguration, value); err != nil { return err } - case "ingestionJobId": + case "templateType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected PromptTemplateType to be of type string, got %T instead", value) } - sv.IngestionJobId = ptr.String(jtv) + sv.TemplateType = types.PromptTemplateType(jtv) } - case "knowledgeBaseId": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPromptVariantList(v *[]types.PromptVariant, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.PromptVariant + if *v == nil { + cv = []types.PromptVariant{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PromptVariant + destAddr := &col + if err := awsRestjson1_deserializeDocumentPromptVariant(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRdsConfiguration(v **types.RdsConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RdsConfiguration + if *v == nil { + sv = &types.RdsConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "credentialsSecretArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) } - sv.KnowledgeBaseId = ptr.String(jtv) + sv.CredentialsSecretArn = ptr.String(jtv) } - case "startedAt": + case "databaseName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected RdsDatabaseName to be of type string, got %T instead", value) } - sv.StartedAt = ptr.Time(t) + sv.DatabaseName = ptr.String(jtv) } - case "statistics": - if err := awsRestjson1_deserializeDocumentIngestionJobStatistics(&sv.Statistics, value); err != nil { + case "fieldMapping": + if err := awsRestjson1_deserializeDocumentRdsFieldMapping(&sv.FieldMapping, value); err != nil { return err } - case "status": + case "resourceArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected IngestionJobStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected RdsArn to be of type string, got %T instead", value) } - sv.Status = types.IngestionJobStatus(jtv) + sv.ResourceArn = ptr.String(jtv) } - case "updatedAt": + case "tableName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected RdsTableName to be of type string, got %T instead", value) } - sv.UpdatedAt = ptr.Time(t) + sv.TableName = ptr.String(jtv) } default: @@ -9341,7 +18350,7 @@ func awsRestjson1_deserializeDocumentIngestionJob(v **types.IngestionJob, value return nil } -func awsRestjson1_deserializeDocumentIngestionJobStatistics(v **types.IngestionJobStatistics, value interface{}) error { +func awsRestjson1_deserializeDocumentRdsFieldMapping(v **types.RdsFieldMapping, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9354,104 +18363,49 @@ func awsRestjson1_deserializeDocumentIngestionJobStatistics(v **types.IngestionJ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.IngestionJobStatistics + var sv *types.RdsFieldMapping if *v == nil { - sv = &types.IngestionJobStatistics{} + sv = &types.RdsFieldMapping{} } else { sv = *v } for key, value := range shape { switch key { - case "numberOfDocumentsDeleted": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.NumberOfDocumentsDeleted = i64 - } - - case "numberOfDocumentsFailed": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.NumberOfDocumentsFailed = i64 - } - - case "numberOfDocumentsScanned": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.NumberOfDocumentsScanned = i64 - } - - case "numberOfMetadataDocumentsModified": + case "metadataField": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } - sv.NumberOfMetadataDocumentsModified = i64 + sv.MetadataField = ptr.String(jtv) } - case "numberOfMetadataDocumentsScanned": + case "primaryKeyField": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } - sv.NumberOfMetadataDocumentsScanned = i64 + sv.PrimaryKeyField = ptr.String(jtv) } - case "numberOfModifiedDocumentsIndexed": + case "textField": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } - sv.NumberOfModifiedDocumentsIndexed = i64 + sv.TextField = ptr.String(jtv) } - case "numberOfNewDocumentsIndexed": + case "vectorField": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PrimitiveLong to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } - sv.NumberOfNewDocumentsIndexed = i64 + sv.VectorField = ptr.String(jtv) } default: @@ -9463,7 +18417,7 @@ func awsRestjson1_deserializeDocumentIngestionJobStatistics(v **types.IngestionJ return nil } -func awsRestjson1_deserializeDocumentIngestionJobSummaries(v *[]types.IngestionJobSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentRecommendedActions(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9476,20 +18430,22 @@ func awsRestjson1_deserializeDocumentIngestionJobSummaries(v *[]types.IngestionJ return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.IngestionJobSummary + var cv []string if *v == nil { - cv = []types.IngestionJobSummary{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.IngestionJobSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentIngestionJobSummary(&destAddr, value); err != nil { - return err + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendedAction to be of type string, got %T instead", value) + } + col = jtv } - col = *destAddr cv = append(cv, col) } @@ -9497,7 +18453,7 @@ func awsRestjson1_deserializeDocumentIngestionJobSummaries(v *[]types.IngestionJ return nil } -func awsRestjson1_deserializeDocumentIngestionJobSummary(v **types.IngestionJobSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentRedisEnterpriseCloudConfiguration(v **types.RedisEnterpriseCloudConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9510,89 +18466,103 @@ func awsRestjson1_deserializeDocumentIngestionJobSummary(v **types.IngestionJobS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.IngestionJobSummary + var sv *types.RedisEnterpriseCloudConfiguration if *v == nil { - sv = &types.IngestionJobSummary{} + sv = &types.RedisEnterpriseCloudConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "dataSourceId": + case "credentialsSecretArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) } - sv.DataSourceId = ptr.String(jtv) + sv.CredentialsSecretArn = ptr.String(jtv) } - case "description": + case "endpoint": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected RedisEnterpriseCloudEndpoint to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.Endpoint = ptr.String(jtv) } - case "ingestionJobId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.IngestionJobId = ptr.String(jtv) + case "fieldMapping": + if err := awsRestjson1_deserializeDocumentRedisEnterpriseCloudFieldMapping(&sv.FieldMapping, value); err != nil { + return err } - case "knowledgeBaseId": + case "vectorIndexName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected RedisEnterpriseCloudIndexName to be of type string, got %T instead", value) } - sv.KnowledgeBaseId = ptr.String(jtv) + sv.VectorIndexName = ptr.String(jtv) } - case "startedAt": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRedisEnterpriseCloudFieldMapping(v **types.RedisEnterpriseCloudFieldMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RedisEnterpriseCloudFieldMapping + if *v == nil { + sv = &types.RedisEnterpriseCloudFieldMapping{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "metadataField": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) } - sv.StartedAt = ptr.Time(t) - } - - case "statistics": - if err := awsRestjson1_deserializeDocumentIngestionJobStatistics(&sv.Statistics, value); err != nil { - return err + sv.MetadataField = ptr.String(jtv) } - case "status": + case "textField": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected IngestionJobStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) } - sv.Status = types.IngestionJobStatus(jtv) + sv.TextField = ptr.String(jtv) } - case "updatedAt": + case "vectorField": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) } - sv.UpdatedAt = ptr.Time(t) + sv.VectorField = ptr.String(jtv) } default: @@ -9604,7 +18574,7 @@ func awsRestjson1_deserializeDocumentIngestionJobSummary(v **types.IngestionJobS return nil } -func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9617,9 +18587,9 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InternalServerException + var sv *types.ResourceNotFoundException if *v == nil { - sv = &types.InternalServerException{} + sv = &types.ResourceNotFoundException{} } else { sv = *v } @@ -9644,7 +18614,7 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS return nil } -func awsRestjson1_deserializeDocumentKnowledgeBase(v **types.KnowledgeBase, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievalFlowNodeConfiguration(v **types.RetrievalFlowNodeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9657,110 +18627,20 @@ func awsRestjson1_deserializeDocumentKnowledgeBase(v **types.KnowledgeBase, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KnowledgeBase + var sv *types.RetrievalFlowNodeConfiguration if *v == nil { - sv = &types.KnowledgeBase{} + sv = &types.RetrievalFlowNodeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "createdAt": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(t) - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "failureReasons": - if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { - return err - } - - case "knowledgeBaseArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected KnowledgeBaseArn to be of type string, got %T instead", value) - } - sv.KnowledgeBaseArn = ptr.String(jtv) - } - - case "knowledgeBaseConfiguration": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseConfiguration(&sv.KnowledgeBaseConfiguration, value); err != nil { - return err - } - - case "knowledgeBaseId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.KnowledgeBaseId = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "roleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected KnowledgeBaseRoleArn to be of type string, got %T instead", value) - } - sv.RoleArn = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected KnowledgeBaseStatus to be of type string, got %T instead", value) - } - sv.Status = types.KnowledgeBaseStatus(jtv) - } - - case "storageConfiguration": - if err := awsRestjson1_deserializeDocumentStorageConfiguration(&sv.StorageConfiguration, value); err != nil { + case "serviceConfiguration": + if err := awsRestjson1_deserializeDocumentRetrievalFlowNodeServiceConfiguration(&sv.ServiceConfiguration, value); err != nil { return err } - case "updatedAt": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(t) - } - default: _, _ = key, value @@ -9770,7 +18650,7 @@ func awsRestjson1_deserializeDocumentKnowledgeBase(v **types.KnowledgeBase, valu return nil } -func awsRestjson1_deserializeDocumentKnowledgeBaseConfiguration(v **types.KnowledgeBaseConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievalFlowNodeS3Configuration(v **types.RetrievalFlowNodeS3Configuration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9783,27 +18663,22 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseConfiguration(v **types.Knowle return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KnowledgeBaseConfiguration + var sv *types.RetrievalFlowNodeS3Configuration if *v == nil { - sv = &types.KnowledgeBaseConfiguration{} + sv = &types.RetrievalFlowNodeS3Configuration{} } else { sv = *v } for key, value := range shape { switch key { - case "type": + case "bucketName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KnowledgeBaseType to be of type string, got %T instead", value) - } - sv.Type = types.KnowledgeBaseType(jtv) - } - - case "vectorKnowledgeBaseConfiguration": - if err := awsRestjson1_deserializeDocumentVectorKnowledgeBaseConfiguration(&sv.VectorKnowledgeBaseConfiguration, value); err != nil { - return err + return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value) + } + sv.BucketName = ptr.String(jtv) } default: @@ -9815,7 +18690,7 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseConfiguration(v **types.Knowle return nil } -func awsRestjson1_deserializeDocumentKnowledgeBaseSummaries(v *[]types.KnowledgeBaseSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievalFlowNodeServiceConfiguration(v *types.RetrievalFlowNodeServiceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9823,33 +18698,39 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseSummaries(v *[]types.Knowledge return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.KnowledgeBaseSummary - if *v == nil { - cv = []types.KnowledgeBaseSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.KnowledgeBaseSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentKnowledgeBaseSummary(&destAddr, value); err != nil { - return err + var uv types.RetrievalFlowNodeServiceConfiguration +loop: + for key, value := range shape { + if value == nil { + continue } - col = *destAddr - cv = append(cv, col) + switch key { + case "s3": + var mv types.RetrievalFlowNodeS3Configuration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentRetrievalFlowNodeS3Configuration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.RetrievalFlowNodeServiceConfigurationMemberS3{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + } } - *v = cv + *v = uv return nil } -func awsRestjson1_deserializeDocumentKnowledgeBaseSummary(v **types.KnowledgeBaseSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentS3DataSourceConfiguration(v **types.S3DataSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9862,62 +18743,36 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseSummary(v **types.KnowledgeBas return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KnowledgeBaseSummary + var sv *types.S3DataSourceConfiguration if *v == nil { - sv = &types.KnowledgeBaseSummary{} + sv = &types.S3DataSourceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "knowledgeBaseId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.KnowledgeBaseId = ptr.String(jtv) - } - - case "name": + case "bucketArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected S3BucketArn to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.BucketArn = ptr.String(jtv) } - case "status": + case "bucketOwnerAccountId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KnowledgeBaseStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected BucketOwnerAccountId to be of type string, got %T instead", value) } - sv.Status = types.KnowledgeBaseStatus(jtv) + sv.BucketOwnerAccountId = ptr.String(jtv) } - case "updatedAt": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(t) + case "inclusionPrefixes": + if err := awsRestjson1_deserializeDocumentS3Prefixes(&sv.InclusionPrefixes, value); err != nil { + return err } default: @@ -9929,7 +18784,7 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseSummary(v **types.KnowledgeBas return nil } -func awsRestjson1_deserializeDocumentMongoDbAtlasConfiguration(v **types.MongoDbAtlasConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentS3Identifier(v **types.S3Identifier, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9942,72 +18797,71 @@ func awsRestjson1_deserializeDocumentMongoDbAtlasConfiguration(v **types.MongoDb return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MongoDbAtlasConfiguration + var sv *types.S3Identifier if *v == nil { - sv = &types.MongoDbAtlasConfiguration{} + sv = &types.S3Identifier{} } else { sv = *v } for key, value := range shape { switch key { - case "collectionName": + case "s3BucketName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MongoDbAtlasCollectionName to be of type string, got %T instead", value) + return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value) } - sv.CollectionName = ptr.String(jtv) + sv.S3BucketName = ptr.String(jtv) } - case "credentialsSecretArn": + case "s3ObjectKey": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) + return fmt.Errorf("expected S3ObjectKey to be of type string, got %T instead", value) } - sv.CredentialsSecretArn = ptr.String(jtv) + sv.S3ObjectKey = ptr.String(jtv) } - case "databaseName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MongoDbAtlasDatabaseName to be of type string, got %T instead", value) - } - sv.DatabaseName = ptr.String(jtv) - } + default: + _, _ = key, value - case "endpoint": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MongoDbAtlasEndpoint to be of type string, got %T instead", value) - } - sv.Endpoint = ptr.String(jtv) - } + } + } + *v = sv + return nil +} - case "endpointServiceName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MongoDbAtlasEndpointServiceName to be of type string, got %T instead", value) - } - sv.EndpointServiceName = ptr.String(jtv) - } +func awsRestjson1_deserializeDocumentS3Location(v **types.S3Location, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "fieldMapping": - if err := awsRestjson1_deserializeDocumentMongoDbAtlasFieldMapping(&sv.FieldMapping, value); err != nil { - return err - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - case "vectorIndexName": + var sv *types.S3Location + if *v == nil { + sv = &types.S3Location{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "uri": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MongoDbAtlasIndexName to be of type string, got %T instead", value) + return fmt.Errorf("expected S3BucketUri to be of type string, got %T instead", value) } - sv.VectorIndexName = ptr.String(jtv) + sv.Uri = ptr.String(jtv) } default: @@ -10019,7 +18873,43 @@ func awsRestjson1_deserializeDocumentMongoDbAtlasConfiguration(v **types.MongoDb return nil } -func awsRestjson1_deserializeDocumentMongoDbAtlasFieldMapping(v **types.MongoDbAtlasFieldMapping, value interface{}) error { +func awsRestjson1_deserializeDocumentS3Prefixes(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3Prefix to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSalesforceCrawlerConfiguration(v **types.SalesforceCrawlerConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10032,40 +18922,18 @@ func awsRestjson1_deserializeDocumentMongoDbAtlasFieldMapping(v **types.MongoDbA return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MongoDbAtlasFieldMapping + var sv *types.SalesforceCrawlerConfiguration if *v == nil { - sv = &types.MongoDbAtlasFieldMapping{} + sv = &types.SalesforceCrawlerConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "metadataField": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) - } - sv.MetadataField = ptr.String(jtv) - } - - case "textField": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) - } - sv.TextField = ptr.String(jtv) - } - - case "vectorField": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) - } - sv.VectorField = ptr.String(jtv) + case "filterConfiguration": + if err := awsRestjson1_deserializeDocumentCrawlFilterConfiguration(&sv.FilterConfiguration, value); err != nil { + return err } default: @@ -10077,7 +18945,7 @@ func awsRestjson1_deserializeDocumentMongoDbAtlasFieldMapping(v **types.MongoDbA return nil } -func awsRestjson1_deserializeDocumentOpenSearchServerlessConfiguration(v **types.OpenSearchServerlessConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentSalesforceDataSourceConfiguration(v **types.SalesforceDataSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10090,36 +18958,23 @@ func awsRestjson1_deserializeDocumentOpenSearchServerlessConfiguration(v **types return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.OpenSearchServerlessConfiguration + var sv *types.SalesforceDataSourceConfiguration if *v == nil { - sv = &types.OpenSearchServerlessConfiguration{} + sv = &types.SalesforceDataSourceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "collectionArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OpenSearchServerlessCollectionArn to be of type string, got %T instead", value) - } - sv.CollectionArn = ptr.String(jtv) - } - - case "fieldMapping": - if err := awsRestjson1_deserializeDocumentOpenSearchServerlessFieldMapping(&sv.FieldMapping, value); err != nil { + case "crawlerConfiguration": + if err := awsRestjson1_deserializeDocumentSalesforceCrawlerConfiguration(&sv.CrawlerConfiguration, value); err != nil { return err } - case "vectorIndexName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OpenSearchServerlessIndexName to be of type string, got %T instead", value) - } - sv.VectorIndexName = ptr.String(jtv) + case "sourceConfiguration": + if err := awsRestjson1_deserializeDocumentSalesforceSourceConfiguration(&sv.SourceConfiguration, value); err != nil { + return err } default: @@ -10131,7 +18986,7 @@ func awsRestjson1_deserializeDocumentOpenSearchServerlessConfiguration(v **types return nil } -func awsRestjson1_deserializeDocumentOpenSearchServerlessFieldMapping(v **types.OpenSearchServerlessFieldMapping, value interface{}) error { +func awsRestjson1_deserializeDocumentSalesforceSourceConfiguration(v **types.SalesforceSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10144,40 +18999,40 @@ func awsRestjson1_deserializeDocumentOpenSearchServerlessFieldMapping(v **types. return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.OpenSearchServerlessFieldMapping + var sv *types.SalesforceSourceConfiguration if *v == nil { - sv = &types.OpenSearchServerlessFieldMapping{} + sv = &types.SalesforceSourceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "metadataField": + case "authType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) + return fmt.Errorf("expected SalesforceAuthType to be of type string, got %T instead", value) } - sv.MetadataField = ptr.String(jtv) + sv.AuthType = types.SalesforceAuthType(jtv) } - case "textField": + case "credentialsSecretArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) + return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) } - sv.TextField = ptr.String(jtv) + sv.CredentialsSecretArn = ptr.String(jtv) } - case "vectorField": + case "hostUrl": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) + return fmt.Errorf("expected HttpsUrl to be of type string, got %T instead", value) } - sv.VectorField = ptr.String(jtv) + sv.HostUrl = ptr.String(jtv) } default: @@ -10189,7 +19044,7 @@ func awsRestjson1_deserializeDocumentOpenSearchServerlessFieldMapping(v **types. return nil } -func awsRestjson1_deserializeDocumentParameterDetail(v **types.ParameterDetail, value interface{}) error { +func awsRestjson1_deserializeDocumentSeedUrl(v **types.SeedUrl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10202,40 +19057,22 @@ func awsRestjson1_deserializeDocumentParameterDetail(v **types.ParameterDetail, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ParameterDetail + var sv *types.SeedUrl if *v == nil { - sv = &types.ParameterDetail{} + sv = &types.SeedUrl{} } else { sv = *v } for key, value := range shape { switch key { - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ParameterDescription to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "required": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.Required = ptr.Bool(jtv) - } - - case "type": + case "url": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Type to be of type string, got %T instead", value) + return fmt.Errorf("expected Url to be of type string, got %T instead", value) } - sv.Type = types.Type(jtv) + sv.Url = ptr.String(jtv) } default: @@ -10247,7 +19084,7 @@ func awsRestjson1_deserializeDocumentParameterDetail(v **types.ParameterDetail, return nil } -func awsRestjson1_deserializeDocumentParameterMap(v *map[string]types.ParameterDetail, value interface{}) error { +func awsRestjson1_deserializeDocumentSeedUrls(v *[]types.SeedUrl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10255,34 +19092,33 @@ func awsRestjson1_deserializeDocumentParameterMap(v *map[string]types.ParameterD return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.ParameterDetail + var cv []types.SeedUrl if *v == nil { - mv = map[string]types.ParameterDetail{} + cv = []types.SeedUrl{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal types.ParameterDetail - mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentParameterDetail(&destAddr, value); err != nil { + for _, value := range shape { + var col types.SeedUrl + destAddr := &col + if err := awsRestjson1_deserializeDocumentSeedUrl(&destAddr, value); err != nil { return err } - parsedVal = *destAddr - mv[key] = parsedVal + col = *destAddr + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentPineconeConfiguration(v **types.PineconeConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentSemanticChunkingConfiguration(v **types.SemanticChunkingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10295,45 +19131,52 @@ func awsRestjson1_deserializeDocumentPineconeConfiguration(v **types.PineconeCon return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PineconeConfiguration + var sv *types.SemanticChunkingConfiguration if *v == nil { - sv = &types.PineconeConfiguration{} + sv = &types.SemanticChunkingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "connectionString": + case "breakpointPercentileThreshold": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected PineconeConnectionString to be of type string, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.ConnectionString = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BreakpointPercentileThreshold = ptr.Int32(int32(i64)) } - case "credentialsSecretArn": + case "bufferSize": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.CredentialsSecretArn = ptr.String(jtv) - } - - case "fieldMapping": - if err := awsRestjson1_deserializeDocumentPineconeFieldMapping(&sv.FieldMapping, value); err != nil { - return err + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BufferSize = ptr.Int32(int32(i64)) } - case "namespace": + case "maxTokens": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected PineconeNamespace to be of type string, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.Namespace = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxTokens = ptr.Int32(int32(i64)) } default: @@ -10345,7 +19188,7 @@ func awsRestjson1_deserializeDocumentPineconeConfiguration(v **types.PineconeCon return nil } -func awsRestjson1_deserializeDocumentPineconeFieldMapping(v **types.PineconeFieldMapping, value interface{}) error { +func awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(v **types.ServerSideEncryptionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10358,31 +19201,22 @@ func awsRestjson1_deserializeDocumentPineconeFieldMapping(v **types.PineconeFiel return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PineconeFieldMapping + var sv *types.ServerSideEncryptionConfiguration if *v == nil { - sv = &types.PineconeFieldMapping{} + sv = &types.ServerSideEncryptionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "metadataField": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) - } - sv.MetadataField = ptr.String(jtv) - } - - case "textField": + case "kmsKeyArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) } - sv.TextField = ptr.String(jtv) + sv.KmsKeyArn = ptr.String(jtv) } default: @@ -10394,7 +19228,7 @@ func awsRestjson1_deserializeDocumentPineconeFieldMapping(v **types.PineconeFiel return nil } -func awsRestjson1_deserializeDocumentPromptConfiguration(v **types.PromptConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10407,63 +19241,22 @@ func awsRestjson1_deserializeDocumentPromptConfiguration(v **types.PromptConfigu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PromptConfiguration + var sv *types.ServiceQuotaExceededException if *v == nil { - sv = &types.PromptConfiguration{} + sv = &types.ServiceQuotaExceededException{} } else { sv = *v } for key, value := range shape { switch key { - case "basePromptTemplate": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BasePromptTemplate to be of type string, got %T instead", value) - } - sv.BasePromptTemplate = ptr.String(jtv) - } - - case "inferenceConfiguration": - if err := awsRestjson1_deserializeDocumentInferenceConfiguration(&sv.InferenceConfiguration, value); err != nil { - return err - } - - case "parserMode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CreationMode to be of type string, got %T instead", value) - } - sv.ParserMode = types.CreationMode(jtv) - } - - case "promptCreationMode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CreationMode to be of type string, got %T instead", value) - } - sv.PromptCreationMode = types.CreationMode(jtv) - } - - case "promptState": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PromptState to be of type string, got %T instead", value) - } - sv.PromptState = types.PromptState(jtv) - } - - case "promptType": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PromptType to be of type string, got %T instead", value) + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) } - sv.PromptType = types.PromptType(jtv) + sv.Message = ptr.String(jtv) } default: @@ -10475,7 +19268,7 @@ func awsRestjson1_deserializeDocumentPromptConfiguration(v **types.PromptConfigu return nil } -func awsRestjson1_deserializeDocumentPromptConfigurations(v *[]types.PromptConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentSharePointCrawlerConfiguration(v **types.SharePointCrawlerConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10483,33 +19276,35 @@ func awsRestjson1_deserializeDocumentPromptConfigurations(v *[]types.PromptConfi return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.PromptConfiguration + var sv *types.SharePointCrawlerConfiguration if *v == nil { - cv = []types.PromptConfiguration{} + sv = &types.SharePointCrawlerConfiguration{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.PromptConfiguration - destAddr := &col - if err := awsRestjson1_deserializeDocumentPromptConfiguration(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "filterConfiguration": + if err := awsRestjson1_deserializeDocumentCrawlFilterConfiguration(&sv.FilterConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentPromptOverrideConfiguration(v **types.PromptOverrideConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentSharePointDataSourceConfiguration(v **types.SharePointDataSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10522,26 +19317,22 @@ func awsRestjson1_deserializeDocumentPromptOverrideConfiguration(v **types.Promp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PromptOverrideConfiguration + var sv *types.SharePointDataSourceConfiguration if *v == nil { - sv = &types.PromptOverrideConfiguration{} + sv = &types.SharePointDataSourceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "overrideLambda": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LambdaArn to be of type string, got %T instead", value) - } - sv.OverrideLambda = ptr.String(jtv) + case "crawlerConfiguration": + if err := awsRestjson1_deserializeDocumentSharePointCrawlerConfiguration(&sv.CrawlerConfiguration, value); err != nil { + return err } - case "promptConfigurations": - if err := awsRestjson1_deserializeDocumentPromptConfigurations(&sv.PromptConfigurations, value); err != nil { + case "sourceConfiguration": + if err := awsRestjson1_deserializeDocumentSharePointSourceConfiguration(&sv.SourceConfiguration, value); err != nil { return err } @@ -10554,7 +19345,7 @@ func awsRestjson1_deserializeDocumentPromptOverrideConfiguration(v **types.Promp return nil } -func awsRestjson1_deserializeDocumentRdsConfiguration(v **types.RdsConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentSharePointSiteUrls(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10562,71 +19353,35 @@ func awsRestjson1_deserializeDocumentRdsConfiguration(v **types.RdsConfiguration return nil } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RdsConfiguration - if *v == nil { - sv = &types.RdsConfiguration{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "credentialsSecretArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) - } - sv.CredentialsSecretArn = ptr.String(jtv) - } - - case "databaseName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RdsDatabaseName to be of type string, got %T instead", value) - } - sv.DatabaseName = ptr.String(jtv) - } - - case "fieldMapping": - if err := awsRestjson1_deserializeDocumentRdsFieldMapping(&sv.FieldMapping, value); err != nil { - return err - } - - case "resourceArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RdsArn to be of type string, got %T instead", value) - } - sv.ResourceArn = ptr.String(jtv) - } - - case "tableName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RdsTableName to be of type string, got %T instead", value) - } - sv.TableName = ptr.String(jtv) - } + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - default: - _, _ = key, value + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HttpsUrl to be of type string, got %T instead", value) + } + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentRdsFieldMapping(v **types.RdsFieldMapping, value interface{}) error { +func awsRestjson1_deserializeDocumentSharePointSourceConfiguration(v **types.SharePointSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10639,49 +19394,63 @@ func awsRestjson1_deserializeDocumentRdsFieldMapping(v **types.RdsFieldMapping, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RdsFieldMapping + var sv *types.SharePointSourceConfiguration if *v == nil { - sv = &types.RdsFieldMapping{} + sv = &types.SharePointSourceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "metadataField": + case "authType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + return fmt.Errorf("expected SharePointAuthType to be of type string, got %T instead", value) } - sv.MetadataField = ptr.String(jtv) + sv.AuthType = types.SharePointAuthType(jtv) } - case "primaryKeyField": + case "credentialsSecretArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) } - sv.PrimaryKeyField = ptr.String(jtv) + sv.CredentialsSecretArn = ptr.String(jtv) } - case "textField": + case "domain": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + return fmt.Errorf("expected SharePointDomain to be of type string, got %T instead", value) } - sv.TextField = ptr.String(jtv) + sv.Domain = ptr.String(jtv) } - case "vectorField": + case "hostType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + return fmt.Errorf("expected SharePointHostType to be of type string, got %T instead", value) } - sv.VectorField = ptr.String(jtv) + sv.HostType = types.SharePointHostType(jtv) + } + + case "siteUrls": + if err := awsRestjson1_deserializeDocumentSharePointSiteUrls(&sv.SiteUrls, value); err != nil { + return err + } + + case "tenantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Microsoft365TenantId to be of type string, got %T instead", value) + } + sv.TenantId = ptr.String(jtv) } default: @@ -10693,7 +19462,7 @@ func awsRestjson1_deserializeDocumentRdsFieldMapping(v **types.RdsFieldMapping, return nil } -func awsRestjson1_deserializeDocumentRecommendedActions(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentStopSequences(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10718,7 +19487,7 @@ func awsRestjson1_deserializeDocumentRecommendedActions(v *[]string, value inter if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RecommendedAction to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } col = jtv } @@ -10729,7 +19498,7 @@ func awsRestjson1_deserializeDocumentRecommendedActions(v *[]string, value inter return nil } -func awsRestjson1_deserializeDocumentRedisEnterpriseCloudConfiguration(v **types.RedisEnterpriseCloudConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentStorageConfiguration(v **types.StorageConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10742,45 +19511,47 @@ func awsRestjson1_deserializeDocumentRedisEnterpriseCloudConfiguration(v **types return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RedisEnterpriseCloudConfiguration + var sv *types.StorageConfiguration if *v == nil { - sv = &types.RedisEnterpriseCloudConfiguration{} + sv = &types.StorageConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "credentialsSecretArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) - } - sv.CredentialsSecretArn = ptr.String(jtv) + case "mongoDbAtlasConfiguration": + if err := awsRestjson1_deserializeDocumentMongoDbAtlasConfiguration(&sv.MongoDbAtlasConfiguration, value); err != nil { + return err } - case "endpoint": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RedisEnterpriseCloudEndpoint to be of type string, got %T instead", value) - } - sv.Endpoint = ptr.String(jtv) + case "opensearchServerlessConfiguration": + if err := awsRestjson1_deserializeDocumentOpenSearchServerlessConfiguration(&sv.OpensearchServerlessConfiguration, value); err != nil { + return err } - case "fieldMapping": - if err := awsRestjson1_deserializeDocumentRedisEnterpriseCloudFieldMapping(&sv.FieldMapping, value); err != nil { + case "pineconeConfiguration": + if err := awsRestjson1_deserializeDocumentPineconeConfiguration(&sv.PineconeConfiguration, value); err != nil { return err } - case "vectorIndexName": + case "rdsConfiguration": + if err := awsRestjson1_deserializeDocumentRdsConfiguration(&sv.RdsConfiguration, value); err != nil { + return err + } + + case "redisEnterpriseCloudConfiguration": + if err := awsRestjson1_deserializeDocumentRedisEnterpriseCloudConfiguration(&sv.RedisEnterpriseCloudConfiguration, value); err != nil { + return err + } + + case "type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RedisEnterpriseCloudIndexName to be of type string, got %T instead", value) + return fmt.Errorf("expected KnowledgeBaseStorageType to be of type string, got %T instead", value) } - sv.VectorIndexName = ptr.String(jtv) + sv.Type = types.KnowledgeBaseStorageType(jtv) } default: @@ -10792,7 +19563,7 @@ func awsRestjson1_deserializeDocumentRedisEnterpriseCloudConfiguration(v **types return nil } -func awsRestjson1_deserializeDocumentRedisEnterpriseCloudFieldMapping(v **types.RedisEnterpriseCloudFieldMapping, value interface{}) error { +func awsRestjson1_deserializeDocumentStorageFlowNodeConfiguration(v **types.StorageFlowNodeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10805,40 +19576,18 @@ func awsRestjson1_deserializeDocumentRedisEnterpriseCloudFieldMapping(v **types. return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RedisEnterpriseCloudFieldMapping + var sv *types.StorageFlowNodeConfiguration if *v == nil { - sv = &types.RedisEnterpriseCloudFieldMapping{} + sv = &types.StorageFlowNodeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "metadataField": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) - } - sv.MetadataField = ptr.String(jtv) - } - - case "textField": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) - } - sv.TextField = ptr.String(jtv) - } - - case "vectorField": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) - } - sv.VectorField = ptr.String(jtv) + case "serviceConfiguration": + if err := awsRestjson1_deserializeDocumentStorageFlowNodeServiceConfiguration(&sv.ServiceConfiguration, value); err != nil { + return err } default: @@ -10850,7 +19599,7 @@ func awsRestjson1_deserializeDocumentRedisEnterpriseCloudFieldMapping(v **types. return nil } -func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { +func awsRestjson1_deserializeDocumentStorageFlowNodeS3Configuration(v **types.StorageFlowNodeS3Configuration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10863,22 +19612,22 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceNotFoundException + var sv *types.StorageFlowNodeS3Configuration if *v == nil { - sv = &types.ResourceNotFoundException{} + sv = &types.StorageFlowNodeS3Configuration{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "bucketName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.BucketName = ptr.String(jtv) } default: @@ -10890,7 +19639,7 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } -func awsRestjson1_deserializeDocumentS3DataSourceConfiguration(v **types.S3DataSourceConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentStorageFlowNodeServiceConfiguration(v *types.StorageFlowNodeServiceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10903,48 +19652,34 @@ func awsRestjson1_deserializeDocumentS3DataSourceConfiguration(v **types.S3DataS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.S3DataSourceConfiguration - if *v == nil { - sv = &types.S3DataSourceConfiguration{} - } else { - sv = *v - } - + var uv types.StorageFlowNodeServiceConfiguration +loop: for key, value := range shape { + if value == nil { + continue + } switch key { - case "bucketArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected S3BucketArn to be of type string, got %T instead", value) - } - sv.BucketArn = ptr.String(jtv) - } - - case "bucketOwnerAccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BucketOwnerAccountId to be of type string, got %T instead", value) - } - sv.BucketOwnerAccountId = ptr.String(jtv) - } - - case "inclusionPrefixes": - if err := awsRestjson1_deserializeDocumentS3Prefixes(&sv.InclusionPrefixes, value); err != nil { + case "s3": + var mv types.StorageFlowNodeS3Configuration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentStorageFlowNodeS3Configuration(&destAddr, value); err != nil { return err } + mv = *destAddr + uv = &types.StorageFlowNodeServiceConfigurationMemberS3{Value: mv} + break loop default: - _, _ = key, value + uv = &types.UnknownUnionMember{Tag: key} + break loop } } - *v = sv + *v = uv return nil } -func awsRestjson1_deserializeDocumentS3Identifier(v **types.S3Identifier, value interface{}) error { +func awsRestjson1_deserializeDocumentTagsMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10957,43 +19692,30 @@ func awsRestjson1_deserializeDocumentS3Identifier(v **types.S3Identifier, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.S3Identifier + var mv map[string]string if *v == nil { - sv = &types.S3Identifier{} + mv = map[string]string{} } else { - sv = *v + mv = *v } for key, value := range shape { - switch key { - case "s3BucketName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value) - } - sv.S3BucketName = ptr.String(jtv) - } - - case "s3ObjectKey": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected S3ObjectKey to be of type string, got %T instead", value) - } - sv.S3ObjectKey = ptr.String(jtv) + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + parsedVal = jtv } + mv[key] = parsedVal + } - *v = sv + *v = mv return nil } -func awsRestjson1_deserializeDocumentS3Prefixes(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentTextPromptTemplateConfiguration(v **types.TextPromptTemplateConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11001,35 +19723,44 @@ func awsRestjson1_deserializeDocumentS3Prefixes(v *[]string, value interface{}) return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.TextPromptTemplateConfiguration if *v == nil { - cv = []string{} + sv = &types.TextPromptTemplateConfiguration{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected S3Prefix to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "inputVariables": + if err := awsRestjson1_deserializeDocumentPromptInputVariablesList(&sv.InputVariables, value); err != nil { + return err } - col = jtv - } - cv = append(cv, col) + case "text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TextPrompt to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } + + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(v **types.ServerSideEncryptionConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11042,22 +19773,22 @@ func awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(v **types return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ServerSideEncryptionConfiguration + var sv *types.ThrottlingException if *v == nil { - sv = &types.ServerSideEncryptionConfiguration{} + sv = &types.ThrottlingException{} } else { sv = *v } for key, value := range shape { switch key { - case "kmsKeyArn": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) } - sv.KmsKeyArn = ptr.String(jtv) + sv.Message = ptr.String(jtv) } default: @@ -11069,7 +19800,7 @@ func awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(v **types return nil } -func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { +func awsRestjson1_deserializeDocumentTransformation(v **types.Transformation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11082,22 +19813,27 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ServiceQuotaExceededException + var sv *types.Transformation if *v == nil { - sv = &types.ServiceQuotaExceededException{} + sv = &types.Transformation{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "stepToApply": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + return fmt.Errorf("expected StepType to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.StepToApply = types.StepType(jtv) + } + + case "transformationFunction": + if err := awsRestjson1_deserializeDocumentTransformationFunction(&sv.TransformationFunction, value); err != nil { + return err } default: @@ -11109,7 +19845,7 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } -func awsRestjson1_deserializeDocumentStopSequences(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentTransformationFunction(v **types.TransformationFunction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11117,35 +19853,35 @@ func awsRestjson1_deserializeDocumentStopSequences(v *[]string, value interface{ return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.TransformationFunction if *v == nil { - cv = []string{} + sv = &types.TransformationFunction{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "transformationLambdaConfiguration": + if err := awsRestjson1_deserializeDocumentTransformationLambdaConfiguration(&sv.TransformationLambdaConfiguration, value); err != nil { + return err } - col = jtv - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentStorageConfiguration(v **types.StorageConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentTransformationLambdaConfiguration(v **types.TransformationLambdaConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11158,47 +19894,22 @@ func awsRestjson1_deserializeDocumentStorageConfiguration(v **types.StorageConfi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.StorageConfiguration + var sv *types.TransformationLambdaConfiguration if *v == nil { - sv = &types.StorageConfiguration{} + sv = &types.TransformationLambdaConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "mongoDbAtlasConfiguration": - if err := awsRestjson1_deserializeDocumentMongoDbAtlasConfiguration(&sv.MongoDbAtlasConfiguration, value); err != nil { - return err - } - - case "opensearchServerlessConfiguration": - if err := awsRestjson1_deserializeDocumentOpenSearchServerlessConfiguration(&sv.OpensearchServerlessConfiguration, value); err != nil { - return err - } - - case "pineconeConfiguration": - if err := awsRestjson1_deserializeDocumentPineconeConfiguration(&sv.PineconeConfiguration, value); err != nil { - return err - } - - case "rdsConfiguration": - if err := awsRestjson1_deserializeDocumentRdsConfiguration(&sv.RdsConfiguration, value); err != nil { - return err - } - - case "redisEnterpriseCloudConfiguration": - if err := awsRestjson1_deserializeDocumentRedisEnterpriseCloudConfiguration(&sv.RedisEnterpriseCloudConfiguration, value); err != nil { - return err - } - - case "type": + case "lambdaArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KnowledgeBaseStorageType to be of type string, got %T instead", value) + return fmt.Errorf("expected LambdaArn to be of type string, got %T instead", value) } - sv.Type = types.KnowledgeBaseStorageType(jtv) + sv.LambdaArn = ptr.String(jtv) } default: @@ -11210,7 +19921,7 @@ func awsRestjson1_deserializeDocumentStorageConfiguration(v **types.StorageConfi return nil } -func awsRestjson1_deserializeDocumentTagsMap(v *map[string]string, value interface{}) error { +func awsRestjson1_deserializeDocumentTransformations(v *[]types.Transformation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11218,35 +19929,33 @@ func awsRestjson1_deserializeDocumentTagsMap(v *map[string]string, value interfa return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]string + var cv []types.Transformation if *v == nil { - mv = map[string]string{} + cv = []types.Transformation{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) - } - parsedVal = jtv + for _, value := range shape { + var col types.Transformation + destAddr := &col + if err := awsRestjson1_deserializeDocumentTransformation(&destAddr, value); err != nil { + return err } - mv[key] = parsedVal + col = *destAddr + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { +func awsRestjson1_deserializeDocumentUrlConfiguration(v **types.UrlConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11259,22 +19968,18 @@ func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingExc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ThrottlingException + var sv *types.UrlConfiguration if *v == nil { - sv = &types.ThrottlingException{} + sv = &types.UrlConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "seedUrls": + if err := awsRestjson1_deserializeDocumentSeedUrls(&sv.SeedUrls, value); err != nil { + return err } default: @@ -11441,6 +20146,16 @@ func awsRestjson1_deserializeDocumentVectorIngestionConfiguration(v **types.Vect return err } + case "customTransformationConfiguration": + if err := awsRestjson1_deserializeDocumentCustomTransformationConfiguration(&sv.CustomTransformationConfiguration, value); err != nil { + return err + } + + case "parsingConfiguration": + if err := awsRestjson1_deserializeDocumentParsingConfiguration(&sv.ParsingConfiguration, value); err != nil { + return err + } + default: _, _ = key, value @@ -11494,3 +20209,179 @@ func awsRestjson1_deserializeDocumentVectorKnowledgeBaseConfiguration(v **types. *v = sv return nil } + +func awsRestjson1_deserializeDocumentWebCrawlerConfiguration(v **types.WebCrawlerConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.WebCrawlerConfiguration + if *v == nil { + sv = &types.WebCrawlerConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "crawlerLimits": + if err := awsRestjson1_deserializeDocumentWebCrawlerLimits(&sv.CrawlerLimits, value); err != nil { + return err + } + + case "exclusionFilters": + if err := awsRestjson1_deserializeDocumentFilterList(&sv.ExclusionFilters, value); err != nil { + return err + } + + case "inclusionFilters": + if err := awsRestjson1_deserializeDocumentFilterList(&sv.InclusionFilters, value); err != nil { + return err + } + + case "scope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WebScopeType to be of type string, got %T instead", value) + } + sv.Scope = types.WebScopeType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWebCrawlerLimits(v **types.WebCrawlerLimits, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.WebCrawlerLimits + if *v == nil { + sv = &types.WebCrawlerLimits{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "rateLimit": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RateLimit = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWebDataSourceConfiguration(v **types.WebDataSourceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.WebDataSourceConfiguration + if *v == nil { + sv = &types.WebDataSourceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "crawlerConfiguration": + if err := awsRestjson1_deserializeDocumentWebCrawlerConfiguration(&sv.CrawlerConfiguration, value); err != nil { + return err + } + + case "sourceConfiguration": + if err := awsRestjson1_deserializeDocumentWebSourceConfiguration(&sv.SourceConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWebSourceConfiguration(v **types.WebSourceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.WebSourceConfiguration + if *v == nil { + sv = &types.WebSourceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "urlConfiguration": + if err := awsRestjson1_deserializeDocumentUrlConfiguration(&sv.UrlConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/bedrockagent/generated.json b/service/bedrockagent/generated.json index c97087f4d85..c516c308deb 100644 --- a/service/bedrockagent/generated.json +++ b/service/bedrockagent/generated.json @@ -13,13 +13,22 @@ "api_op_CreateAgentActionGroup.go", "api_op_CreateAgentAlias.go", "api_op_CreateDataSource.go", + "api_op_CreateFlow.go", + "api_op_CreateFlowAlias.go", + "api_op_CreateFlowVersion.go", "api_op_CreateKnowledgeBase.go", + "api_op_CreatePrompt.go", + "api_op_CreatePromptVersion.go", "api_op_DeleteAgent.go", "api_op_DeleteAgentActionGroup.go", "api_op_DeleteAgentAlias.go", "api_op_DeleteAgentVersion.go", "api_op_DeleteDataSource.go", + "api_op_DeleteFlow.go", + "api_op_DeleteFlowAlias.go", + "api_op_DeleteFlowVersion.go", "api_op_DeleteKnowledgeBase.go", + "api_op_DeletePrompt.go", "api_op_DisassociateAgentKnowledgeBase.go", "api_op_GetAgent.go", "api_op_GetAgentActionGroup.go", @@ -27,18 +36,27 @@ "api_op_GetAgentKnowledgeBase.go", "api_op_GetAgentVersion.go", "api_op_GetDataSource.go", + "api_op_GetFlow.go", + "api_op_GetFlowAlias.go", + "api_op_GetFlowVersion.go", "api_op_GetIngestionJob.go", "api_op_GetKnowledgeBase.go", + "api_op_GetPrompt.go", "api_op_ListAgentActionGroups.go", "api_op_ListAgentAliases.go", "api_op_ListAgentKnowledgeBases.go", "api_op_ListAgentVersions.go", "api_op_ListAgents.go", "api_op_ListDataSources.go", + "api_op_ListFlowAliases.go", + "api_op_ListFlowVersions.go", + "api_op_ListFlows.go", "api_op_ListIngestionJobs.go", "api_op_ListKnowledgeBases.go", + "api_op_ListPrompts.go", "api_op_ListTagsForResource.go", "api_op_PrepareAgent.go", + "api_op_PrepareFlow.go", "api_op_StartIngestionJob.go", "api_op_TagResource.go", "api_op_UntagResource.go", @@ -47,7 +65,10 @@ "api_op_UpdateAgentAlias.go", "api_op_UpdateAgentKnowledgeBase.go", "api_op_UpdateDataSource.go", + "api_op_UpdateFlow.go", + "api_op_UpdateFlowAlias.go", "api_op_UpdateKnowledgeBase.go", + "api_op_UpdatePrompt.go", "auth.go", "deserializers.go", "doc.go", diff --git a/service/bedrockagent/serializers.go b/service/bedrockagent/serializers.go index c81a5111c0a..56ba04b0aca 100644 --- a/service/bedrockagent/serializers.go +++ b/service/bedrockagent/serializers.go @@ -236,6 +236,13 @@ func awsRestjson1_serializeOpDocumentCreateAgentInput(v *CreateAgentInput, value ok.String(*v.Instruction) } + if v.MemoryConfiguration != nil { + ok := object.Key("memoryConfiguration") + if err := awsRestjson1_serializeDocumentMemoryConfiguration(v.MemoryConfiguration, ok); err != nil { + return err + } + } + if v.PromptOverrideConfiguration != nil { ok := object.Key("promptOverrideConfiguration") if err := awsRestjson1_serializeDocumentPromptOverrideConfiguration(v.PromptOverrideConfiguration, ok); err != nil { @@ -627,14 +634,14 @@ func awsRestjson1_serializeOpDocumentCreateDataSourceInput(v *CreateDataSourceIn return nil } -type awsRestjson1_serializeOpCreateKnowledgeBase struct { +type awsRestjson1_serializeOpCreateFlow struct { } -func (*awsRestjson1_serializeOpCreateKnowledgeBase) ID() string { +func (*awsRestjson1_serializeOpCreateFlow) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpCreateKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateFlow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -642,16 +649,16 @@ func (m *awsRestjson1_serializeOpCreateKnowledgeBase) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateKnowledgeBaseInput) + input, ok := in.Parameters.(*CreateFlowInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/") + opPath, opQuery := httpbinding.SplitURI("/flows/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -667,7 +674,7 @@ func (m *awsRestjson1_serializeOpCreateKnowledgeBase) HandleSerialize(ctx contex restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentCreateFlowInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -682,7 +689,7 @@ func (m *awsRestjson1_serializeOpCreateKnowledgeBase) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateFlowInput(v *CreateFlowInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -690,7 +697,7 @@ func awsRestjson1_serializeOpHttpBindingsCreateKnowledgeBaseInput(v *CreateKnowl return nil } -func awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentCreateFlowInput(v *CreateFlowInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -699,33 +706,31 @@ func awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(v *CreateKnowledge ok.String(*v.ClientToken) } - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) + if v.CustomerEncryptionKeyArn != nil { + ok := object.Key("customerEncryptionKeyArn") + ok.String(*v.CustomerEncryptionKeyArn) } - if v.KnowledgeBaseConfiguration != nil { - ok := object.Key("knowledgeBaseConfiguration") - if err := awsRestjson1_serializeDocumentKnowledgeBaseConfiguration(v.KnowledgeBaseConfiguration, ok); err != nil { + if v.Definition != nil { + ok := object.Key("definition") + if err := awsRestjson1_serializeDocumentFlowDefinition(v.Definition, ok); err != nil { return err } } - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) } - if v.RoleArn != nil { - ok := object.Key("roleArn") - ok.String(*v.RoleArn) + if v.ExecutionRoleArn != nil { + ok := object.Key("executionRoleArn") + ok.String(*v.ExecutionRoleArn) } - if v.StorageConfiguration != nil { - ok := object.Key("storageConfiguration") - if err := awsRestjson1_serializeDocumentStorageConfiguration(v.StorageConfiguration, ok); err != nil { - return err - } + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) } if v.Tags != nil { @@ -738,14 +743,14 @@ func awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(v *CreateKnowledge return nil } -type awsRestjson1_serializeOpDeleteAgent struct { +type awsRestjson1_serializeOpCreateFlowAlias struct { } -func (*awsRestjson1_serializeOpDeleteAgent) ID() string { +func (*awsRestjson1_serializeOpCreateFlowAlias) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateFlowAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -753,16 +758,16 @@ func (m *awsRestjson1_serializeOpDeleteAgent) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteAgentInput) + input, ok := in.Parameters.(*CreateFlowAliasInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/") + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/aliases") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -775,7 +780,18 @@ func (m *awsRestjson1_serializeOpDeleteAgent) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteAgentInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsCreateFlowAliasInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateFlowAliasInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -786,35 +802,67 @@ func (m *awsRestjson1_serializeOpDeleteAgent) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteAgentInput(v *DeleteAgentInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateFlowAliasInput(v *CreateFlowAliasInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AgentId == nil || len(*v.AgentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} } - if v.AgentId != nil { - if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { return err } } - if v.SkipResourceInUseCheck { - encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck) + return nil +} + +func awsRestjson1_serializeOpDocumentCreateFlowAliasInput(v *CreateFlowAliasInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.RoutingConfiguration != nil { + ok := object.Key("routingConfiguration") + if err := awsRestjson1_serializeDocumentFlowAliasRoutingConfiguration(v.RoutingConfiguration, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpDeleteAgentActionGroup struct { +type awsRestjson1_serializeOpCreateFlowVersion struct { } -func (*awsRestjson1_serializeOpDeleteAgentActionGroup) ID() string { +func (*awsRestjson1_serializeOpCreateFlowVersion) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteAgentActionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateFlowVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -822,16 +870,16 @@ func (m *awsRestjson1_serializeOpDeleteAgentActionGroup) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteAgentActionGroupInput) + input, ok := in.Parameters.(*CreateFlowVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/") + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/versions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -844,7 +892,18 @@ func (m *awsRestjson1_serializeOpDeleteAgentActionGroup) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteAgentActionGroupInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsCreateFlowVersionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateFlowVersionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -855,53 +914,48 @@ func (m *awsRestjson1_serializeOpDeleteAgentActionGroup) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteAgentActionGroupInput(v *DeleteAgentActionGroupInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateFlowVersionInput(v *CreateFlowVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ActionGroupId == nil || len(*v.ActionGroupId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member actionGroupId must not be empty")} + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} } - if v.ActionGroupId != nil { - if err := encoder.SetURI("actionGroupId").String(*v.ActionGroupId); err != nil { + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { return err } } - if v.AgentId == nil || len(*v.AgentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} - } - if v.AgentId != nil { - if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { - return err - } - } + return nil +} - if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} - } - if v.AgentVersion != nil { - if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { - return err - } +func awsRestjson1_serializeOpDocumentCreateFlowVersionInput(v *CreateFlowVersionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) } - if v.SkipResourceInUseCheck { - encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck) + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) } return nil } -type awsRestjson1_serializeOpDeleteAgentAlias struct { +type awsRestjson1_serializeOpCreateKnowledgeBase struct { } -func (*awsRestjson1_serializeOpDeleteAgentAlias) ID() string { +func (*awsRestjson1_serializeOpCreateKnowledgeBase) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteAgentAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -909,16 +963,16 @@ func (m *awsRestjson1_serializeOpDeleteAgentAlias) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteAgentAliasInput) + input, ok := in.Parameters.(*CreateKnowledgeBaseInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentaliases/{agentAliasId}/") + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -931,7 +985,14 @@ func (m *awsRestjson1_serializeOpDeleteAgentAlias) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteAgentAliasInput(input, restEncoder); err != nil { + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -942,25 +1003,55 @@ func (m *awsRestjson1_serializeOpDeleteAgentAlias) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteAgentAliasInput(v *DeleteAgentAliasInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AgentAliasId == nil || len(*v.AgentAliasId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentAliasId must not be empty")} + return nil +} + +func awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) } - if v.AgentAliasId != nil { - if err := encoder.SetURI("agentAliasId").String(*v.AgentAliasId); err != nil { + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.KnowledgeBaseConfiguration != nil { + ok := object.Key("knowledgeBaseConfiguration") + if err := awsRestjson1_serializeDocumentKnowledgeBaseConfiguration(v.KnowledgeBaseConfiguration, ok); err != nil { return err } } - if v.AgentId == nil || len(*v.AgentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) } - if v.AgentId != nil { - if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + + if v.RoleArn != nil { + ok := object.Key("roleArn") + ok.String(*v.RoleArn) + } + + if v.StorageConfiguration != nil { + ok := object.Key("storageConfiguration") + if err := awsRestjson1_serializeDocumentStorageConfiguration(v.StorageConfiguration, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { return err } } @@ -968,14 +1059,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteAgentAliasInput(v *DeleteAgentAli return nil } -type awsRestjson1_serializeOpDeleteAgentVersion struct { +type awsRestjson1_serializeOpCreatePrompt struct { } -func (*awsRestjson1_serializeOpDeleteAgentVersion) ID() string { +func (*awsRestjson1_serializeOpCreatePrompt) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteAgentVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreatePrompt) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -983,16 +1074,16 @@ func (m *awsRestjson1_serializeOpDeleteAgentVersion) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteAgentVersionInput) + input, ok := in.Parameters.(*CreatePromptInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/") + opPath, opQuery := httpbinding.SplitURI("/prompts/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1005,7 +1096,14 @@ func (m *awsRestjson1_serializeOpDeleteAgentVersion) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteAgentVersionInput(input, restEncoder); err != nil { + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreatePromptInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1016,44 +1114,68 @@ func (m *awsRestjson1_serializeOpDeleteAgentVersion) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteAgentVersionInput(v *DeleteAgentVersionInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreatePromptInput(v *CreatePromptInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AgentId == nil || len(*v.AgentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + return nil +} + +func awsRestjson1_serializeOpDocumentCreatePromptInput(v *CreatePromptInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) } - if v.AgentId != nil { - if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { - return err - } + + if v.CustomerEncryptionKeyArn != nil { + ok := object.Key("customerEncryptionKeyArn") + ok.String(*v.CustomerEncryptionKeyArn) } - if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} + if v.DefaultVariant != nil { + ok := object.Key("defaultVariant") + ok.String(*v.DefaultVariant) } - if v.AgentVersion != nil { - if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { return err } } - if v.SkipResourceInUseCheck { - encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck) + if v.Variants != nil { + ok := object.Key("variants") + if err := awsRestjson1_serializeDocumentPromptVariantList(v.Variants, ok); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpDeleteDataSource struct { +type awsRestjson1_serializeOpCreatePromptVersion struct { } -func (*awsRestjson1_serializeOpDeleteDataSource) ID() string { +func (*awsRestjson1_serializeOpCreatePromptVersion) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteDataSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreatePromptVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1061,16 +1183,16 @@ func (m *awsRestjson1_serializeOpDeleteDataSource) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteDataSourceInput) + input, ok := in.Parameters.(*CreatePromptVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}") + opPath, opQuery := httpbinding.SplitURI("/prompts/{promptIdentifier}/versions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1083,7 +1205,18 @@ func (m *awsRestjson1_serializeOpDeleteDataSource) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteDataSourceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsCreatePromptVersionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreatePromptVersionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1094,25 +1227,40 @@ func (m *awsRestjson1_serializeOpDeleteDataSource) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteDataSourceInput(v *DeleteDataSourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreatePromptVersionInput(v *CreatePromptVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.DataSourceId == nil || len(*v.DataSourceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member dataSourceId must not be empty")} + if v.PromptIdentifier == nil || len(*v.PromptIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member promptIdentifier must not be empty")} } - if v.DataSourceId != nil { - if err := encoder.SetURI("dataSourceId").String(*v.DataSourceId); err != nil { + if v.PromptIdentifier != nil { + if err := encoder.SetURI("promptIdentifier").String(*v.PromptIdentifier); err != nil { return err } } - if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + return nil +} + +func awsRestjson1_serializeOpDocumentCreatePromptVersionInput(v *CreatePromptVersionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { return err } } @@ -1120,14 +1268,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteDataSourceInput(v *DeleteDataSour return nil } -type awsRestjson1_serializeOpDeleteKnowledgeBase struct { +type awsRestjson1_serializeOpDeleteAgent struct { } -func (*awsRestjson1_serializeOpDeleteKnowledgeBase) ID() string { +func (*awsRestjson1_serializeOpDeleteAgent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1135,13 +1283,13 @@ func (m *awsRestjson1_serializeOpDeleteKnowledgeBase) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteKnowledgeBaseInput) + input, ok := in.Parameters.(*DeleteAgentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -1157,7 +1305,7 @@ func (m *awsRestjson1_serializeOpDeleteKnowledgeBase) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteKnowledgeBaseInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteAgentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1168,31 +1316,35 @@ func (m *awsRestjson1_serializeOpDeleteKnowledgeBase) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteKnowledgeBaseInput(v *DeleteKnowledgeBaseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteAgentInput(v *DeleteAgentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { return err } } + if v.SkipResourceInUseCheck { + encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck) + } + return nil } -type awsRestjson1_serializeOpDisassociateAgentKnowledgeBase struct { +type awsRestjson1_serializeOpDeleteAgentActionGroup struct { } -func (*awsRestjson1_serializeOpDisassociateAgentKnowledgeBase) ID() string { +func (*awsRestjson1_serializeOpDeleteAgentActionGroup) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDisassociateAgentKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteAgentActionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1200,13 +1352,13 @@ func (m *awsRestjson1_serializeOpDisassociateAgentKnowledgeBase) HandleSerialize return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DisassociateAgentKnowledgeBaseInput) + input, ok := in.Parameters.(*DeleteAgentActionGroupInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -1222,7 +1374,7 @@ func (m *awsRestjson1_serializeOpDisassociateAgentKnowledgeBase) HandleSerialize return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDisassociateAgentKnowledgeBaseInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteAgentActionGroupInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1233,11 +1385,20 @@ func (m *awsRestjson1_serializeOpDisassociateAgentKnowledgeBase) HandleSerialize return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDisassociateAgentKnowledgeBaseInput(v *DisassociateAgentKnowledgeBaseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteAgentActionGroupInput(v *DeleteAgentActionGroupInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } + if v.ActionGroupId == nil || len(*v.ActionGroupId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member actionGroupId must not be empty")} + } + if v.ActionGroupId != nil { + if err := encoder.SetURI("actionGroupId").String(*v.ActionGroupId); err != nil { + return err + } + } + if v.AgentId == nil || len(*v.AgentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} } @@ -1256,26 +1417,21 @@ func awsRestjson1_serializeOpHttpBindingsDisassociateAgentKnowledgeBaseInput(v * } } - if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} - } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { - return err - } + if v.SkipResourceInUseCheck { + encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck) } return nil } -type awsRestjson1_serializeOpGetAgent struct { +type awsRestjson1_serializeOpDeleteAgentAlias struct { } -func (*awsRestjson1_serializeOpGetAgent) ID() string { +func (*awsRestjson1_serializeOpDeleteAgentAlias) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteAgentAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1283,16 +1439,16 @@ func (m *awsRestjson1_serializeOpGetAgent) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAgentInput) + input, ok := in.Parameters.(*DeleteAgentAliasInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentaliases/{agentAliasId}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1305,7 +1461,7 @@ func (m *awsRestjson1_serializeOpGetAgent) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetAgentInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteAgentAliasInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1316,11 +1472,20 @@ func (m *awsRestjson1_serializeOpGetAgent) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetAgentInput(v *GetAgentInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteAgentAliasInput(v *DeleteAgentAliasInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } + if v.AgentAliasId == nil || len(*v.AgentAliasId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentAliasId must not be empty")} + } + if v.AgentAliasId != nil { + if err := encoder.SetURI("agentAliasId").String(*v.AgentAliasId); err != nil { + return err + } + } + if v.AgentId == nil || len(*v.AgentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} } @@ -1333,14 +1498,14 @@ func awsRestjson1_serializeOpHttpBindingsGetAgentInput(v *GetAgentInput, encoder return nil } -type awsRestjson1_serializeOpGetAgentActionGroup struct { +type awsRestjson1_serializeOpDeleteAgentVersion struct { } -func (*awsRestjson1_serializeOpGetAgentActionGroup) ID() string { +func (*awsRestjson1_serializeOpDeleteAgentVersion) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetAgentActionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteAgentVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1348,16 +1513,16 @@ func (m *awsRestjson1_serializeOpGetAgentActionGroup) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAgentActionGroupInput) + input, ok := in.Parameters.(*DeleteAgentVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1370,7 +1535,7 @@ func (m *awsRestjson1_serializeOpGetAgentActionGroup) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetAgentActionGroupInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteAgentVersionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1381,20 +1546,11 @@ func (m *awsRestjson1_serializeOpGetAgentActionGroup) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetAgentActionGroupInput(v *GetAgentActionGroupInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteAgentVersionInput(v *DeleteAgentVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ActionGroupId == nil || len(*v.ActionGroupId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member actionGroupId must not be empty")} - } - if v.ActionGroupId != nil { - if err := encoder.SetURI("actionGroupId").String(*v.ActionGroupId); err != nil { - return err - } - } - if v.AgentId == nil || len(*v.AgentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} } @@ -1413,17 +1569,21 @@ func awsRestjson1_serializeOpHttpBindingsGetAgentActionGroupInput(v *GetAgentAct } } + if v.SkipResourceInUseCheck { + encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck) + } + return nil } -type awsRestjson1_serializeOpGetAgentAlias struct { +type awsRestjson1_serializeOpDeleteDataSource struct { } -func (*awsRestjson1_serializeOpGetAgentAlias) ID() string { +func (*awsRestjson1_serializeOpDeleteDataSource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetAgentAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteDataSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1431,16 +1591,16 @@ func (m *awsRestjson1_serializeOpGetAgentAlias) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAgentAliasInput) + input, ok := in.Parameters.(*DeleteDataSourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentaliases/{agentAliasId}/") + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1453,7 +1613,7 @@ func (m *awsRestjson1_serializeOpGetAgentAlias) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetAgentAliasInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteDataSourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1464,25 +1624,25 @@ func (m *awsRestjson1_serializeOpGetAgentAlias) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetAgentAliasInput(v *GetAgentAliasInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteDataSourceInput(v *DeleteDataSourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AgentAliasId == nil || len(*v.AgentAliasId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentAliasId must not be empty")} + if v.DataSourceId == nil || len(*v.DataSourceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member dataSourceId must not be empty")} } - if v.AgentAliasId != nil { - if err := encoder.SetURI("agentAliasId").String(*v.AgentAliasId); err != nil { + if v.DataSourceId != nil { + if err := encoder.SetURI("dataSourceId").String(*v.DataSourceId); err != nil { return err } } - if v.AgentId == nil || len(*v.AgentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} } - if v.AgentId != nil { - if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { return err } } @@ -1490,14 +1650,14 @@ func awsRestjson1_serializeOpHttpBindingsGetAgentAliasInput(v *GetAgentAliasInpu return nil } -type awsRestjson1_serializeOpGetAgentKnowledgeBase struct { +type awsRestjson1_serializeOpDeleteFlow struct { } -func (*awsRestjson1_serializeOpGetAgentKnowledgeBase) ID() string { +func (*awsRestjson1_serializeOpDeleteFlow) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetAgentKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteFlow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1505,16 +1665,16 @@ func (m *awsRestjson1_serializeOpGetAgentKnowledgeBase) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAgentKnowledgeBaseInput) + input, ok := in.Parameters.(*DeleteFlowInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/") + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1527,7 +1687,7 @@ func (m *awsRestjson1_serializeOpGetAgentKnowledgeBase) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetAgentKnowledgeBaseInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteFlowInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1538,49 +1698,35 @@ func (m *awsRestjson1_serializeOpGetAgentKnowledgeBase) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetAgentKnowledgeBaseInput(v *GetAgentKnowledgeBaseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteFlowInput(v *DeleteFlowInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AgentId == nil || len(*v.AgentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} - } - if v.AgentId != nil { - if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { - return err - } - } - - if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} } - if v.AgentVersion != nil { - if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { return err } } - if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} - } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { - return err - } + if v.SkipResourceInUseCheck { + encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck) } return nil } -type awsRestjson1_serializeOpGetAgentVersion struct { +type awsRestjson1_serializeOpDeleteFlowAlias struct { } -func (*awsRestjson1_serializeOpGetAgentVersion) ID() string { +func (*awsRestjson1_serializeOpDeleteFlowAlias) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetAgentVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteFlowAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1588,16 +1734,16 @@ func (m *awsRestjson1_serializeOpGetAgentVersion) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAgentVersionInput) + input, ok := in.Parameters.(*DeleteFlowAliasInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/") + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/aliases/{aliasIdentifier}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1610,7 +1756,7 @@ func (m *awsRestjson1_serializeOpGetAgentVersion) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetAgentVersionInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteFlowAliasInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1621,25 +1767,25 @@ func (m *awsRestjson1_serializeOpGetAgentVersion) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetAgentVersionInput(v *GetAgentVersionInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteFlowAliasInput(v *DeleteFlowAliasInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AgentId == nil || len(*v.AgentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + if v.AliasIdentifier == nil || len(*v.AliasIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aliasIdentifier must not be empty")} } - if v.AgentId != nil { - if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + if v.AliasIdentifier != nil { + if err := encoder.SetURI("aliasIdentifier").String(*v.AliasIdentifier); err != nil { return err } } - if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} } - if v.AgentVersion != nil { - if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { return err } } @@ -1647,14 +1793,14 @@ func awsRestjson1_serializeOpHttpBindingsGetAgentVersionInput(v *GetAgentVersion return nil } -type awsRestjson1_serializeOpGetDataSource struct { +type awsRestjson1_serializeOpDeleteFlowVersion struct { } -func (*awsRestjson1_serializeOpGetDataSource) ID() string { +func (*awsRestjson1_serializeOpDeleteFlowVersion) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetDataSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteFlowVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1662,16 +1808,16 @@ func (m *awsRestjson1_serializeOpGetDataSource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetDataSourceInput) + input, ok := in.Parameters.(*DeleteFlowVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}") + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/versions/{flowVersion}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1684,7 +1830,7 @@ func (m *awsRestjson1_serializeOpGetDataSource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetDataSourceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteFlowVersionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1695,40 +1841,44 @@ func (m *awsRestjson1_serializeOpGetDataSource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetDataSourceInput(v *GetDataSourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteFlowVersionInput(v *DeleteFlowVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.DataSourceId == nil || len(*v.DataSourceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member dataSourceId must not be empty")} + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} } - if v.DataSourceId != nil { - if err := encoder.SetURI("dataSourceId").String(*v.DataSourceId); err != nil { + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { return err } } - if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + if v.FlowVersion == nil || len(*v.FlowVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowVersion must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.FlowVersion != nil { + if err := encoder.SetURI("flowVersion").String(*v.FlowVersion); err != nil { return err } } + if v.SkipResourceInUseCheck { + encoder.SetQuery("skipResourceInUseCheck").Boolean(v.SkipResourceInUseCheck) + } + return nil } -type awsRestjson1_serializeOpGetIngestionJob struct { +type awsRestjson1_serializeOpDeleteKnowledgeBase struct { } -func (*awsRestjson1_serializeOpGetIngestionJob) ID() string { +func (*awsRestjson1_serializeOpDeleteKnowledgeBase) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetIngestionJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1736,16 +1886,16 @@ func (m *awsRestjson1_serializeOpGetIngestionJob) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetIngestionJobInput) + input, ok := in.Parameters.(*DeleteKnowledgeBaseInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/{ingestionJobId}") + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1758,7 +1908,7 @@ func (m *awsRestjson1_serializeOpGetIngestionJob) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetIngestionJobInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteKnowledgeBaseInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1769,29 +1919,11 @@ func (m *awsRestjson1_serializeOpGetIngestionJob) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetIngestionJobInput(v *GetIngestionJobInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteKnowledgeBaseInput(v *DeleteKnowledgeBaseInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.DataSourceId == nil || len(*v.DataSourceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member dataSourceId must not be empty")} - } - if v.DataSourceId != nil { - if err := encoder.SetURI("dataSourceId").String(*v.DataSourceId); err != nil { - return err - } - } - - if v.IngestionJobId == nil || len(*v.IngestionJobId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member ingestionJobId must not be empty")} - } - if v.IngestionJobId != nil { - if err := encoder.SetURI("ingestionJobId").String(*v.IngestionJobId); err != nil { - return err - } - } - if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} } @@ -1804,14 +1936,14 @@ func awsRestjson1_serializeOpHttpBindingsGetIngestionJobInput(v *GetIngestionJob return nil } -type awsRestjson1_serializeOpGetKnowledgeBase struct { +type awsRestjson1_serializeOpDeletePrompt struct { } -func (*awsRestjson1_serializeOpGetKnowledgeBase) ID() string { +func (*awsRestjson1_serializeOpDeletePrompt) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeletePrompt) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1819,16 +1951,16 @@ func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetKnowledgeBaseInput) + input, ok := in.Parameters.(*DeletePromptInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}") + opPath, opQuery := httpbinding.SplitURI("/prompts/{promptIdentifier}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1841,7 +1973,7 @@ func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetKnowledgeBaseInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeletePromptInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1852,31 +1984,35 @@ func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetKnowledgeBaseInput(v *GetKnowledgeBaseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeletePromptInput(v *DeletePromptInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + if v.PromptIdentifier == nil || len(*v.PromptIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member promptIdentifier must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.PromptIdentifier != nil { + if err := encoder.SetURI("promptIdentifier").String(*v.PromptIdentifier); err != nil { return err } } + if v.PromptVersion != nil { + encoder.SetQuery("promptVersion").String(*v.PromptVersion) + } + return nil } -type awsRestjson1_serializeOpListAgentActionGroups struct { +type awsRestjson1_serializeOpDisassociateAgentKnowledgeBase struct { } -func (*awsRestjson1_serializeOpListAgentActionGroups) ID() string { +func (*awsRestjson1_serializeOpDisassociateAgentKnowledgeBase) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListAgentActionGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDisassociateAgentKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1884,16 +2020,16 @@ func (m *awsRestjson1_serializeOpListAgentActionGroups) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAgentActionGroupsInput) + input, ok := in.Parameters.(*DisassociateAgentKnowledgeBaseInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/actiongroups/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1906,18 +2042,7 @@ func (m *awsRestjson1_serializeOpListAgentActionGroups) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListAgentActionGroupsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListAgentActionGroupsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDisassociateAgentKnowledgeBaseInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1928,7 +2053,7 @@ func (m *awsRestjson1_serializeOpListAgentActionGroups) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAgentActionGroupsInput(v *ListAgentActionGroupsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDisassociateAgentKnowledgeBaseInput(v *DisassociateAgentKnowledgeBaseInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1951,34 +2076,26 @@ func awsRestjson1_serializeOpHttpBindingsListAgentActionGroupsInput(v *ListAgent } } - return nil -} - -func awsRestjson1_serializeOpDocumentListAgentActionGroupsInput(v *ListAgentActionGroupsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} } - - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpListAgentAliases struct { +type awsRestjson1_serializeOpGetAgent struct { } -func (*awsRestjson1_serializeOpListAgentAliases) ID() string { +func (*awsRestjson1_serializeOpGetAgent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListAgentAliases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1986,16 +2103,16 @@ func (m *awsRestjson1_serializeOpListAgentAliases) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAgentAliasesInput) + input, ok := in.Parameters.(*GetAgentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentaliases/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2008,18 +2125,7 @@ func (m *awsRestjson1_serializeOpListAgentAliases) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListAgentAliasesInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListAgentAliasesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetAgentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2030,7 +2136,7 @@ func (m *awsRestjson1_serializeOpListAgentAliases) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAgentAliasesInput(v *ListAgentAliasesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetAgentInput(v *GetAgentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2047,31 +2153,14 @@ func awsRestjson1_serializeOpHttpBindingsListAgentAliasesInput(v *ListAgentAlias return nil } -func awsRestjson1_serializeOpDocumentListAgentAliasesInput(v *ListAgentAliasesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListAgentKnowledgeBases struct { +type awsRestjson1_serializeOpGetAgentActionGroup struct { } -func (*awsRestjson1_serializeOpListAgentKnowledgeBases) ID() string { +func (*awsRestjson1_serializeOpGetAgentActionGroup) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListAgentKnowledgeBases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetAgentActionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2079,16 +2168,16 @@ func (m *awsRestjson1_serializeOpListAgentKnowledgeBases) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAgentKnowledgeBasesInput) + input, ok := in.Parameters.(*GetAgentActionGroupInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2101,18 +2190,7 @@ func (m *awsRestjson1_serializeOpListAgentKnowledgeBases) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListAgentKnowledgeBasesInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListAgentKnowledgeBasesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetAgentActionGroupInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2123,11 +2201,20 @@ func (m *awsRestjson1_serializeOpListAgentKnowledgeBases) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAgentKnowledgeBasesInput(v *ListAgentKnowledgeBasesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetAgentActionGroupInput(v *GetAgentActionGroupInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } + if v.ActionGroupId == nil || len(*v.ActionGroupId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member actionGroupId must not be empty")} + } + if v.ActionGroupId != nil { + if err := encoder.SetURI("actionGroupId").String(*v.ActionGroupId); err != nil { + return err + } + } + if v.AgentId == nil || len(*v.AgentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} } @@ -2149,31 +2236,14 @@ func awsRestjson1_serializeOpHttpBindingsListAgentKnowledgeBasesInput(v *ListAge return nil } -func awsRestjson1_serializeOpDocumentListAgentKnowledgeBasesInput(v *ListAgentKnowledgeBasesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListAgents struct { +type awsRestjson1_serializeOpGetAgentAlias struct { } -func (*awsRestjson1_serializeOpListAgents) ID() string { +func (*awsRestjson1_serializeOpGetAgentAlias) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListAgents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetAgentAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2181,16 +2251,16 @@ func (m *awsRestjson1_serializeOpListAgents) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAgentsInput) + input, ok := in.Parameters.(*GetAgentAliasInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentaliases/{agentAliasId}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2203,14 +2273,7 @@ func (m *awsRestjson1_serializeOpListAgents) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: err} } - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListAgentsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetAgentAliasInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2221,39 +2284,40 @@ func (m *awsRestjson1_serializeOpListAgents) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAgentsInput(v *ListAgentsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetAgentAliasInput(v *GetAgentAliasInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - return nil -} - -func awsRestjson1_serializeOpDocumentListAgentsInput(v *ListAgentsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) + if v.AgentAliasId == nil || len(*v.AgentAliasId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentAliasId must not be empty")} } - - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) + if v.AgentAliasId != nil { + if err := encoder.SetURI("agentAliasId").String(*v.AgentAliasId); err != nil { + return err + } + } + + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + } + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpListAgentVersions struct { +type awsRestjson1_serializeOpGetAgentKnowledgeBase struct { } -func (*awsRestjson1_serializeOpListAgentVersions) ID() string { +func (*awsRestjson1_serializeOpGetAgentKnowledgeBase) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListAgentVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetAgentKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2261,16 +2325,16 @@ func (m *awsRestjson1_serializeOpListAgentVersions) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAgentVersionsInput) + input, ok := in.Parameters.(*GetAgentKnowledgeBaseInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2283,18 +2347,7 @@ func (m *awsRestjson1_serializeOpListAgentVersions) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListAgentVersionsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListAgentVersionsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetAgentKnowledgeBaseInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2305,7 +2358,7 @@ func (m *awsRestjson1_serializeOpListAgentVersions) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAgentVersionsInput(v *ListAgentVersionsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetAgentKnowledgeBaseInput(v *GetAgentKnowledgeBaseInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2319,34 +2372,35 @@ func awsRestjson1_serializeOpHttpBindingsListAgentVersionsInput(v *ListAgentVers } } - return nil -} - -func awsRestjson1_serializeOpDocumentListAgentVersionsInput(v *ListAgentVersionsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) + if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} + } + if v.AgentVersion != nil { + if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { + return err + } } - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpListDataSources struct { +type awsRestjson1_serializeOpGetAgentVersion struct { } -func (*awsRestjson1_serializeOpListDataSources) ID() string { +func (*awsRestjson1_serializeOpGetAgentVersion) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListDataSources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetAgentVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2354,16 +2408,16 @@ func (m *awsRestjson1_serializeOpListDataSources) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListDataSourcesInput) + input, ok := in.Parameters.(*GetAgentVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2376,18 +2430,7 @@ func (m *awsRestjson1_serializeOpListDataSources) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListDataSourcesInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListDataSourcesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetAgentVersionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2398,48 +2441,40 @@ func (m *awsRestjson1_serializeOpListDataSources) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListDataSourcesInput(v *ListDataSourcesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetAgentVersionInput(v *GetAgentVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { return err } } - return nil -} - -func awsRestjson1_serializeOpDocumentListDataSourcesInput(v *ListDataSourcesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) + if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} } - - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) + if v.AgentVersion != nil { + if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpListIngestionJobs struct { +type awsRestjson1_serializeOpGetDataSource struct { } -func (*awsRestjson1_serializeOpListIngestionJobs) ID() string { +func (*awsRestjson1_serializeOpGetDataSource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListIngestionJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetDataSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2447,16 +2482,16 @@ func (m *awsRestjson1_serializeOpListIngestionJobs) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListIngestionJobsInput) + input, ok := in.Parameters.(*GetDataSourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/") + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2469,18 +2504,7 @@ func (m *awsRestjson1_serializeOpListIngestionJobs) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListIngestionJobsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListIngestionJobsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetDataSourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2491,7 +2515,7 @@ func (m *awsRestjson1_serializeOpListIngestionJobs) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListIngestionJobsInput(v *ListIngestionJobsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetDataSourceInput(v *GetDataSourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2517,45 +2541,14 @@ func awsRestjson1_serializeOpHttpBindingsListIngestionJobsInput(v *ListIngestion return nil } -func awsRestjson1_serializeOpDocumentListIngestionJobsInput(v *ListIngestionJobsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Filters != nil { - ok := object.Key("filters") - if err := awsRestjson1_serializeDocumentIngestionJobFilters(v.Filters, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) - } - - if v.SortBy != nil { - ok := object.Key("sortBy") - if err := awsRestjson1_serializeDocumentIngestionJobSortBy(v.SortBy, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpListKnowledgeBases struct { +type awsRestjson1_serializeOpGetFlow struct { } -func (*awsRestjson1_serializeOpListKnowledgeBases) ID() string { +func (*awsRestjson1_serializeOpGetFlow) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetFlow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2563,16 +2556,16 @@ func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListKnowledgeBasesInput) + input, ok := in.Parameters.(*GetFlowInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/") + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2585,14 +2578,7 @@ func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListKnowledgeBasesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetFlowInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2603,39 +2589,31 @@ func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(v *ListKnowledgeBasesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetFlowInput(v *GetFlowInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - return nil -} - -func awsRestjson1_serializeOpDocumentListKnowledgeBasesInput(v *ListKnowledgeBasesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} } - - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpListTagsForResource struct { +type awsRestjson1_serializeOpGetFlowAlias struct { } -func (*awsRestjson1_serializeOpListTagsForResource) ID() string { +func (*awsRestjson1_serializeOpGetFlowAlias) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetFlowAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2643,13 +2621,13 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListTagsForResourceInput) + input, ok := in.Parameters.(*GetFlowAliasInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/aliases/{aliasIdentifier}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2665,7 +2643,7 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetFlowAliasInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2676,16 +2654,25 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetFlowAliasInput(v *GetFlowAliasInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + if v.AliasIdentifier == nil || len(*v.AliasIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aliasIdentifier must not be empty")} } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + if v.AliasIdentifier != nil { + if err := encoder.SetURI("aliasIdentifier").String(*v.AliasIdentifier); err != nil { + return err + } + } + + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} + } + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { return err } } @@ -2693,14 +2680,14 @@ func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsFor return nil } -type awsRestjson1_serializeOpPrepareAgent struct { +type awsRestjson1_serializeOpGetFlowVersion struct { } -func (*awsRestjson1_serializeOpPrepareAgent) ID() string { +func (*awsRestjson1_serializeOpGetFlowVersion) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpPrepareAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetFlowVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2708,16 +2695,16 @@ func (m *awsRestjson1_serializeOpPrepareAgent) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*PrepareAgentInput) + input, ok := in.Parameters.(*GetFlowVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/") + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/versions/{flowVersion}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2730,7 +2717,7 @@ func (m *awsRestjson1_serializeOpPrepareAgent) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsPrepareAgentInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetFlowVersionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2741,16 +2728,25 @@ func (m *awsRestjson1_serializeOpPrepareAgent) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsPrepareAgentInput(v *PrepareAgentInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetFlowVersionInput(v *GetFlowVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AgentId == nil || len(*v.AgentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} } - if v.AgentId != nil { - if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { + return err + } + } + + if v.FlowVersion == nil || len(*v.FlowVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowVersion must not be empty")} + } + if v.FlowVersion != nil { + if err := encoder.SetURI("flowVersion").String(*v.FlowVersion); err != nil { return err } } @@ -2758,14 +2754,14 @@ func awsRestjson1_serializeOpHttpBindingsPrepareAgentInput(v *PrepareAgentInput, return nil } -type awsRestjson1_serializeOpStartIngestionJob struct { +type awsRestjson1_serializeOpGetIngestionJob struct { } -func (*awsRestjson1_serializeOpStartIngestionJob) ID() string { +func (*awsRestjson1_serializeOpGetIngestionJob) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpStartIngestionJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetIngestionJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2773,16 +2769,16 @@ func (m *awsRestjson1_serializeOpStartIngestionJob) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartIngestionJobInput) + input, ok := in.Parameters.(*GetIngestionJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/") + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/{ingestionJobId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2795,18 +2791,7 @@ func (m *awsRestjson1_serializeOpStartIngestionJob) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsStartIngestionJobInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentStartIngestionJobInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetIngestionJobInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2817,7 +2802,7 @@ func (m *awsRestjson1_serializeOpStartIngestionJob) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsStartIngestionJobInput(v *StartIngestionJobInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetIngestionJobInput(v *GetIngestionJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2831,6 +2816,15 @@ func awsRestjson1_serializeOpHttpBindingsStartIngestionJobInput(v *StartIngestio } } + if v.IngestionJobId == nil || len(*v.IngestionJobId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ingestionJobId must not be empty")} + } + if v.IngestionJobId != nil { + if err := encoder.SetURI("ingestionJobId").String(*v.IngestionJobId); err != nil { + return err + } + } + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} } @@ -2843,31 +2837,14 @@ func awsRestjson1_serializeOpHttpBindingsStartIngestionJobInput(v *StartIngestio return nil } -func awsRestjson1_serializeOpDocumentStartIngestionJobInput(v *StartIngestionJobInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientToken != nil { - ok := object.Key("clientToken") - ok.String(*v.ClientToken) - } - - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) - } - - return nil -} - -type awsRestjson1_serializeOpTagResource struct { +type awsRestjson1_serializeOpGetKnowledgeBase struct { } -func (*awsRestjson1_serializeOpTagResource) ID() string { +func (*awsRestjson1_serializeOpGetKnowledgeBase) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2875,16 +2852,16 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*TagResourceInput) + input, ok := in.Parameters.(*GetKnowledgeBaseInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2897,18 +2874,7 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetKnowledgeBaseInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2919,30 +2885,16 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetKnowledgeBaseInput(v *GetKnowledgeBaseInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { - return err - } + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} } - - return nil -} - -func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { return err } } @@ -2950,14 +2902,14 @@ func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value return nil } -type awsRestjson1_serializeOpUntagResource struct { +type awsRestjson1_serializeOpGetPrompt struct { } -func (*awsRestjson1_serializeOpUntagResource) ID() string { +func (*awsRestjson1_serializeOpGetPrompt) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetPrompt) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2965,16 +2917,16 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UntagResourceInput) + input, ok := in.Parameters.(*GetPromptInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + opPath, opQuery := httpbinding.SplitURI("/prompts/{promptIdentifier}/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2987,7 +2939,7 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetPromptInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2998,37 +2950,35 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetPromptInput(v *GetPromptInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + if v.PromptIdentifier == nil || len(*v.PromptIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member promptIdentifier must not be empty")} } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + if v.PromptIdentifier != nil { + if err := encoder.SetURI("promptIdentifier").String(*v.PromptIdentifier); err != nil { return err } } - if v.TagKeys != nil { - for i := range v.TagKeys { - encoder.AddQuery("tagKeys").String(v.TagKeys[i]) - } + if v.PromptVersion != nil { + encoder.SetQuery("promptVersion").String(*v.PromptVersion) } return nil } -type awsRestjson1_serializeOpUpdateAgent struct { +type awsRestjson1_serializeOpListAgentActionGroups struct { } -func (*awsRestjson1_serializeOpUpdateAgent) ID() string { +func (*awsRestjson1_serializeOpListAgentActionGroups) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListAgentActionGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3036,16 +2986,16 @@ func (m *awsRestjson1_serializeOpUpdateAgent) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateAgentInput) + input, ok := in.Parameters.(*ListAgentActionGroupsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/actiongroups/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3058,14 +3008,14 @@ func (m *awsRestjson1_serializeOpUpdateAgent) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateAgentInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListAgentActionGroupsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateAgentInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListAgentActionGroupsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3080,7 +3030,7 @@ func (m *awsRestjson1_serializeOpUpdateAgent) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateAgentInput(v *UpdateAgentInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListAgentActionGroupsInput(v *ListAgentActionGroupsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3094,73 +3044,43 @@ func awsRestjson1_serializeOpHttpBindingsUpdateAgentInput(v *UpdateAgentInput, e } } - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateAgentInput(v *UpdateAgentInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AgentName != nil { - ok := object.Key("agentName") - ok.String(*v.AgentName) - } - - if v.AgentResourceRoleArn != nil { - ok := object.Key("agentResourceRoleArn") - ok.String(*v.AgentResourceRoleArn) - } - - if v.CustomerEncryptionKeyArn != nil { - ok := object.Key("customerEncryptionKeyArn") - ok.String(*v.CustomerEncryptionKeyArn) - } - - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) - } - - if v.FoundationModel != nil { - ok := object.Key("foundationModel") - ok.String(*v.FoundationModel) + if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} } - - if v.GuardrailConfiguration != nil { - ok := object.Key("guardrailConfiguration") - if err := awsRestjson1_serializeDocumentGuardrailConfiguration(v.GuardrailConfiguration, ok); err != nil { + if v.AgentVersion != nil { + if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { return err } } - if v.IdleSessionTTLInSeconds != nil { - ok := object.Key("idleSessionTTLInSeconds") - ok.Integer(*v.IdleSessionTTLInSeconds) - } + return nil +} - if v.Instruction != nil { - ok := object.Key("instruction") - ok.String(*v.Instruction) +func awsRestjson1_serializeOpDocumentListAgentActionGroupsInput(v *ListAgentActionGroupsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) } - if v.PromptOverrideConfiguration != nil { - ok := object.Key("promptOverrideConfiguration") - if err := awsRestjson1_serializeDocumentPromptOverrideConfiguration(v.PromptOverrideConfiguration, ok); err != nil { - return err - } + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) } return nil } -type awsRestjson1_serializeOpUpdateAgentActionGroup struct { +type awsRestjson1_serializeOpListAgentAliases struct { } -func (*awsRestjson1_serializeOpUpdateAgentActionGroup) ID() string { +func (*awsRestjson1_serializeOpListAgentAliases) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateAgentActionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListAgentAliases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3168,16 +3088,16 @@ func (m *awsRestjson1_serializeOpUpdateAgentActionGroup) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateAgentActionGroupInput) + input, ok := in.Parameters.(*ListAgentAliasesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentaliases/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3190,14 +3110,14 @@ func (m *awsRestjson1_serializeOpUpdateAgentActionGroup) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateAgentActionGroupInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListAgentAliasesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateAgentActionGroupInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListAgentAliasesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3212,20 +3132,11 @@ func (m *awsRestjson1_serializeOpUpdateAgentActionGroup) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateAgentActionGroupInput(v *UpdateAgentActionGroupInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListAgentAliasesInput(v *ListAgentAliasesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ActionGroupId == nil || len(*v.ActionGroupId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member actionGroupId must not be empty")} - } - if v.ActionGroupId != nil { - if err := encoder.SetURI("actionGroupId").String(*v.ActionGroupId); err != nil { - return err - } - } - if v.AgentId == nil || len(*v.AgentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} } @@ -3235,74 +3146,34 @@ func awsRestjson1_serializeOpHttpBindingsUpdateAgentActionGroupInput(v *UpdateAg } } - if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} - } - if v.AgentVersion != nil { - if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { - return err - } - } - return nil } -func awsRestjson1_serializeOpDocumentUpdateAgentActionGroupInput(v *UpdateAgentActionGroupInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListAgentAliasesInput(v *ListAgentAliasesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.ActionGroupExecutor != nil { - ok := object.Key("actionGroupExecutor") - if err := awsRestjson1_serializeDocumentActionGroupExecutor(v.ActionGroupExecutor, ok); err != nil { - return err - } - } - - if v.ActionGroupName != nil { - ok := object.Key("actionGroupName") - ok.String(*v.ActionGroupName) + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) } - if len(v.ActionGroupState) > 0 { - ok := object.Key("actionGroupState") - ok.String(string(v.ActionGroupState)) + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) } - if v.ApiSchema != nil { - ok := object.Key("apiSchema") - if err := awsRestjson1_serializeDocumentAPISchema(v.ApiSchema, ok); err != nil { - return err - } - } + return nil +} - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) - } +type awsRestjson1_serializeOpListAgentKnowledgeBases struct { +} - if v.FunctionSchema != nil { - ok := object.Key("functionSchema") - if err := awsRestjson1_serializeDocumentFunctionSchema(v.FunctionSchema, ok); err != nil { - return err - } - } - - if len(v.ParentActionGroupSignature) > 0 { - ok := object.Key("parentActionGroupSignature") - ok.String(string(v.ParentActionGroupSignature)) - } - - return nil -} - -type awsRestjson1_serializeOpUpdateAgentAlias struct { -} - -func (*awsRestjson1_serializeOpUpdateAgentAlias) ID() string { +func (*awsRestjson1_serializeOpListAgentKnowledgeBases) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateAgentAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListAgentKnowledgeBases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3310,16 +3181,16 @@ func (m *awsRestjson1_serializeOpUpdateAgentAlias) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateAgentAliasInput) + input, ok := in.Parameters.(*ListAgentKnowledgeBasesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentaliases/{agentAliasId}/") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3332,14 +3203,14 @@ func (m *awsRestjson1_serializeOpUpdateAgentAlias) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateAgentAliasInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListAgentKnowledgeBasesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateAgentAliasInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListAgentKnowledgeBasesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3354,25 +3225,25 @@ func (m *awsRestjson1_serializeOpUpdateAgentAlias) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateAgentAliasInput(v *UpdateAgentAliasInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListAgentKnowledgeBasesInput(v *ListAgentKnowledgeBasesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AgentAliasId == nil || len(*v.AgentAliasId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentAliasId must not be empty")} + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} } - if v.AgentAliasId != nil { - if err := encoder.SetURI("agentAliasId").String(*v.AgentAliasId); err != nil { + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { return err } } - if v.AgentId == nil || len(*v.AgentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} } - if v.AgentId != nil { - if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + if v.AgentVersion != nil { + if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { return err } } @@ -3380,38 +3251,31 @@ func awsRestjson1_serializeOpHttpBindingsUpdateAgentAliasInput(v *UpdateAgentAli return nil } -func awsRestjson1_serializeOpDocumentUpdateAgentAliasInput(v *UpdateAgentAliasInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListAgentKnowledgeBasesInput(v *ListAgentKnowledgeBasesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.AgentAliasName != nil { - ok := object.Key("agentAliasName") - ok.String(*v.AgentAliasName) - } - - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) } - if v.RoutingConfiguration != nil { - ok := object.Key("routingConfiguration") - if err := awsRestjson1_serializeDocumentAgentAliasRoutingConfiguration(v.RoutingConfiguration, ok); err != nil { - return err - } + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) } return nil } -type awsRestjson1_serializeOpUpdateAgentKnowledgeBase struct { +type awsRestjson1_serializeOpListAgents struct { } -func (*awsRestjson1_serializeOpUpdateAgentKnowledgeBase) ID() string { +func (*awsRestjson1_serializeOpListAgents) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateAgentKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListAgents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3419,16 +3283,16 @@ func (m *awsRestjson1_serializeOpUpdateAgentKnowledgeBase) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateAgentKnowledgeBaseInput) + input, ok := in.Parameters.(*ListAgentsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/") + opPath, opQuery := httpbinding.SplitURI("/agents/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3441,14 +3305,10 @@ func (m *awsRestjson1_serializeOpUpdateAgentKnowledgeBase) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateAgentKnowledgeBaseInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateAgentKnowledgeBaseInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListAgentsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3463,66 +3323,39 @@ func (m *awsRestjson1_serializeOpUpdateAgentKnowledgeBase) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateAgentKnowledgeBaseInput(v *UpdateAgentKnowledgeBaseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListAgentsInput(v *ListAgentsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AgentId == nil || len(*v.AgentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} - } - if v.AgentId != nil { - if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { - return err - } - } - - if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} - } - if v.AgentVersion != nil { - if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { - return err - } - } - - if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} - } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { - return err - } - } - return nil } -func awsRestjson1_serializeOpDocumentUpdateAgentKnowledgeBaseInput(v *UpdateAgentKnowledgeBaseInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListAgentsInput(v *ListAgentsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) } - if len(v.KnowledgeBaseState) > 0 { - ok := object.Key("knowledgeBaseState") - ok.String(string(v.KnowledgeBaseState)) + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) } return nil } -type awsRestjson1_serializeOpUpdateDataSource struct { +type awsRestjson1_serializeOpListAgentVersions struct { } -func (*awsRestjson1_serializeOpUpdateDataSource) ID() string { +func (*awsRestjson1_serializeOpListAgentVersions) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateDataSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListAgentVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3530,16 +3363,16 @@ func (m *awsRestjson1_serializeOpUpdateDataSource) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateDataSourceInput) + input, ok := in.Parameters.(*ListAgentVersionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}") + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3552,14 +3385,14 @@ func (m *awsRestjson1_serializeOpUpdateDataSource) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateDataSourceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListAgentVersionsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateDataSourceInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListAgentVersionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3574,25 +3407,16 @@ func (m *awsRestjson1_serializeOpUpdateDataSource) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateDataSourceInput(v *UpdateDataSourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListAgentVersionsInput(v *ListAgentVersionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.DataSourceId == nil || len(*v.DataSourceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member dataSourceId must not be empty")} - } - if v.DataSourceId != nil { - if err := encoder.SetURI("dataSourceId").String(*v.DataSourceId); err != nil { - return err - } - } - - if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { return err } } @@ -3600,57 +3424,31 @@ func awsRestjson1_serializeOpHttpBindingsUpdateDataSourceInput(v *UpdateDataSour return nil } -func awsRestjson1_serializeOpDocumentUpdateDataSourceInput(v *UpdateDataSourceInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListAgentVersionsInput(v *ListAgentVersionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if len(v.DataDeletionPolicy) > 0 { - ok := object.Key("dataDeletionPolicy") - ok.String(string(v.DataDeletionPolicy)) - } - - if v.DataSourceConfiguration != nil { - ok := object.Key("dataSourceConfiguration") - if err := awsRestjson1_serializeDocumentDataSourceConfiguration(v.DataSourceConfiguration, ok); err != nil { - return err - } - } - - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - if v.ServerSideEncryptionConfiguration != nil { - ok := object.Key("serverSideEncryptionConfiguration") - if err := awsRestjson1_serializeDocumentServerSideEncryptionConfiguration(v.ServerSideEncryptionConfiguration, ok); err != nil { - return err - } + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) } - if v.VectorIngestionConfiguration != nil { - ok := object.Key("vectorIngestionConfiguration") - if err := awsRestjson1_serializeDocumentVectorIngestionConfiguration(v.VectorIngestionConfiguration, ok); err != nil { - return err - } + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) } return nil } -type awsRestjson1_serializeOpUpdateKnowledgeBase struct { +type awsRestjson1_serializeOpListDataSources struct { } -func (*awsRestjson1_serializeOpUpdateKnowledgeBase) ID() string { +func (*awsRestjson1_serializeOpListDataSources) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListDataSources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3658,16 +3456,16 @@ func (m *awsRestjson1_serializeOpUpdateKnowledgeBase) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateKnowledgeBaseInput) + input, ok := in.Parameters.(*ListDataSourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}") + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3680,14 +3478,14 @@ func (m *awsRestjson1_serializeOpUpdateKnowledgeBase) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateKnowledgeBaseInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListDataSourcesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateKnowledgeBaseInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListDataSourcesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3702,7 +3500,7 @@ func (m *awsRestjson1_serializeOpUpdateKnowledgeBase) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateKnowledgeBaseInput(v *UpdateKnowledgeBaseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListDataSourcesInput(v *ListDataSourcesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3719,240 +3517,3551 @@ func awsRestjson1_serializeOpHttpBindingsUpdateKnowledgeBaseInput(v *UpdateKnowl return nil } -func awsRestjson1_serializeOpDocumentUpdateKnowledgeBaseInput(v *UpdateKnowledgeBaseInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListDataSourcesInput(v *ListDataSourcesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) } - if v.KnowledgeBaseConfiguration != nil { - ok := object.Key("knowledgeBaseConfiguration") - if err := awsRestjson1_serializeDocumentKnowledgeBaseConfiguration(v.KnowledgeBaseConfiguration, ok); err != nil { - return err - } + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) } - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } + return nil +} - if v.RoleArn != nil { - ok := object.Key("roleArn") - ok.String(*v.RoleArn) - } +type awsRestjson1_serializeOpListFlowAliases struct { +} - if v.StorageConfiguration != nil { - ok := object.Key("storageConfiguration") - if err := awsRestjson1_serializeDocumentStorageConfiguration(v.StorageConfiguration, ok); err != nil { - return err +func (*awsRestjson1_serializeOpListFlowAliases) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListFlowAliases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListFlowAliasesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/aliases") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListFlowAliasesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListFlowAliasesInput(v *ListFlowAliasesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} + } + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListFlows struct { +} + +func (*awsRestjson1_serializeOpListFlows) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListFlows) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListFlowsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/flows/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListFlowsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListFlowsInput(v *ListFlowsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListFlowVersions struct { +} + +func (*awsRestjson1_serializeOpListFlowVersions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListFlowVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListFlowVersionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/versions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListFlowVersionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListFlowVersionsInput(v *ListFlowVersionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} + } + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListIngestionJobs struct { +} + +func (*awsRestjson1_serializeOpListIngestionJobs) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListIngestionJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListIngestionJobsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListIngestionJobsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListIngestionJobsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListIngestionJobsInput(v *ListIngestionJobsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DataSourceId == nil || len(*v.DataSourceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member dataSourceId must not be empty")} + } + if v.DataSourceId != nil { + if err := encoder.SetURI("dataSourceId").String(*v.DataSourceId); err != nil { + return err + } + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListIngestionJobsInput(v *ListIngestionJobsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentIngestionJobFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.SortBy != nil { + ok := object.Key("sortBy") + if err := awsRestjson1_serializeDocumentIngestionJobSortBy(v.SortBy, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListKnowledgeBases struct { +} + +func (*awsRestjson1_serializeOpListKnowledgeBases) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListKnowledgeBasesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListKnowledgeBasesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(v *ListKnowledgeBasesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListKnowledgeBasesInput(v *ListKnowledgeBasesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListPrompts struct { +} + +func (*awsRestjson1_serializeOpListPrompts) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListPrompts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListPromptsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/prompts/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListPromptsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListPromptsInput(v *ListPromptsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.PromptIdentifier != nil { + encoder.SetQuery("promptIdentifier").String(*v.PromptIdentifier) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPrepareAgent struct { +} + +func (*awsRestjson1_serializeOpPrepareAgent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPrepareAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PrepareAgentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPrepareAgentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPrepareAgentInput(v *PrepareAgentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + } + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPrepareFlow struct { +} + +func (*awsRestjson1_serializeOpPrepareFlow) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPrepareFlow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PrepareFlowInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPrepareFlowInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPrepareFlowInput(v *PrepareFlowInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} + } + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpStartIngestionJob struct { +} + +func (*awsRestjson1_serializeOpStartIngestionJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartIngestionJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartIngestionJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStartIngestionJobInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartIngestionJobInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartIngestionJobInput(v *StartIngestionJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DataSourceId == nil || len(*v.DataSourceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member dataSourceId must not be empty")} + } + if v.DataSourceId != nil { + if err := encoder.SetURI("dataSourceId").String(*v.DataSourceId); err != nil { + return err + } + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartIngestionJobInput(v *StartIngestionJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateAgent struct { +} + +func (*awsRestjson1_serializeOpUpdateAgent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateAgentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateAgentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateAgentInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateAgentInput(v *UpdateAgentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + } + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateAgentInput(v *UpdateAgentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AgentName != nil { + ok := object.Key("agentName") + ok.String(*v.AgentName) + } + + if v.AgentResourceRoleArn != nil { + ok := object.Key("agentResourceRoleArn") + ok.String(*v.AgentResourceRoleArn) + } + + if v.CustomerEncryptionKeyArn != nil { + ok := object.Key("customerEncryptionKeyArn") + ok.String(*v.CustomerEncryptionKeyArn) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.FoundationModel != nil { + ok := object.Key("foundationModel") + ok.String(*v.FoundationModel) + } + + if v.GuardrailConfiguration != nil { + ok := object.Key("guardrailConfiguration") + if err := awsRestjson1_serializeDocumentGuardrailConfiguration(v.GuardrailConfiguration, ok); err != nil { + return err + } + } + + if v.IdleSessionTTLInSeconds != nil { + ok := object.Key("idleSessionTTLInSeconds") + ok.Integer(*v.IdleSessionTTLInSeconds) + } + + if v.Instruction != nil { + ok := object.Key("instruction") + ok.String(*v.Instruction) + } + + if v.MemoryConfiguration != nil { + ok := object.Key("memoryConfiguration") + if err := awsRestjson1_serializeDocumentMemoryConfiguration(v.MemoryConfiguration, ok); err != nil { + return err + } + } + + if v.PromptOverrideConfiguration != nil { + ok := object.Key("promptOverrideConfiguration") + if err := awsRestjson1_serializeDocumentPromptOverrideConfiguration(v.PromptOverrideConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateAgentActionGroup struct { +} + +func (*awsRestjson1_serializeOpUpdateAgentActionGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateAgentActionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateAgentActionGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateAgentActionGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateAgentActionGroupInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateAgentActionGroupInput(v *UpdateAgentActionGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ActionGroupId == nil || len(*v.ActionGroupId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member actionGroupId must not be empty")} + } + if v.ActionGroupId != nil { + if err := encoder.SetURI("actionGroupId").String(*v.ActionGroupId); err != nil { + return err + } + } + + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + } + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + return err + } + } + + if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} + } + if v.AgentVersion != nil { + if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateAgentActionGroupInput(v *UpdateAgentActionGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ActionGroupExecutor != nil { + ok := object.Key("actionGroupExecutor") + if err := awsRestjson1_serializeDocumentActionGroupExecutor(v.ActionGroupExecutor, ok); err != nil { + return err + } + } + + if v.ActionGroupName != nil { + ok := object.Key("actionGroupName") + ok.String(*v.ActionGroupName) + } + + if len(v.ActionGroupState) > 0 { + ok := object.Key("actionGroupState") + ok.String(string(v.ActionGroupState)) + } + + if v.ApiSchema != nil { + ok := object.Key("apiSchema") + if err := awsRestjson1_serializeDocumentAPISchema(v.ApiSchema, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.FunctionSchema != nil { + ok := object.Key("functionSchema") + if err := awsRestjson1_serializeDocumentFunctionSchema(v.FunctionSchema, ok); err != nil { + return err + } + } + + if len(v.ParentActionGroupSignature) > 0 { + ok := object.Key("parentActionGroupSignature") + ok.String(string(v.ParentActionGroupSignature)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateAgentAlias struct { +} + +func (*awsRestjson1_serializeOpUpdateAgentAlias) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateAgentAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateAgentAliasInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentaliases/{agentAliasId}/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateAgentAliasInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateAgentAliasInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateAgentAliasInput(v *UpdateAgentAliasInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AgentAliasId == nil || len(*v.AgentAliasId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentAliasId must not be empty")} + } + if v.AgentAliasId != nil { + if err := encoder.SetURI("agentAliasId").String(*v.AgentAliasId); err != nil { + return err + } + } + + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + } + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateAgentAliasInput(v *UpdateAgentAliasInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AgentAliasName != nil { + ok := object.Key("agentAliasName") + ok.String(*v.AgentAliasName) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.RoutingConfiguration != nil { + ok := object.Key("routingConfiguration") + if err := awsRestjson1_serializeDocumentAgentAliasRoutingConfiguration(v.RoutingConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateAgentKnowledgeBase struct { +} + +func (*awsRestjson1_serializeOpUpdateAgentKnowledgeBase) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateAgentKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateAgentKnowledgeBaseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateAgentKnowledgeBaseInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateAgentKnowledgeBaseInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateAgentKnowledgeBaseInput(v *UpdateAgentKnowledgeBaseInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + } + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + return err + } + } + + if v.AgentVersion == nil || len(*v.AgentVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentVersion must not be empty")} + } + if v.AgentVersion != nil { + if err := encoder.SetURI("agentVersion").String(*v.AgentVersion); err != nil { + return err + } + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateAgentKnowledgeBaseInput(v *UpdateAgentKnowledgeBaseInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if len(v.KnowledgeBaseState) > 0 { + ok := object.Key("knowledgeBaseState") + ok.String(string(v.KnowledgeBaseState)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateDataSource struct { +} + +func (*awsRestjson1_serializeOpUpdateDataSource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateDataSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateDataSourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateDataSourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateDataSourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateDataSourceInput(v *UpdateDataSourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DataSourceId == nil || len(*v.DataSourceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member dataSourceId must not be empty")} + } + if v.DataSourceId != nil { + if err := encoder.SetURI("dataSourceId").String(*v.DataSourceId); err != nil { + return err + } + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateDataSourceInput(v *UpdateDataSourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.DataDeletionPolicy) > 0 { + ok := object.Key("dataDeletionPolicy") + ok.String(string(v.DataDeletionPolicy)) + } + + if v.DataSourceConfiguration != nil { + ok := object.Key("dataSourceConfiguration") + if err := awsRestjson1_serializeDocumentDataSourceConfiguration(v.DataSourceConfiguration, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.ServerSideEncryptionConfiguration != nil { + ok := object.Key("serverSideEncryptionConfiguration") + if err := awsRestjson1_serializeDocumentServerSideEncryptionConfiguration(v.ServerSideEncryptionConfiguration, ok); err != nil { + return err + } + } + + if v.VectorIngestionConfiguration != nil { + ok := object.Key("vectorIngestionConfiguration") + if err := awsRestjson1_serializeDocumentVectorIngestionConfiguration(v.VectorIngestionConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateFlow struct { +} + +func (*awsRestjson1_serializeOpUpdateFlow) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateFlow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateFlowInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateFlowInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateFlowInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateFlowInput(v *UpdateFlowInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} + } + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateFlowInput(v *UpdateFlowInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CustomerEncryptionKeyArn != nil { + ok := object.Key("customerEncryptionKeyArn") + ok.String(*v.CustomerEncryptionKeyArn) + } + + if v.Definition != nil { + ok := object.Key("definition") + if err := awsRestjson1_serializeDocumentFlowDefinition(v.Definition, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.ExecutionRoleArn != nil { + ok := object.Key("executionRoleArn") + ok.String(*v.ExecutionRoleArn) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateFlowAlias struct { +} + +func (*awsRestjson1_serializeOpUpdateFlowAlias) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateFlowAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateFlowAliasInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/aliases/{aliasIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateFlowAliasInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateFlowAliasInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateFlowAliasInput(v *UpdateFlowAliasInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AliasIdentifier == nil || len(*v.AliasIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aliasIdentifier must not be empty")} + } + if v.AliasIdentifier != nil { + if err := encoder.SetURI("aliasIdentifier").String(*v.AliasIdentifier); err != nil { + return err + } + } + + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} + } + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateFlowAliasInput(v *UpdateFlowAliasInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.RoutingConfiguration != nil { + ok := object.Key("routingConfiguration") + if err := awsRestjson1_serializeDocumentFlowAliasRoutingConfiguration(v.RoutingConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateKnowledgeBase struct { +} + +func (*awsRestjson1_serializeOpUpdateKnowledgeBase) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateKnowledgeBaseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgebases/{knowledgeBaseId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateKnowledgeBaseInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateKnowledgeBaseInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateKnowledgeBaseInput(v *UpdateKnowledgeBaseInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateKnowledgeBaseInput(v *UpdateKnowledgeBaseInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.KnowledgeBaseConfiguration != nil { + ok := object.Key("knowledgeBaseConfiguration") + if err := awsRestjson1_serializeDocumentKnowledgeBaseConfiguration(v.KnowledgeBaseConfiguration, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.RoleArn != nil { + ok := object.Key("roleArn") + ok.String(*v.RoleArn) + } + + if v.StorageConfiguration != nil { + ok := object.Key("storageConfiguration") + if err := awsRestjson1_serializeDocumentStorageConfiguration(v.StorageConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdatePrompt struct { +} + +func (*awsRestjson1_serializeOpUpdatePrompt) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdatePrompt) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdatePromptInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/prompts/{promptIdentifier}/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdatePromptInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdatePromptInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdatePromptInput(v *UpdatePromptInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.PromptIdentifier == nil || len(*v.PromptIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member promptIdentifier must not be empty")} + } + if v.PromptIdentifier != nil { + if err := encoder.SetURI("promptIdentifier").String(*v.PromptIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdatePromptInput(v *UpdatePromptInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CustomerEncryptionKeyArn != nil { + ok := object.Key("customerEncryptionKeyArn") + ok.String(*v.CustomerEncryptionKeyArn) + } + + if v.DefaultVariant != nil { + ok := object.Key("defaultVariant") + ok.String(*v.DefaultVariant) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Variants != nil { + ok := object.Key("variants") + if err := awsRestjson1_serializeDocumentPromptVariantList(v.Variants, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentActionGroupExecutor(v types.ActionGroupExecutor, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ActionGroupExecutorMemberCustomControl: + av := object.Key("customControl") + av.String(string(uv.Value)) + + case *types.ActionGroupExecutorMemberLambda: + av := object.Key("lambda") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentAgentAliasRoutingConfiguration(v []types.AgentAliasRoutingConfigurationListItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAgentAliasRoutingConfigurationListItem(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAgentAliasRoutingConfigurationListItem(v *types.AgentAliasRoutingConfigurationListItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AgentVersion != nil { + ok := object.Key("agentVersion") + ok.String(*v.AgentVersion) + } + + if v.ProvisionedThroughput != nil { + ok := object.Key("provisionedThroughput") + ok.String(*v.ProvisionedThroughput) + } + + return nil +} + +func awsRestjson1_serializeDocumentAgentFlowNodeConfiguration(v *types.AgentFlowNodeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AgentAliasArn != nil { + ok := object.Key("agentAliasArn") + ok.String(*v.AgentAliasArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentAPISchema(v types.APISchema, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.APISchemaMemberPayload: + av := object.Key("payload") + av.String(uv.Value) + + case *types.APISchemaMemberS3: + av := object.Key("s3") + if err := awsRestjson1_serializeDocumentS3Identifier(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentBedrockEmbeddingModelConfiguration(v *types.BedrockEmbeddingModelConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Dimensions != nil { + ok := object.Key("dimensions") + ok.Integer(*v.Dimensions) + } + + return nil +} + +func awsRestjson1_serializeDocumentBedrockFoundationModelConfiguration(v *types.BedrockFoundationModelConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ModelArn != nil { + ok := object.Key("modelArn") + ok.String(*v.ModelArn) + } + + if v.ParsingPrompt != nil { + ok := object.Key("parsingPrompt") + if err := awsRestjson1_serializeDocumentParsingPrompt(v.ParsingPrompt, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentChunkingConfiguration(v *types.ChunkingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ChunkingStrategy) > 0 { + ok := object.Key("chunkingStrategy") + ok.String(string(v.ChunkingStrategy)) + } + + if v.FixedSizeChunkingConfiguration != nil { + ok := object.Key("fixedSizeChunkingConfiguration") + if err := awsRestjson1_serializeDocumentFixedSizeChunkingConfiguration(v.FixedSizeChunkingConfiguration, ok); err != nil { + return err + } + } + + if v.HierarchicalChunkingConfiguration != nil { + ok := object.Key("hierarchicalChunkingConfiguration") + if err := awsRestjson1_serializeDocumentHierarchicalChunkingConfiguration(v.HierarchicalChunkingConfiguration, ok); err != nil { + return err + } + } + + if v.SemanticChunkingConfiguration != nil { + ok := object.Key("semanticChunkingConfiguration") + if err := awsRestjson1_serializeDocumentSemanticChunkingConfiguration(v.SemanticChunkingConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCollectorFlowNodeConfiguration(v *types.CollectorFlowNodeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + +func awsRestjson1_serializeDocumentConditionFlowNodeConfiguration(v *types.ConditionFlowNodeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Conditions != nil { + ok := object.Key("conditions") + if err := awsRestjson1_serializeDocumentFlowConditions(v.Conditions, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentConfluenceCrawlerConfiguration(v *types.ConfluenceCrawlerConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FilterConfiguration != nil { + ok := object.Key("filterConfiguration") + if err := awsRestjson1_serializeDocumentCrawlFilterConfiguration(v.FilterConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentConfluenceDataSourceConfiguration(v *types.ConfluenceDataSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CrawlerConfiguration != nil { + ok := object.Key("crawlerConfiguration") + if err := awsRestjson1_serializeDocumentConfluenceCrawlerConfiguration(v.CrawlerConfiguration, ok); err != nil { + return err + } + } + + if v.SourceConfiguration != nil { + ok := object.Key("sourceConfiguration") + if err := awsRestjson1_serializeDocumentConfluenceSourceConfiguration(v.SourceConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentConfluenceSourceConfiguration(v *types.ConfluenceSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AuthType) > 0 { + ok := object.Key("authType") + ok.String(string(v.AuthType)) + } + + if v.CredentialsSecretArn != nil { + ok := object.Key("credentialsSecretArn") + ok.String(*v.CredentialsSecretArn) + } + + if len(v.HostType) > 0 { + ok := object.Key("hostType") + ok.String(string(v.HostType)) + } + + if v.HostUrl != nil { + ok := object.Key("hostUrl") + ok.String(*v.HostUrl) + } + + return nil +} + +func awsRestjson1_serializeDocumentCrawlFilterConfiguration(v *types.CrawlFilterConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PatternObjectFilter != nil { + ok := object.Key("patternObjectFilter") + if err := awsRestjson1_serializeDocumentPatternObjectFilterConfiguration(v.PatternObjectFilter, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentCustomTransformationConfiguration(v *types.CustomTransformationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IntermediateStorage != nil { + ok := object.Key("intermediateStorage") + if err := awsRestjson1_serializeDocumentIntermediateStorage(v.IntermediateStorage, ok); err != nil { + return err + } + } + + if v.Transformations != nil { + ok := object.Key("transformations") + if err := awsRestjson1_serializeDocumentTransformations(v.Transformations, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentDataSourceConfiguration(v *types.DataSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConfluenceConfiguration != nil { + ok := object.Key("confluenceConfiguration") + if err := awsRestjson1_serializeDocumentConfluenceDataSourceConfiguration(v.ConfluenceConfiguration, ok); err != nil { + return err + } + } + + if v.S3Configuration != nil { + ok := object.Key("s3Configuration") + if err := awsRestjson1_serializeDocumentS3DataSourceConfiguration(v.S3Configuration, ok); err != nil { + return err + } + } + + if v.SalesforceConfiguration != nil { + ok := object.Key("salesforceConfiguration") + if err := awsRestjson1_serializeDocumentSalesforceDataSourceConfiguration(v.SalesforceConfiguration, ok); err != nil { + return err + } + } + + if v.SharePointConfiguration != nil { + ok := object.Key("sharePointConfiguration") + if err := awsRestjson1_serializeDocumentSharePointDataSourceConfiguration(v.SharePointConfiguration, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + if v.WebConfiguration != nil { + ok := object.Key("webConfiguration") + if err := awsRestjson1_serializeDocumentWebDataSourceConfiguration(v.WebConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentEmbeddingModelConfiguration(v *types.EmbeddingModelConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BedrockEmbeddingModelConfiguration != nil { + ok := object.Key("bedrockEmbeddingModelConfiguration") + if err := awsRestjson1_serializeDocumentBedrockEmbeddingModelConfiguration(v.BedrockEmbeddingModelConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentEnabledMemoryTypes(v []types.MemoryType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentFilterList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentFixedSizeChunkingConfiguration(v *types.FixedSizeChunkingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxTokens != nil { + ok := object.Key("maxTokens") + ok.Integer(*v.MaxTokens) + } + + if v.OverlapPercentage != nil { + ok := object.Key("overlapPercentage") + ok.Integer(*v.OverlapPercentage) + } + + return nil +} + +func awsRestjson1_serializeDocumentFlowAliasRoutingConfiguration(v []types.FlowAliasRoutingConfigurationListItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFlowAliasRoutingConfigurationListItem(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFlowAliasRoutingConfigurationListItem(v *types.FlowAliasRoutingConfigurationListItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FlowVersion != nil { + ok := object.Key("flowVersion") + ok.String(*v.FlowVersion) + } + + return nil +} + +func awsRestjson1_serializeDocumentFlowCondition(v *types.FlowCondition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Expression != nil { + ok := object.Key("expression") + ok.String(*v.Expression) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +func awsRestjson1_serializeDocumentFlowConditionalConnectionConfiguration(v *types.FlowConditionalConnectionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Condition != nil { + ok := object.Key("condition") + ok.String(*v.Condition) + } + + return nil +} + +func awsRestjson1_serializeDocumentFlowConditions(v []types.FlowCondition, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFlowCondition(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFlowConnection(v *types.FlowConnection, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Configuration != nil { + ok := object.Key("configuration") + if err := awsRestjson1_serializeDocumentFlowConnectionConfiguration(v.Configuration, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + if v.Target != nil { + ok := object.Key("target") + ok.String(*v.Target) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentFlowConnectionConfiguration(v types.FlowConnectionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.FlowConnectionConfigurationMemberConditional: + av := object.Key("conditional") + if err := awsRestjson1_serializeDocumentFlowConditionalConnectionConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowConnectionConfigurationMemberData: + av := object.Key("data") + if err := awsRestjson1_serializeDocumentFlowDataConnectionConfiguration(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentFlowConnections(v []types.FlowConnection, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFlowConnection(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFlowDataConnectionConfiguration(v *types.FlowDataConnectionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SourceOutput != nil { + ok := object.Key("sourceOutput") + ok.String(*v.SourceOutput) + } + + if v.TargetInput != nil { + ok := object.Key("targetInput") + ok.String(*v.TargetInput) + } + + return nil +} + +func awsRestjson1_serializeDocumentFlowDefinition(v *types.FlowDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Connections != nil { + ok := object.Key("connections") + if err := awsRestjson1_serializeDocumentFlowConnections(v.Connections, ok); err != nil { + return err + } + } + + if v.Nodes != nil { + ok := object.Key("nodes") + if err := awsRestjson1_serializeDocumentFlowNodes(v.Nodes, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentFlowNode(v *types.FlowNode, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Configuration != nil { + ok := object.Key("configuration") + if err := awsRestjson1_serializeDocumentFlowNodeConfiguration(v.Configuration, ok); err != nil { + return err + } + } + + if v.Inputs != nil { + ok := object.Key("inputs") + if err := awsRestjson1_serializeDocumentFlowNodeInputs(v.Inputs, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Outputs != nil { + ok := object.Key("outputs") + if err := awsRestjson1_serializeDocumentFlowNodeOutputs(v.Outputs, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentFlowNodeConfiguration(v types.FlowNodeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.FlowNodeConfigurationMemberAgent: + av := object.Key("agent") + if err := awsRestjson1_serializeDocumentAgentFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowNodeConfigurationMemberCollector: + av := object.Key("collector") + if err := awsRestjson1_serializeDocumentCollectorFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowNodeConfigurationMemberCondition: + av := object.Key("condition") + if err := awsRestjson1_serializeDocumentConditionFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowNodeConfigurationMemberInput: + av := object.Key("input") + if err := awsRestjson1_serializeDocumentInputFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowNodeConfigurationMemberIterator: + av := object.Key("iterator") + if err := awsRestjson1_serializeDocumentIteratorFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowNodeConfigurationMemberKnowledgeBase: + av := object.Key("knowledgeBase") + if err := awsRestjson1_serializeDocumentKnowledgeBaseFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowNodeConfigurationMemberLambdaFunction: + av := object.Key("lambdaFunction") + if err := awsRestjson1_serializeDocumentLambdaFunctionFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowNodeConfigurationMemberLex: + av := object.Key("lex") + if err := awsRestjson1_serializeDocumentLexFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowNodeConfigurationMemberOutput: + av := object.Key("output") + if err := awsRestjson1_serializeDocumentOutputFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowNodeConfigurationMemberPrompt: + av := object.Key("prompt") + if err := awsRestjson1_serializeDocumentPromptFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowNodeConfigurationMemberRetrieval: + av := object.Key("retrieval") + if err := awsRestjson1_serializeDocumentRetrievalFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.FlowNodeConfigurationMemberStorage: + av := object.Key("storage") + if err := awsRestjson1_serializeDocumentStorageFlowNodeConfiguration(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentFlowNodeInput(v *types.FlowNodeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Expression != nil { + ok := object.Key("expression") + ok.String(*v.Expression) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentFlowNodeInputs(v []types.FlowNodeInput, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFlowNodeInput(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFlowNodeOutput(v *types.FlowNodeOutput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentFlowNodeOutputs(v []types.FlowNodeOutput, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFlowNodeOutput(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFlowNodes(v []types.FlowNode, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFlowNode(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFunction(v *types.Function, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Parameters != nil { + ok := object.Key("parameters") + if err := awsRestjson1_serializeDocumentParameterMap(v.Parameters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentFunctions(v []types.Function, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFunction(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFunctionSchema(v types.FunctionSchema, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.FunctionSchemaMemberFunctions: + av := object.Key("functions") + if err := awsRestjson1_serializeDocumentFunctions(uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentGuardrailConfiguration(v *types.GuardrailConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GuardrailIdentifier != nil { + ok := object.Key("guardrailIdentifier") + ok.String(*v.GuardrailIdentifier) + } + + if v.GuardrailVersion != nil { + ok := object.Key("guardrailVersion") + ok.String(*v.GuardrailVersion) + } + + return nil +} + +func awsRestjson1_serializeDocumentHierarchicalChunkingConfiguration(v *types.HierarchicalChunkingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LevelConfigurations != nil { + ok := object.Key("levelConfigurations") + if err := awsRestjson1_serializeDocumentHierarchicalChunkingLevelConfigurations(v.LevelConfigurations, ok); err != nil { + return err + } + } + + if v.OverlapTokens != nil { + ok := object.Key("overlapTokens") + ok.Integer(*v.OverlapTokens) + } + + return nil +} + +func awsRestjson1_serializeDocumentHierarchicalChunkingLevelConfiguration(v *types.HierarchicalChunkingLevelConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxTokens != nil { + ok := object.Key("maxTokens") + ok.Integer(*v.MaxTokens) + } + + return nil +} + +func awsRestjson1_serializeDocumentHierarchicalChunkingLevelConfigurations(v []types.HierarchicalChunkingLevelConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentHierarchicalChunkingLevelConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentInferenceConfiguration(v *types.InferenceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaximumLength != nil { + ok := object.Key("maximumLength") + ok.Integer(*v.MaximumLength) + } + + if v.StopSequences != nil { + ok := object.Key("stopSequences") + if err := awsRestjson1_serializeDocumentStopSequences(v.StopSequences, ok); err != nil { + return err + } + } + + if v.Temperature != nil { + ok := object.Key("temperature") + switch { + case math.IsNaN(float64(*v.Temperature)): + ok.String("NaN") + + case math.IsInf(float64(*v.Temperature), 1): + ok.String("Infinity") + + case math.IsInf(float64(*v.Temperature), -1): + ok.String("-Infinity") + + default: + ok.Float(*v.Temperature) + + } + } + + if v.TopK != nil { + ok := object.Key("topK") + ok.Integer(*v.TopK) + } + + if v.TopP != nil { + ok := object.Key("topP") + switch { + case math.IsNaN(float64(*v.TopP)): + ok.String("NaN") + + case math.IsInf(float64(*v.TopP), 1): + ok.String("Infinity") + + case math.IsInf(float64(*v.TopP), -1): + ok.String("-Infinity") + + default: + ok.Float(*v.TopP) + + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIngestionJobFilter(v *types.IngestionJobFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Attribute) > 0 { + ok := object.Key("attribute") + ok.String(string(v.Attribute)) + } + + if len(v.Operator) > 0 { + ok := object.Key("operator") + ok.String(string(v.Operator)) + } + + if v.Values != nil { + ok := object.Key("values") + if err := awsRestjson1_serializeDocumentIngestionJobFilterValues(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIngestionJobFilters(v []types.IngestionJobFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentIngestionJobFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentIngestionJobFilterValues(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentIngestionJobSortBy(v *types.IngestionJobSortBy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Attribute) > 0 { + ok := object.Key("attribute") + ok.String(string(v.Attribute)) + } + + if len(v.Order) > 0 { + ok := object.Key("order") + ok.String(string(v.Order)) + } + + return nil +} + +func awsRestjson1_serializeDocumentInputFlowNodeConfiguration(v *types.InputFlowNodeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + +func awsRestjson1_serializeDocumentIntermediateStorage(v *types.IntermediateStorage, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.S3Location != nil { + ok := object.Key("s3Location") + if err := awsRestjson1_serializeDocumentS3Location(v.S3Location, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIteratorFlowNodeConfiguration(v *types.IteratorFlowNodeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + +func awsRestjson1_serializeDocumentKnowledgeBaseConfiguration(v *types.KnowledgeBaseConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + if v.VectorKnowledgeBaseConfiguration != nil { + ok := object.Key("vectorKnowledgeBaseConfiguration") + if err := awsRestjson1_serializeDocumentVectorKnowledgeBaseConfiguration(v.VectorKnowledgeBaseConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentKnowledgeBaseFlowNodeConfiguration(v *types.KnowledgeBaseFlowNodeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KnowledgeBaseId != nil { + ok := object.Key("knowledgeBaseId") + ok.String(*v.KnowledgeBaseId) + } + + if v.ModelId != nil { + ok := object.Key("modelId") + ok.String(*v.ModelId) + } + + return nil +} + +func awsRestjson1_serializeDocumentLambdaFunctionFlowNodeConfiguration(v *types.LambdaFunctionFlowNodeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LambdaArn != nil { + ok := object.Key("lambdaArn") + ok.String(*v.LambdaArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentLexFlowNodeConfiguration(v *types.LexFlowNodeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BotAliasArn != nil { + ok := object.Key("botAliasArn") + ok.String(*v.BotAliasArn) + } + + if v.LocaleId != nil { + ok := object.Key("localeId") + ok.String(*v.LocaleId) + } + + return nil +} + +func awsRestjson1_serializeDocumentMemoryConfiguration(v *types.MemoryConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EnabledMemoryTypes != nil { + ok := object.Key("enabledMemoryTypes") + if err := awsRestjson1_serializeDocumentEnabledMemoryTypes(v.EnabledMemoryTypes, ok); err != nil { + return err + } + } + + if v.StorageDays != nil { + ok := object.Key("storageDays") + ok.Integer(*v.StorageDays) + } + + return nil +} + +func awsRestjson1_serializeDocumentMongoDbAtlasConfiguration(v *types.MongoDbAtlasConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CollectionName != nil { + ok := object.Key("collectionName") + ok.String(*v.CollectionName) + } + + if v.CredentialsSecretArn != nil { + ok := object.Key("credentialsSecretArn") + ok.String(*v.CredentialsSecretArn) + } + + if v.DatabaseName != nil { + ok := object.Key("databaseName") + ok.String(*v.DatabaseName) + } + + if v.Endpoint != nil { + ok := object.Key("endpoint") + ok.String(*v.Endpoint) + } + + if v.EndpointServiceName != nil { + ok := object.Key("endpointServiceName") + ok.String(*v.EndpointServiceName) + } + + if v.FieldMapping != nil { + ok := object.Key("fieldMapping") + if err := awsRestjson1_serializeDocumentMongoDbAtlasFieldMapping(v.FieldMapping, ok); err != nil { + return err + } + } + + if v.VectorIndexName != nil { + ok := object.Key("vectorIndexName") + ok.String(*v.VectorIndexName) + } + + return nil +} + +func awsRestjson1_serializeDocumentMongoDbAtlasFieldMapping(v *types.MongoDbAtlasFieldMapping, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MetadataField != nil { + ok := object.Key("metadataField") + ok.String(*v.MetadataField) + } + + if v.TextField != nil { + ok := object.Key("textField") + ok.String(*v.TextField) + } + + if v.VectorField != nil { + ok := object.Key("vectorField") + ok.String(*v.VectorField) + } + + return nil +} + +func awsRestjson1_serializeDocumentOpenSearchServerlessConfiguration(v *types.OpenSearchServerlessConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CollectionArn != nil { + ok := object.Key("collectionArn") + ok.String(*v.CollectionArn) + } + + if v.FieldMapping != nil { + ok := object.Key("fieldMapping") + if err := awsRestjson1_serializeDocumentOpenSearchServerlessFieldMapping(v.FieldMapping, ok); err != nil { + return err + } + } + + if v.VectorIndexName != nil { + ok := object.Key("vectorIndexName") + ok.String(*v.VectorIndexName) + } + + return nil +} + +func awsRestjson1_serializeDocumentOpenSearchServerlessFieldMapping(v *types.OpenSearchServerlessFieldMapping, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MetadataField != nil { + ok := object.Key("metadataField") + ok.String(*v.MetadataField) + } + + if v.TextField != nil { + ok := object.Key("textField") + ok.String(*v.TextField) + } + + if v.VectorField != nil { + ok := object.Key("vectorField") + ok.String(*v.VectorField) + } + + return nil +} + +func awsRestjson1_serializeDocumentOutputFlowNodeConfiguration(v *types.OutputFlowNodeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + +func awsRestjson1_serializeDocumentParameterDetail(v *types.ParameterDetail, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Required != nil { + ok := object.Key("required") + ok.Boolean(*v.Required) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentParameterMap(v map[string]types.ParameterDetail, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + mapVar := v[key] + if err := awsRestjson1_serializeDocumentParameterDetail(&mapVar, om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentParsingConfiguration(v *types.ParsingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BedrockFoundationModelConfiguration != nil { + ok := object.Key("bedrockFoundationModelConfiguration") + if err := awsRestjson1_serializeDocumentBedrockFoundationModelConfiguration(v.BedrockFoundationModelConfiguration, ok); err != nil { + return err } } + if len(v.ParsingStrategy) > 0 { + ok := object.Key("parsingStrategy") + ok.String(string(v.ParsingStrategy)) + } + + return nil +} + +func awsRestjson1_serializeDocumentParsingPrompt(v *types.ParsingPrompt, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ParsingPromptText != nil { + ok := object.Key("parsingPromptText") + ok.String(*v.ParsingPromptText) + } + return nil } -func awsRestjson1_serializeDocumentActionGroupExecutor(v types.ActionGroupExecutor, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPatternObjectFilter(v *types.PatternObjectFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() - switch uv := v.(type) { - case *types.ActionGroupExecutorMemberCustomControl: - av := object.Key("customControl") - av.String(string(uv.Value)) + if v.ExclusionFilters != nil { + ok := object.Key("exclusionFilters") + if err := awsRestjson1_serializeDocumentFilterList(v.ExclusionFilters, ok); err != nil { + return err + } + } - case *types.ActionGroupExecutorMemberLambda: - av := object.Key("lambda") - av.String(uv.Value) + if v.InclusionFilters != nil { + ok := object.Key("inclusionFilters") + if err := awsRestjson1_serializeDocumentFilterList(v.InclusionFilters, ok); err != nil { + return err + } + } - default: - return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + if v.ObjectType != nil { + ok := object.Key("objectType") + ok.String(*v.ObjectType) + } + + return nil +} + +func awsRestjson1_serializeDocumentPatternObjectFilterConfiguration(v *types.PatternObjectFilterConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentPatternObjectFilterList(v.Filters, ok); err != nil { + return err + } } + return nil } -func awsRestjson1_serializeDocumentAgentAliasRoutingConfiguration(v []types.AgentAliasRoutingConfigurationListItem, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPatternObjectFilterList(v []types.PatternObjectFilter, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() - if err := awsRestjson1_serializeDocumentAgentAliasRoutingConfigurationListItem(&v[i], av); err != nil { + if err := awsRestjson1_serializeDocumentPatternObjectFilter(&v[i], av); err != nil { return err } } return nil } -func awsRestjson1_serializeDocumentAgentAliasRoutingConfigurationListItem(v *types.AgentAliasRoutingConfigurationListItem, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPineconeConfiguration(v *types.PineconeConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.AgentVersion != nil { - ok := object.Key("agentVersion") - ok.String(*v.AgentVersion) + if v.ConnectionString != nil { + ok := object.Key("connectionString") + ok.String(*v.ConnectionString) } - if v.ProvisionedThroughput != nil { - ok := object.Key("provisionedThroughput") - ok.String(*v.ProvisionedThroughput) + if v.CredentialsSecretArn != nil { + ok := object.Key("credentialsSecretArn") + ok.String(*v.CredentialsSecretArn) } - return nil -} - -func awsRestjson1_serializeDocumentAPISchema(v types.APISchema, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - switch uv := v.(type) { - case *types.APISchemaMemberPayload: - av := object.Key("payload") - av.String(uv.Value) - - case *types.APISchemaMemberS3: - av := object.Key("s3") - if err := awsRestjson1_serializeDocumentS3Identifier(&uv.Value, av); err != nil { + if v.FieldMapping != nil { + ok := object.Key("fieldMapping") + if err := awsRestjson1_serializeDocumentPineconeFieldMapping(v.FieldMapping, ok); err != nil { return err } + } - default: - return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) - + if v.Namespace != nil { + ok := object.Key("namespace") + ok.String(*v.Namespace) } + return nil } -func awsRestjson1_serializeDocumentBedrockEmbeddingModelConfiguration(v *types.BedrockEmbeddingModelConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPineconeFieldMapping(v *types.PineconeFieldMapping, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Dimensions != nil { - ok := object.Key("dimensions") - ok.Integer(*v.Dimensions) + if v.MetadataField != nil { + ok := object.Key("metadataField") + ok.String(*v.MetadataField) + } + + if v.TextField != nil { + ok := object.Key("textField") + ok.String(*v.TextField) } return nil } -func awsRestjson1_serializeDocumentChunkingConfiguration(v *types.ChunkingConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPromptConfiguration(v *types.PromptConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if len(v.ChunkingStrategy) > 0 { - ok := object.Key("chunkingStrategy") - ok.String(string(v.ChunkingStrategy)) + if v.BasePromptTemplate != nil { + ok := object.Key("basePromptTemplate") + ok.String(*v.BasePromptTemplate) } - if v.FixedSizeChunkingConfiguration != nil { - ok := object.Key("fixedSizeChunkingConfiguration") - if err := awsRestjson1_serializeDocumentFixedSizeChunkingConfiguration(v.FixedSizeChunkingConfiguration, ok); err != nil { + if v.InferenceConfiguration != nil { + ok := object.Key("inferenceConfiguration") + if err := awsRestjson1_serializeDocumentInferenceConfiguration(v.InferenceConfiguration, ok); err != nil { return err } } - return nil -} + if len(v.ParserMode) > 0 { + ok := object.Key("parserMode") + ok.String(string(v.ParserMode)) + } -func awsRestjson1_serializeDocumentDataSourceConfiguration(v *types.DataSourceConfiguration, value smithyjson.Value) error { - object := value.Object() - defer object.Close() + if len(v.PromptCreationMode) > 0 { + ok := object.Key("promptCreationMode") + ok.String(string(v.PromptCreationMode)) + } - if v.S3Configuration != nil { - ok := object.Key("s3Configuration") - if err := awsRestjson1_serializeDocumentS3DataSourceConfiguration(v.S3Configuration, ok); err != nil { - return err - } + if len(v.PromptState) > 0 { + ok := object.Key("promptState") + ok.String(string(v.PromptState)) } - if len(v.Type) > 0 { - ok := object.Key("type") - ok.String(string(v.Type)) + if len(v.PromptType) > 0 { + ok := object.Key("promptType") + ok.String(string(v.PromptType)) } return nil } -func awsRestjson1_serializeDocumentEmbeddingModelConfiguration(v *types.EmbeddingModelConfiguration, value smithyjson.Value) error { - object := value.Object() - defer object.Close() +func awsRestjson1_serializeDocumentPromptConfigurations(v []types.PromptConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() - if v.BedrockEmbeddingModelConfiguration != nil { - ok := object.Key("bedrockEmbeddingModelConfiguration") - if err := awsRestjson1_serializeDocumentBedrockEmbeddingModelConfiguration(v.BedrockEmbeddingModelConfiguration, ok); err != nil { + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPromptConfiguration(&v[i], av); err != nil { return err } } - return nil } -func awsRestjson1_serializeDocumentFixedSizeChunkingConfiguration(v *types.FixedSizeChunkingConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPromptFlowNodeConfiguration(v *types.PromptFlowNodeConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.MaxTokens != nil { - ok := object.Key("maxTokens") - ok.Integer(*v.MaxTokens) - } - - if v.OverlapPercentage != nil { - ok := object.Key("overlapPercentage") - ok.Integer(*v.OverlapPercentage) + if v.SourceConfiguration != nil { + ok := object.Key("sourceConfiguration") + if err := awsRestjson1_serializeDocumentPromptFlowNodeSourceConfiguration(v.SourceConfiguration, ok); err != nil { + return err + } } return nil } -func awsRestjson1_serializeDocumentFunction(v *types.Function, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPromptFlowNodeInlineConfiguration(v *types.PromptFlowNodeInlineConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) + if v.InferenceConfiguration != nil { + ok := object.Key("inferenceConfiguration") + if err := awsRestjson1_serializeDocumentPromptInferenceConfiguration(v.InferenceConfiguration, ok); err != nil { + return err + } } - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) + if v.ModelId != nil { + ok := object.Key("modelId") + ok.String(*v.ModelId) } - if v.Parameters != nil { - ok := object.Key("parameters") - if err := awsRestjson1_serializeDocumentParameterMap(v.Parameters, ok); err != nil { + if v.TemplateConfiguration != nil { + ok := object.Key("templateConfiguration") + if err := awsRestjson1_serializeDocumentPromptTemplateConfiguration(v.TemplateConfiguration, ok); err != nil { return err } } + if len(v.TemplateType) > 0 { + ok := object.Key("templateType") + ok.String(string(v.TemplateType)) + } + return nil } -func awsRestjson1_serializeDocumentFunctions(v []types.Function, value smithyjson.Value) error { - array := value.Array() - defer array.Close() +func awsRestjson1_serializeDocumentPromptFlowNodeResourceConfiguration(v *types.PromptFlowNodeResourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentFunction(&v[i], av); err != nil { + if v.PromptArn != nil { + ok := object.Key("promptArn") + ok.String(*v.PromptArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentPromptFlowNodeSourceConfiguration(v types.PromptFlowNodeSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.PromptFlowNodeSourceConfigurationMemberInline: + av := object.Key("inline") + if err := awsRestjson1_serializeDocumentPromptFlowNodeInlineConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.PromptFlowNodeSourceConfigurationMemberResource: + av := object.Key("resource") + if err := awsRestjson1_serializeDocumentPromptFlowNodeResourceConfiguration(&uv.Value, av); err != nil { return err } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + } return nil } -func awsRestjson1_serializeDocumentFunctionSchema(v types.FunctionSchema, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPromptInferenceConfiguration(v types.PromptInferenceConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { - case *types.FunctionSchemaMemberFunctions: - av := object.Key("functions") - if err := awsRestjson1_serializeDocumentFunctions(uv.Value, av); err != nil { + case *types.PromptInferenceConfigurationMemberText: + av := object.Key("text") + if err := awsRestjson1_serializeDocumentPromptModelInferenceConfiguration(&uv.Value, av); err != nil { return err } @@ -3963,30 +7072,38 @@ func awsRestjson1_serializeDocumentFunctionSchema(v types.FunctionSchema, value return nil } -func awsRestjson1_serializeDocumentGuardrailConfiguration(v *types.GuardrailConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPromptInputVariable(v *types.PromptInputVariable, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.GuardrailIdentifier != nil { - ok := object.Key("guardrailIdentifier") - ok.String(*v.GuardrailIdentifier) + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) } - if v.GuardrailVersion != nil { - ok := object.Key("guardrailVersion") - ok.String(*v.GuardrailVersion) - } + return nil +} + +func awsRestjson1_serializeDocumentPromptInputVariablesList(v []types.PromptInputVariable, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPromptInputVariable(&v[i], av); err != nil { + return err + } + } return nil } -func awsRestjson1_serializeDocumentInferenceConfiguration(v *types.InferenceConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPromptModelInferenceConfiguration(v *types.PromptModelInferenceConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.MaximumLength != nil { - ok := object.Key("maximumLength") - ok.Integer(*v.MaximumLength) + if v.MaxTokens != nil { + ok := object.Key("maxTokens") + ok.Integer(*v.MaxTokens) } if v.StopSequences != nil { @@ -4040,23 +7157,18 @@ func awsRestjson1_serializeDocumentInferenceConfiguration(v *types.InferenceConf return nil } -func awsRestjson1_serializeDocumentIngestionJobFilter(v *types.IngestionJobFilter, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPromptOverrideConfiguration(v *types.PromptOverrideConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if len(v.Attribute) > 0 { - ok := object.Key("attribute") - ok.String(string(v.Attribute)) - } - - if len(v.Operator) > 0 { - ok := object.Key("operator") - ok.String(string(v.Operator)) + if v.OverrideLambda != nil { + ok := object.Key("overrideLambda") + ok.String(*v.OverrideLambda) } - if v.Values != nil { - ok := object.Key("values") - if err := awsRestjson1_serializeDocumentIngestionJobFilterValues(v.Values, ok); err != nil { + if v.PromptConfigurations != nil { + ok := object.Key("promptConfigurations") + if err := awsRestjson1_serializeDocumentPromptConfigurations(v.PromptConfigurations, ok); err != nil { return err } } @@ -4064,75 +7176,77 @@ func awsRestjson1_serializeDocumentIngestionJobFilter(v *types.IngestionJobFilte return nil } -func awsRestjson1_serializeDocumentIngestionJobFilters(v []types.IngestionJobFilter, value smithyjson.Value) error { - array := value.Array() - defer array.Close() +func awsRestjson1_serializeDocumentPromptTemplateConfiguration(v types.PromptTemplateConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentIngestionJobFilter(&v[i], av); err != nil { + switch uv := v.(type) { + case *types.PromptTemplateConfigurationMemberText: + av := object.Key("text") + if err := awsRestjson1_serializeDocumentTextPromptTemplateConfiguration(&uv.Value, av); err != nil { return err } - } - return nil -} -func awsRestjson1_serializeDocumentIngestionJobFilterValues(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) - for i := range v { - av := array.Value() - av.String(v[i]) } return nil } -func awsRestjson1_serializeDocumentIngestionJobSortBy(v *types.IngestionJobSortBy, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentPromptVariant(v *types.PromptVariant, value smithyjson.Value) error { object := value.Object() defer object.Close() - if len(v.Attribute) > 0 { - ok := object.Key("attribute") - ok.String(string(v.Attribute)) + if v.InferenceConfiguration != nil { + ok := object.Key("inferenceConfiguration") + if err := awsRestjson1_serializeDocumentPromptInferenceConfiguration(v.InferenceConfiguration, ok); err != nil { + return err + } } - if len(v.Order) > 0 { - ok := object.Key("order") - ok.String(string(v.Order)) + if v.ModelId != nil { + ok := object.Key("modelId") + ok.String(*v.ModelId) } - return nil -} + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } -func awsRestjson1_serializeDocumentKnowledgeBaseConfiguration(v *types.KnowledgeBaseConfiguration, value smithyjson.Value) error { - object := value.Object() - defer object.Close() + if v.TemplateConfiguration != nil { + ok := object.Key("templateConfiguration") + if err := awsRestjson1_serializeDocumentPromptTemplateConfiguration(v.TemplateConfiguration, ok); err != nil { + return err + } + } - if len(v.Type) > 0 { - ok := object.Key("type") - ok.String(string(v.Type)) + if len(v.TemplateType) > 0 { + ok := object.Key("templateType") + ok.String(string(v.TemplateType)) } - if v.VectorKnowledgeBaseConfiguration != nil { - ok := object.Key("vectorKnowledgeBaseConfiguration") - if err := awsRestjson1_serializeDocumentVectorKnowledgeBaseConfiguration(v.VectorKnowledgeBaseConfiguration, ok); err != nil { + return nil +} + +func awsRestjson1_serializeDocumentPromptVariantList(v []types.PromptVariant, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPromptVariant(&v[i], av); err != nil { return err } } - return nil } -func awsRestjson1_serializeDocumentMongoDbAtlasConfiguration(v *types.MongoDbAtlasConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentRdsConfiguration(v *types.RdsConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.CollectionName != nil { - ok := object.Key("collectionName") - ok.String(*v.CollectionName) - } - if v.CredentialsSecretArn != nil { ok := object.Key("credentialsSecretArn") ok.String(*v.CredentialsSecretArn) @@ -4143,32 +7257,27 @@ func awsRestjson1_serializeDocumentMongoDbAtlasConfiguration(v *types.MongoDbAtl ok.String(*v.DatabaseName) } - if v.Endpoint != nil { - ok := object.Key("endpoint") - ok.String(*v.Endpoint) - } - - if v.EndpointServiceName != nil { - ok := object.Key("endpointServiceName") - ok.String(*v.EndpointServiceName) - } - if v.FieldMapping != nil { ok := object.Key("fieldMapping") - if err := awsRestjson1_serializeDocumentMongoDbAtlasFieldMapping(v.FieldMapping, ok); err != nil { + if err := awsRestjson1_serializeDocumentRdsFieldMapping(v.FieldMapping, ok); err != nil { return err } } - if v.VectorIndexName != nil { - ok := object.Key("vectorIndexName") - ok.String(*v.VectorIndexName) + if v.ResourceArn != nil { + ok := object.Key("resourceArn") + ok.String(*v.ResourceArn) + } + + if v.TableName != nil { + ok := object.Key("tableName") + ok.String(*v.TableName) } return nil } -func awsRestjson1_serializeDocumentMongoDbAtlasFieldMapping(v *types.MongoDbAtlasFieldMapping, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentRdsFieldMapping(v *types.RdsFieldMapping, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4177,6 +7286,11 @@ func awsRestjson1_serializeDocumentMongoDbAtlasFieldMapping(v *types.MongoDbAtla ok.String(*v.MetadataField) } + if v.PrimaryKeyField != nil { + ok := object.Key("primaryKeyField") + ok.String(*v.PrimaryKeyField) + } + if v.TextField != nil { ok := object.Key("textField") ok.String(*v.TextField) @@ -4190,18 +7304,23 @@ func awsRestjson1_serializeDocumentMongoDbAtlasFieldMapping(v *types.MongoDbAtla return nil } -func awsRestjson1_serializeDocumentOpenSearchServerlessConfiguration(v *types.OpenSearchServerlessConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentRedisEnterpriseCloudConfiguration(v *types.RedisEnterpriseCloudConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.CollectionArn != nil { - ok := object.Key("collectionArn") - ok.String(*v.CollectionArn) + if v.CredentialsSecretArn != nil { + ok := object.Key("credentialsSecretArn") + ok.String(*v.CredentialsSecretArn) + } + + if v.Endpoint != nil { + ok := object.Key("endpoint") + ok.String(*v.Endpoint) } if v.FieldMapping != nil { ok := object.Key("fieldMapping") - if err := awsRestjson1_serializeDocumentOpenSearchServerlessFieldMapping(v.FieldMapping, ok); err != nil { + if err := awsRestjson1_serializeDocumentRedisEnterpriseCloudFieldMapping(v.FieldMapping, ok); err != nil { return err } } @@ -4214,7 +7333,7 @@ func awsRestjson1_serializeDocumentOpenSearchServerlessConfiguration(v *types.Op return nil } -func awsRestjson1_serializeDocumentOpenSearchServerlessFieldMapping(v *types.OpenSearchServerlessFieldMapping, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentRedisEnterpriseCloudFieldMapping(v *types.RedisEnterpriseCloudFieldMapping, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4236,152 +7355,121 @@ func awsRestjson1_serializeDocumentOpenSearchServerlessFieldMapping(v *types.Ope return nil } -func awsRestjson1_serializeDocumentParameterDetail(v *types.ParameterDetail, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentRetrievalFlowNodeConfiguration(v *types.RetrievalFlowNodeConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) + if v.ServiceConfiguration != nil { + ok := object.Key("serviceConfiguration") + if err := awsRestjson1_serializeDocumentRetrievalFlowNodeServiceConfiguration(v.ServiceConfiguration, ok); err != nil { + return err + } } - if v.Required != nil { - ok := object.Key("required") - ok.Boolean(*v.Required) - } + return nil +} - if len(v.Type) > 0 { - ok := object.Key("type") - ok.String(string(v.Type)) +func awsRestjson1_serializeDocumentRetrievalFlowNodeS3Configuration(v *types.RetrievalFlowNodeS3Configuration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BucketName != nil { + ok := object.Key("bucketName") + ok.String(*v.BucketName) } return nil } -func awsRestjson1_serializeDocumentParameterMap(v map[string]types.ParameterDetail, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentRetrievalFlowNodeServiceConfiguration(v types.RetrievalFlowNodeServiceConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - for key := range v { - om := object.Key(key) - mapVar := v[key] - if err := awsRestjson1_serializeDocumentParameterDetail(&mapVar, om); err != nil { + switch uv := v.(type) { + case *types.RetrievalFlowNodeServiceConfigurationMemberS3: + av := object.Key("s3") + if err := awsRestjson1_serializeDocumentRetrievalFlowNodeS3Configuration(&uv.Value, av); err != nil { return err } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + } return nil } -func awsRestjson1_serializeDocumentPineconeConfiguration(v *types.PineconeConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentS3DataSourceConfiguration(v *types.S3DataSourceConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.ConnectionString != nil { - ok := object.Key("connectionString") - ok.String(*v.ConnectionString) + if v.BucketArn != nil { + ok := object.Key("bucketArn") + ok.String(*v.BucketArn) } - if v.CredentialsSecretArn != nil { - ok := object.Key("credentialsSecretArn") - ok.String(*v.CredentialsSecretArn) + if v.BucketOwnerAccountId != nil { + ok := object.Key("bucketOwnerAccountId") + ok.String(*v.BucketOwnerAccountId) } - if v.FieldMapping != nil { - ok := object.Key("fieldMapping") - if err := awsRestjson1_serializeDocumentPineconeFieldMapping(v.FieldMapping, ok); err != nil { + if v.InclusionPrefixes != nil { + ok := object.Key("inclusionPrefixes") + if err := awsRestjson1_serializeDocumentS3Prefixes(v.InclusionPrefixes, ok); err != nil { return err } } - if v.Namespace != nil { - ok := object.Key("namespace") - ok.String(*v.Namespace) - } - return nil } -func awsRestjson1_serializeDocumentPineconeFieldMapping(v *types.PineconeFieldMapping, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentS3Identifier(v *types.S3Identifier, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.MetadataField != nil { - ok := object.Key("metadataField") - ok.String(*v.MetadataField) + if v.S3BucketName != nil { + ok := object.Key("s3BucketName") + ok.String(*v.S3BucketName) } - if v.TextField != nil { - ok := object.Key("textField") - ok.String(*v.TextField) + if v.S3ObjectKey != nil { + ok := object.Key("s3ObjectKey") + ok.String(*v.S3ObjectKey) } return nil } -func awsRestjson1_serializeDocumentPromptConfiguration(v *types.PromptConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentS3Location(v *types.S3Location, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.BasePromptTemplate != nil { - ok := object.Key("basePromptTemplate") - ok.String(*v.BasePromptTemplate) - } - - if v.InferenceConfiguration != nil { - ok := object.Key("inferenceConfiguration") - if err := awsRestjson1_serializeDocumentInferenceConfiguration(v.InferenceConfiguration, ok); err != nil { - return err - } - } - - if len(v.ParserMode) > 0 { - ok := object.Key("parserMode") - ok.String(string(v.ParserMode)) - } - - if len(v.PromptCreationMode) > 0 { - ok := object.Key("promptCreationMode") - ok.String(string(v.PromptCreationMode)) - } - - if len(v.PromptState) > 0 { - ok := object.Key("promptState") - ok.String(string(v.PromptState)) - } - - if len(v.PromptType) > 0 { - ok := object.Key("promptType") - ok.String(string(v.PromptType)) + if v.Uri != nil { + ok := object.Key("uri") + ok.String(*v.Uri) } return nil } -func awsRestjson1_serializeDocumentPromptConfigurations(v []types.PromptConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentS3Prefixes(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() - if err := awsRestjson1_serializeDocumentPromptConfiguration(&v[i], av); err != nil { - return err - } + av.String(v[i]) } return nil } -func awsRestjson1_serializeDocumentPromptOverrideConfiguration(v *types.PromptOverrideConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentSalesforceCrawlerConfiguration(v *types.SalesforceCrawlerConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.OverrideLambda != nil { - ok := object.Key("overrideLambda") - ok.String(*v.OverrideLambda) - } - - if v.PromptConfigurations != nil { - ok := object.Key("promptConfigurations") - if err := awsRestjson1_serializeDocumentPromptConfigurations(v.PromptConfigurations, ok); err != nil { + if v.FilterConfiguration != nil { + ok := object.Key("filterConfiguration") + if err := awsRestjson1_serializeDocumentCrawlFilterConfiguration(v.FilterConfiguration, ok); err != nil { return err } } @@ -4389,135 +7477,115 @@ func awsRestjson1_serializeDocumentPromptOverrideConfiguration(v *types.PromptOv return nil } -func awsRestjson1_serializeDocumentRdsConfiguration(v *types.RdsConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentSalesforceDataSourceConfiguration(v *types.SalesforceDataSourceConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.CredentialsSecretArn != nil { - ok := object.Key("credentialsSecretArn") - ok.String(*v.CredentialsSecretArn) - } - - if v.DatabaseName != nil { - ok := object.Key("databaseName") - ok.String(*v.DatabaseName) - } - - if v.FieldMapping != nil { - ok := object.Key("fieldMapping") - if err := awsRestjson1_serializeDocumentRdsFieldMapping(v.FieldMapping, ok); err != nil { + if v.CrawlerConfiguration != nil { + ok := object.Key("crawlerConfiguration") + if err := awsRestjson1_serializeDocumentSalesforceCrawlerConfiguration(v.CrawlerConfiguration, ok); err != nil { return err } } - if v.ResourceArn != nil { - ok := object.Key("resourceArn") - ok.String(*v.ResourceArn) - } - - if v.TableName != nil { - ok := object.Key("tableName") - ok.String(*v.TableName) - } - - return nil -} - -func awsRestjson1_serializeDocumentRdsFieldMapping(v *types.RdsFieldMapping, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MetadataField != nil { - ok := object.Key("metadataField") - ok.String(*v.MetadataField) - } - - if v.PrimaryKeyField != nil { - ok := object.Key("primaryKeyField") - ok.String(*v.PrimaryKeyField) - } - - if v.TextField != nil { - ok := object.Key("textField") - ok.String(*v.TextField) - } - - if v.VectorField != nil { - ok := object.Key("vectorField") - ok.String(*v.VectorField) + if v.SourceConfiguration != nil { + ok := object.Key("sourceConfiguration") + if err := awsRestjson1_serializeDocumentSalesforceSourceConfiguration(v.SourceConfiguration, ok); err != nil { + return err + } } return nil } -func awsRestjson1_serializeDocumentRedisEnterpriseCloudConfiguration(v *types.RedisEnterpriseCloudConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentSalesforceSourceConfiguration(v *types.SalesforceSourceConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() + if len(v.AuthType) > 0 { + ok := object.Key("authType") + ok.String(string(v.AuthType)) + } + if v.CredentialsSecretArn != nil { ok := object.Key("credentialsSecretArn") ok.String(*v.CredentialsSecretArn) } - if v.Endpoint != nil { - ok := object.Key("endpoint") - ok.String(*v.Endpoint) + if v.HostUrl != nil { + ok := object.Key("hostUrl") + ok.String(*v.HostUrl) } - if v.FieldMapping != nil { - ok := object.Key("fieldMapping") - if err := awsRestjson1_serializeDocumentRedisEnterpriseCloudFieldMapping(v.FieldMapping, ok); err != nil { - return err - } - } + return nil +} - if v.VectorIndexName != nil { - ok := object.Key("vectorIndexName") - ok.String(*v.VectorIndexName) +func awsRestjson1_serializeDocumentSeedUrl(v *types.SeedUrl, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Url != nil { + ok := object.Key("url") + ok.String(*v.Url) } return nil } -func awsRestjson1_serializeDocumentRedisEnterpriseCloudFieldMapping(v *types.RedisEnterpriseCloudFieldMapping, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentSeedUrls(v []types.SeedUrl, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSeedUrl(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentSemanticChunkingConfiguration(v *types.SemanticChunkingConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.MetadataField != nil { - ok := object.Key("metadataField") - ok.String(*v.MetadataField) + if v.BreakpointPercentileThreshold != nil { + ok := object.Key("breakpointPercentileThreshold") + ok.Integer(*v.BreakpointPercentileThreshold) } - if v.TextField != nil { - ok := object.Key("textField") - ok.String(*v.TextField) + if v.BufferSize != nil { + ok := object.Key("bufferSize") + ok.Integer(*v.BufferSize) } - if v.VectorField != nil { - ok := object.Key("vectorField") - ok.String(*v.VectorField) + if v.MaxTokens != nil { + ok := object.Key("maxTokens") + ok.Integer(*v.MaxTokens) } return nil } -func awsRestjson1_serializeDocumentS3DataSourceConfiguration(v *types.S3DataSourceConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentServerSideEncryptionConfiguration(v *types.ServerSideEncryptionConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.BucketArn != nil { - ok := object.Key("bucketArn") - ok.String(*v.BucketArn) + if v.KmsKeyArn != nil { + ok := object.Key("kmsKeyArn") + ok.String(*v.KmsKeyArn) } - if v.BucketOwnerAccountId != nil { - ok := object.Key("bucketOwnerAccountId") - ok.String(*v.BucketOwnerAccountId) - } + return nil +} - if v.InclusionPrefixes != nil { - ok := object.Key("inclusionPrefixes") - if err := awsRestjson1_serializeDocumentS3Prefixes(v.InclusionPrefixes, ok); err != nil { +func awsRestjson1_serializeDocumentSharePointCrawlerConfiguration(v *types.SharePointCrawlerConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FilterConfiguration != nil { + ok := object.Key("filterConfiguration") + if err := awsRestjson1_serializeDocumentCrawlFilterConfiguration(v.FilterConfiguration, ok); err != nil { return err } } @@ -4525,24 +7593,28 @@ func awsRestjson1_serializeDocumentS3DataSourceConfiguration(v *types.S3DataSour return nil } -func awsRestjson1_serializeDocumentS3Identifier(v *types.S3Identifier, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentSharePointDataSourceConfiguration(v *types.SharePointDataSourceConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.S3BucketName != nil { - ok := object.Key("s3BucketName") - ok.String(*v.S3BucketName) + if v.CrawlerConfiguration != nil { + ok := object.Key("crawlerConfiguration") + if err := awsRestjson1_serializeDocumentSharePointCrawlerConfiguration(v.CrawlerConfiguration, ok); err != nil { + return err + } } - if v.S3ObjectKey != nil { - ok := object.Key("s3ObjectKey") - ok.String(*v.S3ObjectKey) + if v.SourceConfiguration != nil { + ok := object.Key("sourceConfiguration") + if err := awsRestjson1_serializeDocumentSharePointSourceConfiguration(v.SourceConfiguration, ok); err != nil { + return err + } } return nil } -func awsRestjson1_serializeDocumentS3Prefixes(v []string, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentSharePointSiteUrls(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -4553,13 +7625,40 @@ func awsRestjson1_serializeDocumentS3Prefixes(v []string, value smithyjson.Value return nil } -func awsRestjson1_serializeDocumentServerSideEncryptionConfiguration(v *types.ServerSideEncryptionConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentSharePointSourceConfiguration(v *types.SharePointSourceConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.KmsKeyArn != nil { - ok := object.Key("kmsKeyArn") - ok.String(*v.KmsKeyArn) + if len(v.AuthType) > 0 { + ok := object.Key("authType") + ok.String(string(v.AuthType)) + } + + if v.CredentialsSecretArn != nil { + ok := object.Key("credentialsSecretArn") + ok.String(*v.CredentialsSecretArn) + } + + if v.Domain != nil { + ok := object.Key("domain") + ok.String(*v.Domain) + } + + if len(v.HostType) > 0 { + ok := object.Key("hostType") + ok.String(string(v.HostType)) + } + + if v.SiteUrls != nil { + ok := object.Key("siteUrls") + if err := awsRestjson1_serializeDocumentSharePointSiteUrls(v.SiteUrls, ok); err != nil { + return err + } + } + + if v.TenantId != nil { + ok := object.Key("tenantId") + ok.String(*v.TenantId) } return nil @@ -4623,6 +7722,50 @@ func awsRestjson1_serializeDocumentStorageConfiguration(v *types.StorageConfigur return nil } +func awsRestjson1_serializeDocumentStorageFlowNodeConfiguration(v *types.StorageFlowNodeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ServiceConfiguration != nil { + ok := object.Key("serviceConfiguration") + if err := awsRestjson1_serializeDocumentStorageFlowNodeServiceConfiguration(v.ServiceConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentStorageFlowNodeS3Configuration(v *types.StorageFlowNodeS3Configuration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BucketName != nil { + ok := object.Key("bucketName") + ok.String(*v.BucketName) + } + + return nil +} + +func awsRestjson1_serializeDocumentStorageFlowNodeServiceConfiguration(v types.StorageFlowNodeServiceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.StorageFlowNodeServiceConfigurationMemberS3: + av := object.Key("s3") + if err := awsRestjson1_serializeDocumentStorageFlowNodeS3Configuration(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + func awsRestjson1_serializeDocumentTagsMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4634,6 +7777,97 @@ func awsRestjson1_serializeDocumentTagsMap(v map[string]string, value smithyjson return nil } +func awsRestjson1_serializeDocumentTextPromptTemplateConfiguration(v *types.TextPromptTemplateConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.InputVariables != nil { + ok := object.Key("inputVariables") + if err := awsRestjson1_serializeDocumentPromptInputVariablesList(v.InputVariables, ok); err != nil { + return err + } + } + + if v.Text != nil { + ok := object.Key("text") + ok.String(*v.Text) + } + + return nil +} + +func awsRestjson1_serializeDocumentTransformation(v *types.Transformation, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.StepToApply) > 0 { + ok := object.Key("stepToApply") + ok.String(string(v.StepToApply)) + } + + if v.TransformationFunction != nil { + ok := object.Key("transformationFunction") + if err := awsRestjson1_serializeDocumentTransformationFunction(v.TransformationFunction, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentTransformationFunction(v *types.TransformationFunction, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TransformationLambdaConfiguration != nil { + ok := object.Key("transformationLambdaConfiguration") + if err := awsRestjson1_serializeDocumentTransformationLambdaConfiguration(v.TransformationLambdaConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentTransformationLambdaConfiguration(v *types.TransformationLambdaConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LambdaArn != nil { + ok := object.Key("lambdaArn") + ok.String(*v.LambdaArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentTransformations(v []types.Transformation, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTransformation(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentUrlConfiguration(v *types.UrlConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SeedUrls != nil { + ok := object.Key("seedUrls") + if err := awsRestjson1_serializeDocumentSeedUrls(v.SeedUrls, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentVectorIngestionConfiguration(v *types.VectorIngestionConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4645,6 +7879,20 @@ func awsRestjson1_serializeDocumentVectorIngestionConfiguration(v *types.VectorI } } + if v.CustomTransformationConfiguration != nil { + ok := object.Key("customTransformationConfiguration") + if err := awsRestjson1_serializeDocumentCustomTransformationConfiguration(v.CustomTransformationConfiguration, ok); err != nil { + return err + } + } + + if v.ParsingConfiguration != nil { + ok := object.Key("parsingConfiguration") + if err := awsRestjson1_serializeDocumentParsingConfiguration(v.ParsingConfiguration, ok); err != nil { + return err + } + } + return nil } @@ -4666,3 +7914,83 @@ func awsRestjson1_serializeDocumentVectorKnowledgeBaseConfiguration(v *types.Vec return nil } + +func awsRestjson1_serializeDocumentWebCrawlerConfiguration(v *types.WebCrawlerConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CrawlerLimits != nil { + ok := object.Key("crawlerLimits") + if err := awsRestjson1_serializeDocumentWebCrawlerLimits(v.CrawlerLimits, ok); err != nil { + return err + } + } + + if v.ExclusionFilters != nil { + ok := object.Key("exclusionFilters") + if err := awsRestjson1_serializeDocumentFilterList(v.ExclusionFilters, ok); err != nil { + return err + } + } + + if v.InclusionFilters != nil { + ok := object.Key("inclusionFilters") + if err := awsRestjson1_serializeDocumentFilterList(v.InclusionFilters, ok); err != nil { + return err + } + } + + if len(v.Scope) > 0 { + ok := object.Key("scope") + ok.String(string(v.Scope)) + } + + return nil +} + +func awsRestjson1_serializeDocumentWebCrawlerLimits(v *types.WebCrawlerLimits, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RateLimit != nil { + ok := object.Key("rateLimit") + ok.Integer(*v.RateLimit) + } + + return nil +} + +func awsRestjson1_serializeDocumentWebDataSourceConfiguration(v *types.WebDataSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CrawlerConfiguration != nil { + ok := object.Key("crawlerConfiguration") + if err := awsRestjson1_serializeDocumentWebCrawlerConfiguration(v.CrawlerConfiguration, ok); err != nil { + return err + } + } + + if v.SourceConfiguration != nil { + ok := object.Key("sourceConfiguration") + if err := awsRestjson1_serializeDocumentWebSourceConfiguration(v.SourceConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentWebSourceConfiguration(v *types.WebSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.UrlConfiguration != nil { + ok := object.Key("urlConfiguration") + if err := awsRestjson1_serializeDocumentUrlConfiguration(v.UrlConfiguration, ok); err != nil { + return err + } + } + + return nil +} diff --git a/service/bedrockagent/snapshot/api_op_CreateFlow.go.snap b/service/bedrockagent/snapshot/api_op_CreateFlow.go.snap new file mode 100644 index 00000000000..16a168f29fd --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_CreateFlow.go.snap @@ -0,0 +1,37 @@ +CreateFlow + Initialize stack step + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_CreateFlowAlias.go.snap b/service/bedrockagent/snapshot/api_op_CreateFlowAlias.go.snap new file mode 100644 index 00000000000..213ff66f961 --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_CreateFlowAlias.go.snap @@ -0,0 +1,37 @@ +CreateFlowAlias + Initialize stack step + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_CreateFlowVersion.go.snap b/service/bedrockagent/snapshot/api_op_CreateFlowVersion.go.snap new file mode 100644 index 00000000000..75d40d1585c --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_CreateFlowVersion.go.snap @@ -0,0 +1,37 @@ +CreateFlowVersion + Initialize stack step + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_CreatePrompt.go.snap b/service/bedrockagent/snapshot/api_op_CreatePrompt.go.snap new file mode 100644 index 00000000000..22a69cde5cf --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_CreatePrompt.go.snap @@ -0,0 +1,37 @@ +CreatePrompt + Initialize stack step + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_CreatePromptVersion.go.snap b/service/bedrockagent/snapshot/api_op_CreatePromptVersion.go.snap new file mode 100644 index 00000000000..e1f19b2948f --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_CreatePromptVersion.go.snap @@ -0,0 +1,37 @@ +CreatePromptVersion + Initialize stack step + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_DeleteFlow.go.snap b/service/bedrockagent/snapshot/api_op_DeleteFlow.go.snap new file mode 100644 index 00000000000..ab0f08fde86 --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_DeleteFlow.go.snap @@ -0,0 +1,36 @@ +DeleteFlow + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_DeleteFlowAlias.go.snap b/service/bedrockagent/snapshot/api_op_DeleteFlowAlias.go.snap new file mode 100644 index 00000000000..209f7307e14 --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_DeleteFlowAlias.go.snap @@ -0,0 +1,36 @@ +DeleteFlowAlias + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_DeleteFlowVersion.go.snap b/service/bedrockagent/snapshot/api_op_DeleteFlowVersion.go.snap new file mode 100644 index 00000000000..f145f922d6b --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_DeleteFlowVersion.go.snap @@ -0,0 +1,36 @@ +DeleteFlowVersion + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_DeletePrompt.go.snap b/service/bedrockagent/snapshot/api_op_DeletePrompt.go.snap new file mode 100644 index 00000000000..a7c0bccfb38 --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_DeletePrompt.go.snap @@ -0,0 +1,36 @@ +DeletePrompt + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_GetFlow.go.snap b/service/bedrockagent/snapshot/api_op_GetFlow.go.snap new file mode 100644 index 00000000000..602ac33f3b6 --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_GetFlow.go.snap @@ -0,0 +1,36 @@ +GetFlow + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_GetFlowAlias.go.snap b/service/bedrockagent/snapshot/api_op_GetFlowAlias.go.snap new file mode 100644 index 00000000000..bd8d940fe58 --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_GetFlowAlias.go.snap @@ -0,0 +1,36 @@ +GetFlowAlias + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_GetFlowVersion.go.snap b/service/bedrockagent/snapshot/api_op_GetFlowVersion.go.snap new file mode 100644 index 00000000000..6910dc3755e --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_GetFlowVersion.go.snap @@ -0,0 +1,36 @@ +GetFlowVersion + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_GetPrompt.go.snap b/service/bedrockagent/snapshot/api_op_GetPrompt.go.snap new file mode 100644 index 00000000000..565c685d15d --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_GetPrompt.go.snap @@ -0,0 +1,36 @@ +GetPrompt + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_ListFlowAliases.go.snap b/service/bedrockagent/snapshot/api_op_ListFlowAliases.go.snap new file mode 100644 index 00000000000..7d885cfb4ec --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_ListFlowAliases.go.snap @@ -0,0 +1,36 @@ +ListFlowAliases + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_ListFlowVersions.go.snap b/service/bedrockagent/snapshot/api_op_ListFlowVersions.go.snap new file mode 100644 index 00000000000..31713c3b01d --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_ListFlowVersions.go.snap @@ -0,0 +1,36 @@ +ListFlowVersions + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_ListFlows.go.snap b/service/bedrockagent/snapshot/api_op_ListFlows.go.snap new file mode 100644 index 00000000000..3c67b77a634 --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_ListFlows.go.snap @@ -0,0 +1,35 @@ +ListFlows + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_ListPrompts.go.snap b/service/bedrockagent/snapshot/api_op_ListPrompts.go.snap new file mode 100644 index 00000000000..a5760dfebc9 --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_ListPrompts.go.snap @@ -0,0 +1,35 @@ +ListPrompts + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_PrepareFlow.go.snap b/service/bedrockagent/snapshot/api_op_PrepareFlow.go.snap new file mode 100644 index 00000000000..ef91602ca68 --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_PrepareFlow.go.snap @@ -0,0 +1,36 @@ +PrepareFlow + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_UpdateFlow.go.snap b/service/bedrockagent/snapshot/api_op_UpdateFlow.go.snap new file mode 100644 index 00000000000..68594087bac --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_UpdateFlow.go.snap @@ -0,0 +1,36 @@ +UpdateFlow + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_UpdateFlowAlias.go.snap b/service/bedrockagent/snapshot/api_op_UpdateFlowAlias.go.snap new file mode 100644 index 00000000000..1d253923065 --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_UpdateFlowAlias.go.snap @@ -0,0 +1,36 @@ +UpdateFlowAlias + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot/api_op_UpdatePrompt.go.snap b/service/bedrockagent/snapshot/api_op_UpdatePrompt.go.snap new file mode 100644 index 00000000000..712887f281f --- /dev/null +++ b/service/bedrockagent/snapshot/api_op_UpdatePrompt.go.snap @@ -0,0 +1,36 @@ +UpdatePrompt + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagent/snapshot_test.go b/service/bedrockagent/snapshot_test.go index ae5b4c9fdba..59903078d26 100644 --- a/service/bedrockagent/snapshot_test.go +++ b/service/bedrockagent/snapshot_test.go @@ -122,6 +122,42 @@ func TestCheckSnapshot_CreateDataSource(t *testing.T) { } } +func TestCheckSnapshot_CreateFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_CreateFlowAlias(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateFlowAlias(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateFlowAlias") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_CreateFlowVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateFlowVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateFlowVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateKnowledgeBase(t *testing.T) { svc := New(Options{}) _, err := svc.CreateKnowledgeBase(context.Background(), nil, func(o *Options) { @@ -134,6 +170,30 @@ func TestCheckSnapshot_CreateKnowledgeBase(t *testing.T) { } } +func TestCheckSnapshot_CreatePrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreatePrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreatePrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_CreatePromptVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreatePromptVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreatePromptVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteAgent(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteAgent(context.Background(), nil, func(o *Options) { @@ -194,6 +254,42 @@ func TestCheckSnapshot_DeleteDataSource(t *testing.T) { } } +func TestCheckSnapshot_DeleteFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteFlowAlias(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteFlowAlias(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteFlowAlias") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteFlowVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteFlowVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteFlowVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteKnowledgeBase(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteKnowledgeBase(context.Background(), nil, func(o *Options) { @@ -206,6 +302,18 @@ func TestCheckSnapshot_DeleteKnowledgeBase(t *testing.T) { } } +func TestCheckSnapshot_DeletePrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeletePrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeletePrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DisassociateAgentKnowledgeBase(t *testing.T) { svc := New(Options{}) _, err := svc.DisassociateAgentKnowledgeBase(context.Background(), nil, func(o *Options) { @@ -290,6 +398,42 @@ func TestCheckSnapshot_GetDataSource(t *testing.T) { } } +func TestCheckSnapshot_GetFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetFlowAlias(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetFlowAlias(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetFlowAlias") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetFlowVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetFlowVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetFlowVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetIngestionJob(t *testing.T) { svc := New(Options{}) _, err := svc.GetIngestionJob(context.Background(), nil, func(o *Options) { @@ -314,6 +458,18 @@ func TestCheckSnapshot_GetKnowledgeBase(t *testing.T) { } } +func TestCheckSnapshot_GetPrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetPrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetPrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListAgentActionGroups(t *testing.T) { svc := New(Options{}) _, err := svc.ListAgentActionGroups(context.Background(), nil, func(o *Options) { @@ -386,6 +542,42 @@ func TestCheckSnapshot_ListDataSources(t *testing.T) { } } +func TestCheckSnapshot_ListFlowAliases(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListFlowAliases(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListFlowAliases") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListFlows(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListFlows(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListFlows") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListFlowVersions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListFlowVersions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListFlowVersions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListIngestionJobs(t *testing.T) { svc := New(Options{}) _, err := svc.ListIngestionJobs(context.Background(), nil, func(o *Options) { @@ -410,6 +602,18 @@ func TestCheckSnapshot_ListKnowledgeBases(t *testing.T) { } } +func TestCheckSnapshot_ListPrompts(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListPrompts(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListPrompts") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -434,6 +638,18 @@ func TestCheckSnapshot_PrepareAgent(t *testing.T) { } } +func TestCheckSnapshot_PrepareFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.PrepareFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PrepareFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_StartIngestionJob(t *testing.T) { svc := New(Options{}) _, err := svc.StartIngestionJob(context.Background(), nil, func(o *Options) { @@ -530,6 +746,30 @@ func TestCheckSnapshot_UpdateDataSource(t *testing.T) { } } +func TestCheckSnapshot_UpdateFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateFlowAlias(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateFlowAlias(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateFlowAlias") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateKnowledgeBase(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateKnowledgeBase(context.Background(), nil, func(o *Options) { @@ -541,6 +781,18 @@ func TestCheckSnapshot_UpdateKnowledgeBase(t *testing.T) { t.Fatal(err) } } + +func TestCheckSnapshot_UpdatePrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdatePrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdatePrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} func TestUpdateSnapshot_AssociateAgentKnowledgeBase(t *testing.T) { svc := New(Options{}) _, err := svc.AssociateAgentKnowledgeBase(context.Background(), nil, func(o *Options) { @@ -601,6 +853,42 @@ func TestUpdateSnapshot_CreateDataSource(t *testing.T) { } } +func TestUpdateSnapshot_CreateFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_CreateFlowAlias(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateFlowAlias(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateFlowAlias") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_CreateFlowVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateFlowVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateFlowVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateKnowledgeBase(t *testing.T) { svc := New(Options{}) _, err := svc.CreateKnowledgeBase(context.Background(), nil, func(o *Options) { @@ -613,6 +901,30 @@ func TestUpdateSnapshot_CreateKnowledgeBase(t *testing.T) { } } +func TestUpdateSnapshot_CreatePrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreatePrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreatePrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_CreatePromptVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreatePromptVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreatePromptVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteAgent(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteAgent(context.Background(), nil, func(o *Options) { @@ -673,6 +985,42 @@ func TestUpdateSnapshot_DeleteDataSource(t *testing.T) { } } +func TestUpdateSnapshot_DeleteFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteFlowAlias(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteFlowAlias(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteFlowAlias") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteFlowVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteFlowVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteFlowVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteKnowledgeBase(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteKnowledgeBase(context.Background(), nil, func(o *Options) { @@ -685,6 +1033,18 @@ func TestUpdateSnapshot_DeleteKnowledgeBase(t *testing.T) { } } +func TestUpdateSnapshot_DeletePrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeletePrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeletePrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DisassociateAgentKnowledgeBase(t *testing.T) { svc := New(Options{}) _, err := svc.DisassociateAgentKnowledgeBase(context.Background(), nil, func(o *Options) { @@ -769,6 +1129,42 @@ func TestUpdateSnapshot_GetDataSource(t *testing.T) { } } +func TestUpdateSnapshot_GetFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetFlowAlias(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetFlowAlias(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetFlowAlias") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetFlowVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetFlowVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetFlowVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetIngestionJob(t *testing.T) { svc := New(Options{}) _, err := svc.GetIngestionJob(context.Background(), nil, func(o *Options) { @@ -793,6 +1189,18 @@ func TestUpdateSnapshot_GetKnowledgeBase(t *testing.T) { } } +func TestUpdateSnapshot_GetPrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetPrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetPrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListAgentActionGroups(t *testing.T) { svc := New(Options{}) _, err := svc.ListAgentActionGroups(context.Background(), nil, func(o *Options) { @@ -865,6 +1273,42 @@ func TestUpdateSnapshot_ListDataSources(t *testing.T) { } } +func TestUpdateSnapshot_ListFlowAliases(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListFlowAliases(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListFlowAliases") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListFlows(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListFlows(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListFlows") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListFlowVersions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListFlowVersions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListFlowVersions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListIngestionJobs(t *testing.T) { svc := New(Options{}) _, err := svc.ListIngestionJobs(context.Background(), nil, func(o *Options) { @@ -889,6 +1333,18 @@ func TestUpdateSnapshot_ListKnowledgeBases(t *testing.T) { } } +func TestUpdateSnapshot_ListPrompts(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListPrompts(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListPrompts") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -913,6 +1369,18 @@ func TestUpdateSnapshot_PrepareAgent(t *testing.T) { } } +func TestUpdateSnapshot_PrepareFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.PrepareFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PrepareFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_StartIngestionJob(t *testing.T) { svc := New(Options{}) _, err := svc.StartIngestionJob(context.Background(), nil, func(o *Options) { @@ -1009,6 +1477,30 @@ func TestUpdateSnapshot_UpdateDataSource(t *testing.T) { } } +func TestUpdateSnapshot_UpdateFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateFlowAlias(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateFlowAlias(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateFlowAlias") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateKnowledgeBase(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateKnowledgeBase(context.Background(), nil, func(o *Options) { @@ -1020,3 +1512,15 @@ func TestUpdateSnapshot_UpdateKnowledgeBase(t *testing.T) { t.Fatal(err) } } + +func TestUpdateSnapshot_UpdatePrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdatePrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdatePrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/bedrockagent/types/enums.go b/service/bedrockagent/types/enums.go index 57af6193e04..15da73acadf 100644 --- a/service/bedrockagent/types/enums.go +++ b/service/bedrockagent/types/enums.go @@ -6,7 +6,8 @@ type ActionGroupSignature string // Enum values for ActionGroupSignature const ( - ActionGroupSignatureAmazonUserinput ActionGroupSignature = "AMAZON.UserInput" + ActionGroupSignatureAmazonUserinput ActionGroupSignature = "AMAZON.UserInput" + ActionGroupSignatureAmazonCodeinterpreter ActionGroupSignature = "AMAZON.CodeInterpreter" ) // Values returns all known values for ActionGroupSignature. Note that this can be @@ -16,6 +17,7 @@ const ( func (ActionGroupSignature) Values() []ActionGroupSignature { return []ActionGroupSignature{ "AMAZON.UserInput", + "AMAZON.CodeInterpreter", } } @@ -98,8 +100,10 @@ type ChunkingStrategy string // Enum values for ChunkingStrategy const ( - ChunkingStrategyFixedSize ChunkingStrategy = "FIXED_SIZE" - ChunkingStrategyNone ChunkingStrategy = "NONE" + ChunkingStrategyFixedSize ChunkingStrategy = "FIXED_SIZE" + ChunkingStrategyNone ChunkingStrategy = "NONE" + ChunkingStrategyHierarchical ChunkingStrategy = "HIERARCHICAL" + ChunkingStrategySemantic ChunkingStrategy = "SEMANTIC" ) // Values returns all known values for ChunkingStrategy. Note that this can be @@ -110,6 +114,62 @@ func (ChunkingStrategy) Values() []ChunkingStrategy { return []ChunkingStrategy{ "FIXED_SIZE", "NONE", + "HIERARCHICAL", + "SEMANTIC", + } +} + +type ConfluenceAuthType string + +// Enum values for ConfluenceAuthType +const ( + ConfluenceAuthTypeBasic ConfluenceAuthType = "BASIC" + ConfluenceAuthTypeOauth2ClientCredentials ConfluenceAuthType = "OAUTH2_CLIENT_CREDENTIALS" +) + +// Values returns all known values for ConfluenceAuthType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ConfluenceAuthType) Values() []ConfluenceAuthType { + return []ConfluenceAuthType{ + "BASIC", + "OAUTH2_CLIENT_CREDENTIALS", + } +} + +type ConfluenceHostType string + +// Enum values for ConfluenceHostType +const ( + ConfluenceHostTypeSaas ConfluenceHostType = "SAAS" +) + +// Values returns all known values for ConfluenceHostType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ConfluenceHostType) Values() []ConfluenceHostType { + return []ConfluenceHostType{ + "SAAS", + } +} + +type CrawlFilterConfigurationType string + +// Enum values for CrawlFilterConfigurationType +const ( + CrawlFilterConfigurationTypePattern CrawlFilterConfigurationType = "PATTERN" +) + +// Values returns all known values for CrawlFilterConfigurationType. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (CrawlFilterConfigurationType) Values() []CrawlFilterConfigurationType { + return []CrawlFilterConfigurationType{ + "PATTERN", } } @@ -193,7 +253,11 @@ type DataSourceType string // Enum values for DataSourceType const ( - DataSourceTypeS3 DataSourceType = "S3" + DataSourceTypeS3 DataSourceType = "S3" + DataSourceTypeWeb DataSourceType = "WEB" + DataSourceTypeConfluence DataSourceType = "CONFLUENCE" + DataSourceTypeSalesforce DataSourceType = "SALESFORCE" + DataSourceTypeSharepoint DataSourceType = "SHAREPOINT" ) // Values returns all known values for DataSourceType. Note that this can be @@ -203,6 +267,135 @@ const ( func (DataSourceType) Values() []DataSourceType { return []DataSourceType{ "S3", + "WEB", + "CONFLUENCE", + "SALESFORCE", + "SHAREPOINT", + } +} + +type FlowConnectionType string + +// Enum values for FlowConnectionType +const ( + FlowConnectionTypeData FlowConnectionType = "Data" + FlowConnectionTypeConditional FlowConnectionType = "Conditional" +) + +// Values returns all known values for FlowConnectionType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FlowConnectionType) Values() []FlowConnectionType { + return []FlowConnectionType{ + "Data", + "Conditional", + } +} + +type FlowNodeIODataType string + +// Enum values for FlowNodeIODataType +const ( + FlowNodeIODataTypeString FlowNodeIODataType = "String" + FlowNodeIODataTypeNumber FlowNodeIODataType = "Number" + FlowNodeIODataTypeBoolean FlowNodeIODataType = "Boolean" + FlowNodeIODataTypeObject FlowNodeIODataType = "Object" + FlowNodeIODataTypeArray FlowNodeIODataType = "Array" +) + +// Values returns all known values for FlowNodeIODataType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FlowNodeIODataType) Values() []FlowNodeIODataType { + return []FlowNodeIODataType{ + "String", + "Number", + "Boolean", + "Object", + "Array", + } +} + +type FlowNodeType string + +// Enum values for FlowNodeType +const ( + FlowNodeTypeInput FlowNodeType = "Input" + FlowNodeTypeOutput FlowNodeType = "Output" + FlowNodeTypeKnowledgeBase FlowNodeType = "KnowledgeBase" + FlowNodeTypeCondition FlowNodeType = "Condition" + FlowNodeTypeLex FlowNodeType = "Lex" + FlowNodeTypePrompt FlowNodeType = "Prompt" + FlowNodeTypeLambdaFunction FlowNodeType = "LambdaFunction" + FlowNodeTypeStorage FlowNodeType = "Storage" + FlowNodeTypeAgent FlowNodeType = "Agent" + FlowNodeTypeRetrieval FlowNodeType = "Retrieval" + FlowNodeTypeIterator FlowNodeType = "Iterator" + FlowNodeTypeCollector FlowNodeType = "Collector" +) + +// Values returns all known values for FlowNodeType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FlowNodeType) Values() []FlowNodeType { + return []FlowNodeType{ + "Input", + "Output", + "KnowledgeBase", + "Condition", + "Lex", + "Prompt", + "LambdaFunction", + "Storage", + "Agent", + "Retrieval", + "Iterator", + "Collector", + } +} + +type FlowStatus string + +// Enum values for FlowStatus +const ( + FlowStatusFailed FlowStatus = "Failed" + FlowStatusPrepared FlowStatus = "Prepared" + FlowStatusPreparing FlowStatus = "Preparing" + FlowStatusNotPrepared FlowStatus = "NotPrepared" +) + +// Values returns all known values for FlowStatus. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FlowStatus) Values() []FlowStatus { + return []FlowStatus{ + "Failed", + "Prepared", + "Preparing", + "NotPrepared", + } +} + +type FlowValidationSeverity string + +// Enum values for FlowValidationSeverity +const ( + FlowValidationSeverityWarning FlowValidationSeverity = "Warning" + FlowValidationSeverityError FlowValidationSeverity = "Error" +) + +// Values returns all known values for FlowValidationSeverity. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FlowValidationSeverity) Values() []FlowValidationSeverity { + return []FlowValidationSeverity{ + "Warning", + "Error", } } @@ -370,6 +563,40 @@ func (KnowledgeBaseType) Values() []KnowledgeBaseType { } } +type MemoryType string + +// Enum values for MemoryType +const ( + MemoryTypeSessionSummary MemoryType = "SESSION_SUMMARY" +) + +// Values returns all known values for MemoryType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (MemoryType) Values() []MemoryType { + return []MemoryType{ + "SESSION_SUMMARY", + } +} + +type ParsingStrategy string + +// Enum values for ParsingStrategy +const ( + ParsingStrategyBedrockFoundationModel ParsingStrategy = "BEDROCK_FOUNDATION_MODEL" +) + +// Values returns all known values for ParsingStrategy. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ParsingStrategy) Values() []ParsingStrategy { + return []ParsingStrategy{ + "BEDROCK_FOUNDATION_MODEL", + } +} + type PromptState string // Enum values for PromptState @@ -389,6 +616,23 @@ func (PromptState) Values() []PromptState { } } +type PromptTemplateType string + +// Enum values for PromptTemplateType +const ( + PromptTemplateTypeText PromptTemplateType = "TEXT" +) + +// Values returns all known values for PromptTemplateType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (PromptTemplateType) Values() []PromptTemplateType { + return []PromptTemplateType{ + "TEXT", + } +} + type PromptType string // Enum values for PromptType @@ -412,6 +656,57 @@ func (PromptType) Values() []PromptType { } } +type SalesforceAuthType string + +// Enum values for SalesforceAuthType +const ( + SalesforceAuthTypeOauth2ClientCredentials SalesforceAuthType = "OAUTH2_CLIENT_CREDENTIALS" +) + +// Values returns all known values for SalesforceAuthType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (SalesforceAuthType) Values() []SalesforceAuthType { + return []SalesforceAuthType{ + "OAUTH2_CLIENT_CREDENTIALS", + } +} + +type SharePointAuthType string + +// Enum values for SharePointAuthType +const ( + SharePointAuthTypeOauth2ClientCredentials SharePointAuthType = "OAUTH2_CLIENT_CREDENTIALS" +) + +// Values returns all known values for SharePointAuthType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (SharePointAuthType) Values() []SharePointAuthType { + return []SharePointAuthType{ + "OAUTH2_CLIENT_CREDENTIALS", + } +} + +type SharePointHostType string + +// Enum values for SharePointHostType +const ( + SharePointHostTypeOnline SharePointHostType = "ONLINE" +) + +// Values returns all known values for SharePointHostType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (SharePointHostType) Values() []SharePointHostType { + return []SharePointHostType{ + "ONLINE", + } +} + type SortOrder string // Enum values for SortOrder @@ -431,6 +726,23 @@ func (SortOrder) Values() []SortOrder { } } +type StepType string + +// Enum values for StepType +const ( + StepTypePostChunking StepType = "POST_CHUNKING" +) + +// Values returns all known values for StepType. Note that this can be expanded in +// the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (StepType) Values() []StepType { + return []StepType{ + "POST_CHUNKING", + } +} + type Type string // Enum values for Type @@ -455,3 +767,22 @@ func (Type) Values() []Type { "array", } } + +type WebScopeType string + +// Enum values for WebScopeType +const ( + WebScopeTypeHostOnly WebScopeType = "HOST_ONLY" + WebScopeTypeSubdomains WebScopeType = "SUBDOMAINS" +) + +// Values returns all known values for WebScopeType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (WebScopeType) Values() []WebScopeType { + return []WebScopeType{ + "HOST_ONLY", + "SUBDOMAINS", + } +} diff --git a/service/bedrockagent/types/types.go b/service/bedrockagent/types/types.go index c55fed34837..ea734bc7d0d 100644 --- a/service/bedrockagent/types/types.go +++ b/service/bedrockagent/types/types.go @@ -159,13 +159,16 @@ type Agent struct { // The foundation model used for orchestration by the agent. FoundationModel *string - // The guardrails configuration assigned to the agent. + // Details about the guardrail associated with the agent. GuardrailConfiguration *GuardrailConfiguration // Instructions that tell the agent what it should do and how it should interact // with users. Instruction *string + // Contains memory configuration for the agent. + MemoryConfiguration *MemoryConfiguration + // The time at which the agent was last prepared. PreparedAt *time.Time @@ -406,6 +409,20 @@ type AgentAliasSummary struct { noSmithyDocumentSerde } +// Defines an agent node in your flow. You specify the agent to invoke at this +// point in the flow. For more information, see [Node types in Amazon Bedrock works]in the Amazon Bedrock User Guide. +// +// [Node types in Amazon Bedrock works]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html +type AgentFlowNodeConfiguration struct { + + // The Amazon Resource Name (ARN) of the alias of the agent to invoke. + // + // This member is required. + AgentAliasArn *string + + noSmithyDocumentSerde +} + // Contains details about a knowledge base that is associated with an agent. type AgentKnowledgeBase struct { @@ -505,7 +522,7 @@ type AgentSummary struct { // The description of the agent. Description *string - // The details of the guardrails configuration in the agent summary. + // Details about the guardrail associated with the agent. GuardrailConfiguration *GuardrailConfiguration // The latest version of the agent. @@ -580,12 +597,15 @@ type AgentVersion struct { // The foundation model that the version invokes. FoundationModel *string - // The guardrails configuration assigned to the agent version. + // Details about the guardrail associated with the agent. GuardrailConfiguration *GuardrailConfiguration // The instructions provided to the agent. Instruction *string + // Contains details of the memory configuration on the version of the agent. + MemoryConfiguration *MemoryConfiguration + // Contains configurations to override prompt templates in different parts of an // agent sequence. For more information, see [Advanced prompts]. // @@ -630,7 +650,7 @@ type AgentVersionSummary struct { // The description of the version of the agent. Description *string - // The details of the guardrails configuration in the agent version summary. + // Details about the guardrail associated with the agent. GuardrailConfiguration *GuardrailConfiguration noSmithyDocumentSerde @@ -685,6 +705,20 @@ type BedrockEmbeddingModelConfiguration struct { noSmithyDocumentSerde } +// Settings for a foundation model used to parse documents for a data source. +type BedrockFoundationModelConfiguration struct { + + // The model's ARN. + // + // This member is required. + ModelArn *string + + // Instructions for interpreting the contents of a document. + ParsingPrompt *ParsingPrompt + + noSmithyDocumentSerde +} + // 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. @@ -699,6 +733,13 @@ type ChunkingConfiguration struct { // - FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the // approximate size that you set in the fixedSizeChunkingConfiguration . // + // - HIERARCHICAL – Split documents into layers of chunks where the first layer + // contains large chunks, and the second layer contains smaller chunks derived from + // the first layer. + // + // - SEMANTIC – Split documents into chunks based on groups of similar content + // derived with natural language processing. + // // - NONE – Amazon Bedrock treats each file as one chunk. If you choose this // option, you may want to pre-process your documents by splitting them into // separate files. @@ -710,6 +751,144 @@ type ChunkingConfiguration struct { // chunkingStrategy as NONE , exclude this field. FixedSizeChunkingConfiguration *FixedSizeChunkingConfiguration + // Settings for hierarchical document chunking for a data source. Hierarchical + // chunking splits documents into layers of chunks where the first layer contains + // large chunks, and the second layer contains smaller chunks derived from the + // first layer. + HierarchicalChunkingConfiguration *HierarchicalChunkingConfiguration + + // Settings for semantic document chunking for a data source. Semantic chunking + // splits a document into into smaller documents based on groups of similar content + // derived from the text with natural language processing. + SemanticChunkingConfiguration *SemanticChunkingConfiguration + + noSmithyDocumentSerde +} + +// Defines a collector node in your flow. This node takes an iteration of inputs +// and consolidates them into an array in the output. For more information, see [Node types in Amazon Bedrock works]in +// the Amazon Bedrock User Guide. +// +// [Node types in Amazon Bedrock works]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html +type CollectorFlowNodeConfiguration struct { + noSmithyDocumentSerde +} + +// Defines a condition node in your flow. You can specify conditions that +// determine which node comes next in the flow. For more information, see [Node types in Amazon Bedrock works]in the +// Amazon Bedrock User Guide. +// +// [Node types in Amazon Bedrock works]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html +type ConditionFlowNodeConfiguration struct { + + // An array of conditions. Each member contains the name of a condition and an + // expression that defines the condition. + // + // This member is required. + Conditions []FlowCondition + + noSmithyDocumentSerde +} + +// The configuration of the Confluence content. For example, configuring specific +// types of Confluence content. +type ConfluenceCrawlerConfiguration struct { + + // The configuration of filtering the Confluence content. For example, configuring + // regular expression patterns to include or exclude certain content. + FilterConfiguration *CrawlFilterConfiguration + + noSmithyDocumentSerde +} + +// The configuration information to connect to Confluence as your data source. +type ConfluenceDataSourceConfiguration struct { + + // The endpoint information to connect to your Confluence data source. + // + // This member is required. + SourceConfiguration *ConfluenceSourceConfiguration + + // The configuration of the Confluence content. For example, configuring specific + // types of Confluence content. + CrawlerConfiguration *ConfluenceCrawlerConfiguration + + noSmithyDocumentSerde +} + +// The endpoint information to connect to your Confluence data source. +type ConfluenceSourceConfiguration struct { + + // The supported authentication type to authenticate and connect to your + // Confluence instance. + // + // This member is required. + AuthType ConfluenceAuthType + + // The Amazon Resource Name of an Secrets Manager secret that stores your + // authentication credentials for your SharePoint site/sites. For more information + // on the key-value pairs that must be included in your secret, depending on your + // authentication type, see [Confluence connection configuration]. + // + // [Confluence connection configuration]: https://docs.aws.amazon.com/bedrock/latest/userguide/confluence-data-source-connector.html#configuration-confluence-connector + // + // This member is required. + CredentialsSecretArn *string + + // The supported host type, whether online/cloud or server/on-premises. + // + // This member is required. + HostType ConfluenceHostType + + // The Confluence host URL or instance URL. + // + // This member is required. + HostUrl *string + + noSmithyDocumentSerde +} + +// The configuration of filtering the data source content. For example, +// configuring regular expression patterns to include or exclude certain content. +type CrawlFilterConfiguration struct { + + // The type of filtering that you want to apply to certain objects or content of + // the data source. For example, the PATTERN type is regular expression patterns + // you can apply to filter your content. + // + // This member is required. + Type CrawlFilterConfigurationType + + // The configuration of filtering certain objects or content types of the data + // source. + PatternObjectFilter *PatternObjectFilterConfiguration + + noSmithyDocumentSerde +} + +// Settings for customizing steps in the data source content ingestion pipeline. +// +// You can configure the data source to process documents with a Lambda function +// after they are parsed and converted into chunks. When you add a post-chunking +// transformation, the service stores chunked documents in an S3 bucket and invokes +// a Lambda function to process them. +// +// To process chunked documents with a Lambda function, define an S3 bucket path +// for input and output objects, and a transformation that specifies the Lambda +// function to invoke. You can use the Lambda function to customize how chunks are +// split, and the metadata for each chunk. +type CustomTransformationConfiguration struct { + + // An S3 bucket path for input and output objects. + // + // This member is required. + IntermediateStorage *IntermediateStorage + + // A Lambda function that processes documents. + // + // This member is required. + Transformations []Transformation + noSmithyDocumentSerde } @@ -721,7 +900,7 @@ type DataSource struct { // This member is required. CreatedAt *time.Time - // Contains details about how the data source is stored. + // The connection configuration for the data source. // // This member is required. DataSourceConfiguration *DataSourceConfiguration @@ -756,7 +935,7 @@ type DataSource struct { // This member is required. UpdatedAt *time.Time - // The data deletion policy for a data source. + // The data deletion policy for the data source. DataDeletionPolicy DataDeletionPolicy // The description of the data source. @@ -774,18 +953,39 @@ type DataSource struct { noSmithyDocumentSerde } -// Contains details about how a data source is stored. +// The connection configuration for the data source. type DataSourceConfiguration struct { - // The type of storage for the data source. + // The type of data source. // // This member is required. Type DataSourceType - // Contains details about the configuration of the S3 object containing the data - // source. + // The configuration information to connect to Confluence as your data source. + // + // Confluence data source connector is in preview release and is subject to change. + ConfluenceConfiguration *ConfluenceDataSourceConfiguration + + // The configuration information to connect to Amazon S3 as your data source. S3Configuration *S3DataSourceConfiguration + // The configuration information to connect to Salesforce as your data source. + // + // Salesforce data source connector is in preview release and is subject to change. + SalesforceConfiguration *SalesforceDataSourceConfiguration + + // The configuration information to connect to SharePoint as your data source. + // + // SharePoint data source connector is in preview release and is subject to change. + SharePointConfiguration *SharePointDataSourceConfiguration + + // The configuration of web URLs to crawl for your data source. You should be + // authorized to crawl the URLs. + // + // Crawling web URLs as your data source is in preview release and is subject to + // change. + WebConfiguration *WebDataSourceConfiguration + noSmithyDocumentSerde } @@ -849,181 +1049,738 @@ type FixedSizeChunkingConfiguration struct { noSmithyDocumentSerde } -// Defines parameters that the agent needs to invoke from the user to complete the -// function. Corresponds to an action in an action group. -// -// This data type is used in the following API operations: -// -// [CreateAgentActionGroup request] -// -// [CreateAgentActionGroup response] -// -// [UpdateAgentActionGroup request] -// -// [UpdateAgentActionGroup response] -// -// [GetAgentActionGroup response] -// -// [CreateAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_ResponseSyntax -// [GetAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetAgentActionGroup.html#API_agent_GetAgentActionGroup_ResponseSyntax -// [UpdateAgentActionGroup request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_RequestSyntax -// [CreateAgentActionGroup request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_RequestSyntax -// [UpdateAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_ResponseSyntax -type Function struct { - - // A name for the function. - // - // This member is required. - Name *string - - // A description of the function and its purpose. - Description *string +// Contains information about a version that the alias maps to. +type FlowAliasRoutingConfigurationListItem struct { - // The parameters that the agent elicits from the user to fulfill the function. - Parameters map[string]ParameterDetail + // The version that the alias maps to. + FlowVersion *string noSmithyDocumentSerde } -// Defines functions that each define parameters that the agent needs to invoke -// from the user. Each function represents an action in an action group. +// Contains information about an alias of a flow. // // This data type is used in the following API operations: // -// [CreateAgentActionGroup request] -// -// [CreateAgentActionGroup response] -// -// [UpdateAgentActionGroup request] -// -// [UpdateAgentActionGroup response] -// -// [GetAgentActionGroup response] -// -// The following types satisfy this interface: -// -// FunctionSchemaMemberFunctions +// [ListFlowAliases response] // -// [CreateAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_ResponseSyntax -// [GetAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetAgentActionGroup.html#API_agent_GetAgentActionGroup_ResponseSyntax -// [UpdateAgentActionGroup request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_RequestSyntax -// [CreateAgentActionGroup request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_RequestSyntax -// [UpdateAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_ResponseSyntax -type FunctionSchema interface { - isFunctionSchema() -} - -// A list of functions that each define an action in the action group. -type FunctionSchemaMemberFunctions struct { - Value []Function +// [ListFlowAliases response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListFlowAliases.html#API_agent_ListFlowAliases_ResponseSyntax +type FlowAliasSummary struct { - noSmithyDocumentSerde -} + // The Amazon Resource Name (ARN) of the flow alias. + // + // This member is required. + Arn *string -func (*FunctionSchemaMemberFunctions) isFunctionSchema() {} + // The time at which the alias was created. + // + // This member is required. + CreatedAt *time.Time -// The details of the guardrails configuration. -type GuardrailConfiguration struct { + // The unique identifier of the flow. + // + // This member is required. + FlowId *string - // The guardrails identifier assigned to the guardrails configuration. - GuardrailIdentifier *string + // The unique identifier of the alias of the flow. + // + // This member is required. + Id *string - // The guardrails version assigned to the guardrails configuration. - GuardrailVersion *string + // The name of the alias. + // + // This member is required. + Name *string - noSmithyDocumentSerde -} + // A list of configurations about the versions that the alias maps to. Currently, + // you can only specify one. + // + // This member is required. + RoutingConfiguration []FlowAliasRoutingConfigurationListItem -// Contains inference parameters to use when the agent invokes a foundation model -// in the part of the agent sequence defined by the promptType . For more -// information, see [Inference parameters for foundation models]. -// -// [Inference parameters for foundation models]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html -type InferenceConfiguration struct { + // The time at which the alias was last updated. + // + // This member is required. + UpdatedAt *time.Time - // The maximum number of tokens to allow in the generated response. - MaximumLength *int32 + // A description of the alias. + Description *string - // A list of stop sequences. A stop sequence is a sequence of characters that - // causes the model to stop generating the response. - StopSequences []string + noSmithyDocumentSerde +} - // 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. - Temperature *float32 +// Defines a condition in the condition node. +type FlowCondition struct { - // While generating a response, the model determines the probability of the - // following token at each point of generation. The value that you set for topK is - // the number of most-likely candidates from which the model chooses the next token - // in the sequence. For example, if you set topK to 50, the model selects the next - // token from among the top 50 most likely choices. - TopK *int32 + // A name for the condition that you can reference. + // + // This member is required. + Name *string - // While generating a response, the model determines the probability of the - // following token at each point of generation. The value that you set for Top P - // determines the number of most-likely candidates from which the model chooses the - // next token in the sequence. For example, if you set topP to 80, the model only - // selects the next token from the top 80% of the probability distribution of next - // tokens. - TopP *float32 + // Defines the condition. You must refer to at least one of the inputs in the + // condition. For more information, expand the Condition node section in [Node types in prompt flows]. + // + // [Node types in prompt flows]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html#flows-nodes + Expression *string noSmithyDocumentSerde } -// Contains details about an ingestion job, which converts a data source to -// embeddings for a vector store in knowledge base. -// -// This data type is used in the following API operations: -// -// [StartIngestionJob response] -// -// [GetIngestionJob response] -// -// [ListIngestionJob response] -// -// [StartIngestionJob response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_StartIngestionJob.html#API_agent_StartIngestionJob_ResponseSyntax -// [ListIngestionJob response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListIngestionJobs.html#API_agent_ListIngestionJobs_ResponseSyntax -// [GetIngestionJob response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetIngestionJob.html#API_agent_GetIngestionJob_ResponseSyntax -type IngestionJob struct { +// The configuration of a connection between a condition node and another node. +type FlowConditionalConnectionConfiguration struct { - // The unique identifier of the ingested data source. + // The condition that triggers this connection. For more information about how to + // write conditions, see the Condition node type in the [Node types]topic in the Amazon + // Bedrock User Guide. // - // This member is required. - DataSourceId *string - - // The unique identifier of the ingestion job. + // [Node types]: https://docs.aws.amazon.com/bedrock/latest/userguide/node-types.html // // This member is required. - IngestionJobId *string + Condition *string - // The unique identifier of the knowledge base to which the data source is being - // added. + noSmithyDocumentSerde +} + +// Contains information about a connection between two nodes in the flow. +type FlowConnection struct { + + // A name for the connection that you can reference. // // This member is required. - KnowledgeBaseId *string + Name *string - // The time at which the ingestion job started. + // The node that the connection starts at. // // This member is required. - StartedAt *time.Time + Source *string - // The status of the ingestion job. + // The node that the connection ends at. // // This member is required. - Status IngestionJobStatus + Target *string - // The time at which the ingestion job was last updated. + // Whether the source node that the connection begins from is a condition node ( + // Conditional ) or not ( Data ). // // This member is required. - UpdatedAt *time.Time + Type FlowConnectionType - // The description of the ingestion job. - Description *string + // The configuration of the connection. + Configuration FlowConnectionConfiguration - // A list of reasons that the ingestion job failed. - FailureReasons []string + noSmithyDocumentSerde +} + +// The configuration of the connection. +// +// The following types satisfy this interface: +// +// FlowConnectionConfigurationMemberConditional +// FlowConnectionConfigurationMemberData +type FlowConnectionConfiguration interface { + isFlowConnectionConfiguration() +} + +// The configuration of a connection originating from a Condition node. +type FlowConnectionConfigurationMemberConditional struct { + Value FlowConditionalConnectionConfiguration + + noSmithyDocumentSerde +} + +func (*FlowConnectionConfigurationMemberConditional) isFlowConnectionConfiguration() {} + +// The configuration of a connection originating from a node that isn't a +// Condition node. +type FlowConnectionConfigurationMemberData struct { + Value FlowDataConnectionConfiguration + + noSmithyDocumentSerde +} + +func (*FlowConnectionConfigurationMemberData) isFlowConnectionConfiguration() {} + +// The configuration of a connection originating from a node that isn't a +// Condition node. +type FlowDataConnectionConfiguration struct { + + // The name of the output in the source node that the connection begins from. + // + // This member is required. + SourceOutput *string + + // The name of the input in the target node that the connection ends at. + // + // This member is required. + TargetInput *string + + noSmithyDocumentSerde +} + +// The definition of the nodes and connections between nodes in the flow. +type FlowDefinition struct { + + // An array of connection definitions in the flow. + Connections []FlowConnection + + // An array of node definitions in the flow. + Nodes []FlowNode + + noSmithyDocumentSerde +} + +// Contains configurations about a node in the flow. +type FlowNode struct { + + // A name for the node. + // + // This member is required. + Name *string + + // The type of node. This value must match the name of the key that you provide in + // the configuration you provide in the FlowNodeConfiguration field. + // + // This member is required. + Type FlowNodeType + + // Contains configurations for the node. + Configuration FlowNodeConfiguration + + // An array of objects, each of which contains information about an input into the + // node. + Inputs []FlowNodeInput + + // A list of objects, each of which contains information about an output from the + // node. + Outputs []FlowNodeOutput + + noSmithyDocumentSerde +} + +// Contains configurations for a node in your flow. For more information, see [Node types in Amazon Bedrock works] in +// the Amazon Bedrock User Guide. +// +// The following types satisfy this interface: +// +// FlowNodeConfigurationMemberAgent +// FlowNodeConfigurationMemberCollector +// FlowNodeConfigurationMemberCondition +// FlowNodeConfigurationMemberInput +// FlowNodeConfigurationMemberIterator +// FlowNodeConfigurationMemberKnowledgeBase +// FlowNodeConfigurationMemberLambdaFunction +// FlowNodeConfigurationMemberLex +// FlowNodeConfigurationMemberOutput +// FlowNodeConfigurationMemberPrompt +// FlowNodeConfigurationMemberRetrieval +// FlowNodeConfigurationMemberStorage +// +// [Node types in Amazon Bedrock works]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html +type FlowNodeConfiguration interface { + isFlowNodeConfiguration() +} + +// Contains configurations for an agent node in your flow. Invokes an alias of an +// agent and returns the response. +type FlowNodeConfigurationMemberAgent struct { + Value AgentFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberAgent) isFlowNodeConfiguration() {} + +// Contains configurations for a collector node in your flow. Collects an +// iteration of inputs and consolidates them into an array of outputs. +type FlowNodeConfigurationMemberCollector struct { + Value CollectorFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberCollector) isFlowNodeConfiguration() {} + +// Contains configurations for a Condition node in your flow. Defines conditions +// that lead to different branches of the flow. +type FlowNodeConfigurationMemberCondition struct { + Value ConditionFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberCondition) isFlowNodeConfiguration() {} + +// Contains configurations for an input flow node in your flow. The first node in +// the flow. inputs can't be specified for this node. +type FlowNodeConfigurationMemberInput struct { + Value InputFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberInput) isFlowNodeConfiguration() {} + +// Contains configurations for an iterator node in your flow. Takes an input that +// is an array and iteratively sends each item of the array as an output to the +// following node. The size of the array is also returned in the output. +// +// The output flow node at the end of the flow iteration will return a response +// for each member of the array. To return only one response, you can include a +// collector node downstream from the iterator node. +type FlowNodeConfigurationMemberIterator struct { + Value IteratorFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberIterator) isFlowNodeConfiguration() {} + +// Contains configurations for a knowledge base node in your flow. Queries a +// knowledge base and returns the retrieved results or generated response. +type FlowNodeConfigurationMemberKnowledgeBase struct { + Value KnowledgeBaseFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberKnowledgeBase) isFlowNodeConfiguration() {} + +// Contains configurations for a Lambda function node in your flow. Invokes an +// Lambda function. +type FlowNodeConfigurationMemberLambdaFunction struct { + Value LambdaFunctionFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberLambdaFunction) isFlowNodeConfiguration() {} + +// Contains configurations for a Lex node in your flow. Invokes an Amazon Lex bot +// to identify the intent of the input and return the intent as the output. +type FlowNodeConfigurationMemberLex struct { + Value LexFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberLex) isFlowNodeConfiguration() {} + +// Contains configurations for an output flow node in your flow. The last node in +// the flow. outputs can't be specified for this node. +type FlowNodeConfigurationMemberOutput struct { + Value OutputFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberOutput) isFlowNodeConfiguration() {} + +// Contains configurations for a prompt node in your flow. Runs a prompt and +// generates the model response as the output. You can use a prompt from Prompt +// management or you can configure one in this node. +type FlowNodeConfigurationMemberPrompt struct { + Value PromptFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberPrompt) isFlowNodeConfiguration() {} + +// Contains configurations for a Retrieval node in your flow. Retrieves data from +// an Amazon S3 location and returns it as the output. +type FlowNodeConfigurationMemberRetrieval struct { + Value RetrievalFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberRetrieval) isFlowNodeConfiguration() {} + +// Contains configurations for a Storage node in your flow. Stores an input in an +// Amazon S3 location. +type FlowNodeConfigurationMemberStorage struct { + Value StorageFlowNodeConfiguration + + noSmithyDocumentSerde +} + +func (*FlowNodeConfigurationMemberStorage) isFlowNodeConfiguration() {} + +// Contains configurations for an input to a node. +type FlowNodeInput struct { + + // An expression that formats the input for the node. For an explanation of how to + // create expressions, see [Expressions in Prompt flows in Amazon Bedrock]. + // + // [Expressions in Prompt flows in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-expressions.html + // + // This member is required. + Expression *string + + // A name for the input that you can reference. + // + // This member is required. + Name *string + + // The data type of the input. If the input doesn't match this type at runtime, a + // validation error will be thrown. + // + // This member is required. + Type FlowNodeIODataType + + noSmithyDocumentSerde +} + +// Contains configurations for an output from a node. +type FlowNodeOutput struct { + + // A name for the output that you can reference. + // + // This member is required. + Name *string + + // The data type of the output. If the output doesn't match this type at runtime, + // a validation error will be thrown. + // + // This member is required. + Type FlowNodeIODataType + + noSmithyDocumentSerde +} + +// Contains the definition of a flow. +type FlowSummary struct { + + // The Amazon Resource Name (ARN) of the flow. + // + // This member is required. + Arn *string + + // The time at which the flow was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique identifier of the flow. + // + // This member is required. + Id *string + + // The name of the flow. + // + // This member is required. + Name *string + + // The status of the flow. The following statuses are possible: + // + // - NotPrepared – The flow has been created or updated, but hasn't been + // prepared. If you just created the flow, you can't test it. If you updated the + // flow, the DRAFT version won't contain the latest changes for testing. Send a [PrepareFlow] + // request to package the latest changes into the DRAFT version. + // + // - Preparing – The flow is being prepared so that the DRAFT version contains + // the latest changes for testing. + // + // - Prepared – The flow is prepared and the DRAFT version contains the latest + // changes for testing. + // + // - Failed – The last API operation that you invoked on the flow failed. Send a [GetFlow] + // request and check the error message in the validations field. + // + // [PrepareFlow]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PrepareFlow.html + // [GetFlow]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlow.html + // + // This member is required. + Status FlowStatus + + // The time at which the flow was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The latest version of the flow. + // + // This member is required. + Version *string + + // A description of the flow. + Description *string + + noSmithyDocumentSerde +} + +// Contains information about validation of the flow. +// +// This data type is used in the following API operations: +// +// [GetFlow response] +// +// [GetFlowVersion response] +// +// [GetFlow response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlow.html#API_agent_GetFlow_ResponseSyntax +// [GetFlowVersion response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlowVersion.html#API_agent_GetFlowVersion_ResponseSyntax +type FlowValidation struct { + + // A message describing the validation error. + // + // This member is required. + Message *string + + // The severity of the issue described in the message. + // + // This member is required. + Severity FlowValidationSeverity + + noSmithyDocumentSerde +} + +// Contains information about the flow version. +// +// This data type is used in the following API operations: +// +// [ListFlowVersions response] +// +// [ListFlowVersions response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListFlowVersions.html#API_agent_ListFlowVersions_ResponseSyntax +type FlowVersionSummary struct { + + // The Amazon Resource Name (ARN) of the flow that the version belongs to. + // + // This member is required. + Arn *string + + // The time at the flow version was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique identifier of the flow. + // + // This member is required. + Id *string + + // The status of the flow. + // + // This member is required. + Status FlowStatus + + // The version of the flow. + // + // This member is required. + Version *string + + noSmithyDocumentSerde +} + +// Defines parameters that the agent needs to invoke from the user to complete the +// function. Corresponds to an action in an action group. +// +// This data type is used in the following API operations: +// +// [CreateAgentActionGroup request] +// +// [CreateAgentActionGroup response] +// +// [UpdateAgentActionGroup request] +// +// [UpdateAgentActionGroup response] +// +// [GetAgentActionGroup response] +// +// [CreateAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_ResponseSyntax +// [GetAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetAgentActionGroup.html#API_agent_GetAgentActionGroup_ResponseSyntax +// [UpdateAgentActionGroup request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_RequestSyntax +// [CreateAgentActionGroup request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_RequestSyntax +// [UpdateAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_ResponseSyntax +type Function struct { + + // A name for the function. + // + // This member is required. + Name *string + + // A description of the function and its purpose. + Description *string + + // The parameters that the agent elicits from the user to fulfill the function. + Parameters map[string]ParameterDetail + + noSmithyDocumentSerde +} + +// Defines functions that each define parameters that the agent needs to invoke +// from the user. Each function represents an action in an action group. +// +// This data type is used in the following API operations: +// +// [CreateAgentActionGroup request] +// +// [CreateAgentActionGroup response] +// +// [UpdateAgentActionGroup request] +// +// [UpdateAgentActionGroup response] +// +// [GetAgentActionGroup response] +// +// The following types satisfy this interface: +// +// FunctionSchemaMemberFunctions +// +// [CreateAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_ResponseSyntax +// [GetAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetAgentActionGroup.html#API_agent_GetAgentActionGroup_ResponseSyntax +// [UpdateAgentActionGroup request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_RequestSyntax +// [CreateAgentActionGroup request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_RequestSyntax +// [UpdateAgentActionGroup response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_ResponseSyntax +type FunctionSchema interface { + isFunctionSchema() +} + +// A list of functions that each define an action in the action group. +type FunctionSchemaMemberFunctions struct { + Value []Function + + noSmithyDocumentSerde +} + +func (*FunctionSchemaMemberFunctions) isFunctionSchema() {} + +// Details about the guardrail associated with an agent. +type GuardrailConfiguration struct { + + // The unique identifier of the guardrail. + GuardrailIdentifier *string + + // The version of the guardrail. + GuardrailVersion *string + + noSmithyDocumentSerde +} + +// Settings for hierarchical document chunking for a data source. Hierarchical +// chunking splits documents into layers of chunks where the first layer contains +// large chunks, and the second layer contains smaller chunks derived from the +// first layer. +// +// You configure the number of tokens to overlap, or repeat across adjacent +// chunks. For example, if you set overlap tokens to 60, the last 60 tokens in the +// first chunk are also included at the beginning of the second chunk. For each +// layer, you must also configure the maximum number of tokens in a chunk. +type HierarchicalChunkingConfiguration struct { + + // Token settings for each layer. + // + // This member is required. + LevelConfigurations []HierarchicalChunkingLevelConfiguration + + // The number of tokens to repeat across chunks in the same layer. + // + // This member is required. + OverlapTokens *int32 + + noSmithyDocumentSerde +} + +// Token settings for a layer in a hierarchical chunking configuration. +type HierarchicalChunkingLevelConfiguration struct { + + // The maximum number of tokens that a chunk can contain in this layer. + // + // This member is required. + MaxTokens *int32 + + noSmithyDocumentSerde +} + +// Contains inference parameters to use when the agent invokes a foundation model +// in the part of the agent sequence defined by the promptType . For more +// information, see [Inference parameters for foundation models]. +// +// [Inference parameters for foundation models]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html +type InferenceConfiguration struct { + + // The maximum number of tokens to allow in the generated response. + MaximumLength *int32 + + // A list of stop sequences. A stop sequence is a sequence of characters that + // causes the model to stop generating the response. + StopSequences []string + + // 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. + Temperature *float32 + + // While generating a response, the model determines the probability of the + // following token at each point of generation. The value that you set for topK is + // the number of most-likely candidates from which the model chooses the next token + // in the sequence. For example, if you set topK to 50, the model selects the next + // token from among the top 50 most likely choices. + TopK *int32 + + // While generating a response, the model determines the probability of the + // following token at each point of generation. The value that you set for Top P + // determines the number of most-likely candidates from which the model chooses the + // next token in the sequence. For example, if you set topP to 80, the model only + // selects the next token from the top 80% of the probability distribution of next + // tokens. + TopP *float32 + + noSmithyDocumentSerde +} + +// Contains details about an ingestion job, which converts a data source to +// embeddings for a vector store in knowledge base. +// +// This data type is used in the following API operations: +// +// [StartIngestionJob response] +// +// [GetIngestionJob response] +// +// [ListIngestionJob response] +// +// [StartIngestionJob response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_StartIngestionJob.html#API_agent_StartIngestionJob_ResponseSyntax +// [ListIngestionJob response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListIngestionJobs.html#API_agent_ListIngestionJobs_ResponseSyntax +// [GetIngestionJob response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetIngestionJob.html#API_agent_GetIngestionJob_ResponseSyntax +type IngestionJob struct { + + // The unique identifier of the ingested data source. + // + // This member is required. + DataSourceId *string + + // The unique identifier of the ingestion job. + // + // This member is required. + IngestionJobId *string + + // The unique identifier of the knowledge base to which the data source is being + // added. + // + // This member is required. + KnowledgeBaseId *string + + // The time at which the ingestion job started. + // + // This member is required. + StartedAt *time.Time + + // The status of the ingestion job. + // + // This member is required. + Status IngestionJobStatus + + // The time at which the ingestion job was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // The description of the ingestion job. + Description *string + + // A list of reasons that the ingestion job failed. + FailureReasons []string // Contains statistics about the ingestion job. Statistics *IngestionJobStatistics @@ -1141,6 +1898,36 @@ type IngestionJobSummary struct { noSmithyDocumentSerde } +// Contains configurations for the input flow node for a flow. This node takes the +// input from flow invocation and passes it to the next node in the data type that +// you specify. +type InputFlowNodeConfiguration struct { + noSmithyDocumentSerde +} + +// A location for storing content from data sources temporarily as it is processed +// by custom components in the ingestion pipeline. +type IntermediateStorage struct { + + // An S3 bucket path. + // + // This member is required. + S3Location *S3Location + + noSmithyDocumentSerde +} + +// Contains configurations for an iterator node in a flow. Takes an input that is +// an array and iteratively sends each item of the array as an output to the +// following node. The size of the array is also returned in the output. +// +// The output flow node at the end of the flow iteration will return a response +// for each member of the array. To return only one response, you can include a +// collector node downstream from the iterator node. +type IteratorFlowNodeConfiguration struct { + noSmithyDocumentSerde +} + // Contains information about a knowledge base. type KnowledgeBase struct { @@ -1224,6 +2011,27 @@ type KnowledgeBaseConfiguration struct { noSmithyDocumentSerde } +// Contains configurations for a knowledge base node in a flow. This node takes a +// query as the input and returns, as the output, the retrieved responses directly +// (as an array) or a response generated based on the retrieved responses. For more +// information, see [Node types in Amazon Bedrock works]in the Amazon Bedrock User Guide. +// +// [Node types in Amazon Bedrock works]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html +type KnowledgeBaseFlowNodeConfiguration struct { + + // The unique identifier of the knowledge base to query. + // + // This member is required. + KnowledgeBaseId *string + + // The unique identifier of the model to use to generate a response from the query + // results. Omit this field if you want to return the retrieved results as an + // array. + ModelId *string + + noSmithyDocumentSerde +} + // Contains details about a knowledge base. type KnowledgeBaseSummary struct { @@ -1253,6 +2061,57 @@ type KnowledgeBaseSummary struct { noSmithyDocumentSerde } +// Contains configurations for a Lambda function node in the flow. You specify the +// Lambda function to invoke and the inputs into the function. The output is the +// response that is defined in the Lambda function. For more information, see [Node types in Amazon Bedrock works]in +// the Amazon Bedrock User Guide. +// +// [Node types in Amazon Bedrock works]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html +type LambdaFunctionFlowNodeConfiguration struct { + + // The Amazon Resource Name (ARN) of the Lambda function to invoke. + // + // This member is required. + LambdaArn *string + + noSmithyDocumentSerde +} + +// Contains configurations for a Lex node in the flow. You specify a Amazon Lex +// bot to invoke. This node takes an utterance as the input and returns as the +// output the intent identified by the Amazon Lex bot. For more information, see [Node types in Amazon Bedrock works] +// in the Amazon Bedrock User Guide. +// +// [Node types in Amazon Bedrock works]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html +type LexFlowNodeConfiguration struct { + + // The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke. + // + // This member is required. + BotAliasArn *string + + // The Region to invoke the Amazon Lex bot in. + // + // This member is required. + LocaleId *string + + noSmithyDocumentSerde +} + +// Details of the memory configuration. +type MemoryConfiguration struct { + + // The type of memory that is stored. + // + // This member is required. + EnabledMemoryTypes []MemoryType + + // The number of days the agent is configured to retain the conversational context. + StorageDays *int32 + + noSmithyDocumentSerde +} + // Contains details about the storage configuration of the knowledge base in // MongoDB Atlas. type MongoDbAtlasConfiguration struct { @@ -1371,6 +2230,13 @@ type OpenSearchServerlessFieldMapping struct { noSmithyDocumentSerde } +// Contains configurations for an output flow node in the flow. You specify the +// data type expected for the input into the node in the type field and how to +// return the final output in the expression field. +type OutputFlowNodeConfiguration struct { + noSmithyDocumentSerde +} + // Contains details about a parameter in a function for an action group. // // This data type is used in the following API operations: @@ -1408,6 +2274,84 @@ type ParameterDetail struct { noSmithyDocumentSerde } +// Settings for parsing document contents. By default, the service converts the +// contents of each document into text before splitting it into chunks. To improve +// processing of PDF files with tables and images, you can configure the data +// source to convert the pages of text into images and use a model to describe the +// contents of each page. +// +// To use a model to parse PDF documents, set the parsing strategy to +// BEDROCK_FOUNDATION_MODEL and specify the model to use by ARN. You can also +// override the default parsing prompt with instructions for how to interpret +// images and tables in your documents. The following models are supported. +// +// - Anthropic Claude 3 Sonnet - anthropic.claude-3-sonnet-20240229-v1:0 +// +// - Anthropic Claude 3 Haiku - anthropic.claude-3-haiku-20240307-v1:0 +// +// You can get the ARN of a model with the action. Standard model usage charges +// apply for the foundation model parsing strategy. +type ParsingConfiguration struct { + + // The parsing strategy for the data source. + // + // This member is required. + ParsingStrategy ParsingStrategy + + // Settings for a foundation model used to parse documents for a data source. + BedrockFoundationModelConfiguration *BedrockFoundationModelConfiguration + + noSmithyDocumentSerde +} + +// Instructions for interpreting the contents of a document. +type ParsingPrompt struct { + + // Instructions for interpreting the contents of a document. + // + // This member is required. + ParsingPromptText *string + + noSmithyDocumentSerde +} + +// The specific filters applied to your data source content. You can filter out or +// include certain content. +type PatternObjectFilter struct { + + // The supported object type or content type of the data source. + // + // This member is required. + ObjectType *string + + // A list of one or more exclusion regular expression patterns to exclude certain + // object types that adhere to the pattern. If you specify an inclusion and + // exclusion filter/pattern and both match a document, the exclusion filter takes + // precedence and the document isn’t crawled. + ExclusionFilters []string + + // A list of one or more inclusion regular expression patterns to include certain + // object types that adhere to the pattern. If you specify an inclusion and + // exclusion filter/pattern and both match a document, the exclusion filter takes + // precedence and the document isn’t crawled. + InclusionFilters []string + + noSmithyDocumentSerde +} + +// The configuration of filtering certain objects or content types of the data +// source. +type PatternObjectFilterConfiguration struct { + + // The configuration of specific filters applied to your data source content. You + // can filter out or include certain content. + // + // This member is required. + Filters []PatternObjectFilter + + noSmithyDocumentSerde +} + // Contains details about the storage configuration of the knowledge base in // Pinecone. For more information, see [Create a vector index in Pinecone]. // @@ -1495,42 +2439,269 @@ type PromptConfiguration struct { // promptType . If you set this value to DISABLED , the agent skips that step. The // default state for each promptType is as follows. // - // - PRE_PROCESSING – ENABLED + // - PRE_PROCESSING – ENABLED + // + // - ORCHESTRATION – ENABLED + // + // - KNOWLEDGE_BASE_RESPONSE_GENERATION – ENABLED + // + // - POST_PROCESSING – DISABLED + PromptState PromptState + + // The step in the agent sequence that this prompt configuration applies to. + PromptType PromptType + + noSmithyDocumentSerde +} + +// Contains configurations for a prompt node in the flow. You can use a prompt +// from Prompt management or you can define one in this node. If the prompt +// contains variables, the inputs into this node will fill in the variables. The +// output from this node is the response generated by the model. For more +// information, see [Node types in Amazon Bedrock works]in the Amazon Bedrock User Guide. +// +// [Node types in Amazon Bedrock works]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html +type PromptFlowNodeConfiguration struct { + + // Specifies whether the prompt is from Prompt management or defined inline. + // + // This member is required. + SourceConfiguration PromptFlowNodeSourceConfiguration + + noSmithyDocumentSerde +} + +// Contains configurations for a prompt defined inline in the node. +type PromptFlowNodeInlineConfiguration struct { + + // The unique identifier of the model to run inference with. + // + // This member is required. + ModelId *string + + // Contains a prompt and variables in the prompt that can be replaced with values + // at runtime. + // + // This member is required. + TemplateConfiguration PromptTemplateConfiguration + + // The type of prompt template. + // + // This member is required. + TemplateType PromptTemplateType + + // Contains inference configurations for the prompt. + InferenceConfiguration PromptInferenceConfiguration + + noSmithyDocumentSerde +} + +// Contains configurations for a prompt from Prompt management to use in a node. +type PromptFlowNodeResourceConfiguration struct { + + // The Amazon Resource Name (ARN) of the prompt from Prompt management. + // + // This member is required. + PromptArn *string + + noSmithyDocumentSerde +} + +// Contains configurations for a prompt and whether it is from Prompt management +// or defined inline. +// +// The following types satisfy this interface: +// +// PromptFlowNodeSourceConfigurationMemberInline +// PromptFlowNodeSourceConfigurationMemberResource +type PromptFlowNodeSourceConfiguration interface { + isPromptFlowNodeSourceConfiguration() +} + +// Contains configurations for a prompt that is defined inline +type PromptFlowNodeSourceConfigurationMemberInline struct { + Value PromptFlowNodeInlineConfiguration + + noSmithyDocumentSerde +} + +func (*PromptFlowNodeSourceConfigurationMemberInline) isPromptFlowNodeSourceConfiguration() {} + +// Contains configurations for a prompt from Prompt management. +type PromptFlowNodeSourceConfigurationMemberResource struct { + Value PromptFlowNodeResourceConfiguration + + noSmithyDocumentSerde +} + +func (*PromptFlowNodeSourceConfigurationMemberResource) isPromptFlowNodeSourceConfiguration() {} + +// Contains inference configurations for the prompt. +// +// The following types satisfy this interface: +// +// PromptInferenceConfigurationMemberText +type PromptInferenceConfiguration interface { + isPromptInferenceConfiguration() +} + +// Contains inference configurations for a text prompt. +type PromptInferenceConfigurationMemberText struct { + Value PromptModelInferenceConfiguration + + noSmithyDocumentSerde +} + +func (*PromptInferenceConfigurationMemberText) isPromptInferenceConfiguration() {} + +// Contains information about a variable in the prompt. +type PromptInputVariable struct { + + // The name of the variable. + Name *string + + noSmithyDocumentSerde +} + +// Contains inference configurations related to model inference for a prompt. For +// more information, see [Inference parameters]. +// +// [Inference parameters]: https://docs.aws.amazon.com/bedrock/latest/userguide/inference-parameters.html +type PromptModelInferenceConfiguration struct { + + // The maximum number of tokens to return in the response. + MaxTokens *int32 + + // A list of strings that define sequences after which the model will stop + // generating. + StopSequences []string + + // Controls the randomness of the response. Choose a lower value for more + // predictable outputs and a higher value for more surprising outputs. + Temperature *float32 + + // The number of most-likely candidates that the model considers for the next + // token during generation. + TopK *int32 + + // The percentage of most-likely candidates that the model considers for the next + // token. + TopP *float32 + + noSmithyDocumentSerde +} + +// Contains configurations to override prompts in different parts of an agent +// sequence. For more information, see [Advanced prompts]. +// +// [Advanced prompts]: https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html +type PromptOverrideConfiguration struct { + + // Contains configurations to override a prompt template in one part of an agent + // sequence. For more information, see [Advanced prompts]. + // + // [Advanced prompts]: https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html + // + // This member is required. + PromptConfigurations []PromptConfiguration + + // The ARN of the Lambda function to use when parsing the raw foundation model + // output in parts of the agent sequence. If you specify this field, at least one + // of the promptConfigurations must contain a parserMode value that is set to + // OVERRIDDEN . For more information, see [Parser Lambda function in Agents for Amazon Bedrock]. + // + // [Parser Lambda function in Agents for Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/lambda-parser.html + OverrideLambda *string + + noSmithyDocumentSerde +} + +// Contains information about a prompt in your Prompt management tool. +// +// This data type is used in the following API operations: +// +// [ListPrompts response] +// +// [ListPrompts response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListPrompts.html#API_agent_ListPrompts_ResponseSyntax +type PromptSummary struct { + + // The Amazon Resource Name (ARN) of the prompt. + // + // This member is required. + Arn *string + + // The time at which the prompt was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique identifier of the prompt. + // + // This member is required. + Id *string + + // The name of the prompt. // - // - ORCHESTRATION – ENABLED + // This member is required. + Name *string + + // The time at which the prompt was last updated. // - // - KNOWLEDGE_BASE_RESPONSE_GENERATION – ENABLED + // This member is required. + UpdatedAt *time.Time + + // The version of the prompt that this summary applies to. // - // - POST_PROCESSING – DISABLED - PromptState PromptState + // This member is required. + Version *string - // The step in the agent sequence that this prompt configuration applies to. - PromptType PromptType + // The description of the prompt. + Description *string noSmithyDocumentSerde } -// Contains configurations to override prompts in different parts of an agent -// sequence. For more information, see [Advanced prompts]. +// Contains the message for a prompt. For more information, see [Prompt management in Amazon Bedrock]. // -// [Advanced prompts]: https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html -type PromptOverrideConfiguration struct { +// The following types satisfy this interface: +// +// PromptTemplateConfigurationMemberText +// +// [Prompt management in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html +type PromptTemplateConfiguration interface { + isPromptTemplateConfiguration() +} - // Contains configurations to override a prompt template in one part of an agent - // sequence. For more information, see [Advanced prompts]. - // - // [Advanced prompts]: https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html +// Contains configurations for the text in a message for a prompt. +type PromptTemplateConfigurationMemberText struct { + Value TextPromptTemplateConfiguration + + noSmithyDocumentSerde +} + +func (*PromptTemplateConfigurationMemberText) isPromptTemplateConfiguration() {} + +// Contains details about a variant of the prompt. +type PromptVariant struct { + + // The name of the prompt variant. // // This member is required. - PromptConfigurations []PromptConfiguration + Name *string - // The ARN of the Lambda function to use when parsing the raw foundation model - // output in parts of the agent sequence. If you specify this field, at least one - // of the promptConfigurations must contain a parserMode value that is set to - // OVERRIDDEN . For more information, see [Parser Lambda function in Agents for Amazon Bedrock]. + // The type of prompt template to use. // - // [Parser Lambda function in Agents for Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/lambda-parser.html - OverrideLambda *string + // This member is required. + TemplateType PromptTemplateType + + // Contains inference configurations for the prompt variant. + InferenceConfiguration PromptInferenceConfiguration + + // The unique identifier of the model with which to run inference on the prompt. + ModelId *string + + // Contains configurations for the prompt template. + TemplateConfiguration PromptTemplateConfiguration noSmithyDocumentSerde } @@ -1657,19 +2828,64 @@ type RedisEnterpriseCloudFieldMapping struct { noSmithyDocumentSerde } -// Contains information about the S3 configuration of the data source. +// Contains configurations for a Retrieval node in a flow. This node retrieves +// data from the Amazon S3 location that you specify and returns it as the output. +type RetrievalFlowNodeConfiguration struct { + + // Contains configurations for the service to use for retrieving data to return as + // the output from the node. + // + // This member is required. + ServiceConfiguration RetrievalFlowNodeServiceConfiguration + + noSmithyDocumentSerde +} + +// Contains configurations for the Amazon S3 location from which to retrieve data +// to return as the output from the node. +type RetrievalFlowNodeS3Configuration struct { + + // The name of the Amazon S3 bucket from which to retrieve data. + // + // This member is required. + BucketName *string + + noSmithyDocumentSerde +} + +// Contains configurations for the service to use for retrieving data to return as +// the output from the node. +// +// The following types satisfy this interface: +// +// RetrievalFlowNodeServiceConfigurationMemberS3 +type RetrievalFlowNodeServiceConfiguration interface { + isRetrievalFlowNodeServiceConfiguration() +} + +// Contains configurations for the Amazon S3 location from which to retrieve data +// to return as the output from the node. +type RetrievalFlowNodeServiceConfigurationMemberS3 struct { + Value RetrievalFlowNodeS3Configuration + + noSmithyDocumentSerde +} + +func (*RetrievalFlowNodeServiceConfigurationMemberS3) isRetrievalFlowNodeServiceConfiguration() {} + +// The configuration information to connect to Amazon S3 as your data source. type S3DataSourceConfiguration struct { - // The Amazon Resource Name (ARN) of the bucket that contains the data source. + // The Amazon Resource Name (ARN) of the S3 bucket that contains your data. // // This member is required. BucketArn *string - // The bucket account owner ID for the S3 bucket. + // The account ID for the owner of the S3 bucket. BucketOwnerAccountId *string - // A list of S3 prefixes that define the object containing the data sources. For - // more information, see [Organizing objects using prefixes]. + // A list of S3 prefixes to include certain files or content. For more + // information, see [Organizing objects using prefixes]. // // [Organizing objects using prefixes]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html InclusionPrefixes []string @@ -1677,18 +2893,128 @@ type S3DataSourceConfiguration struct { noSmithyDocumentSerde } -// Contains information about the S3 object containing the resource. +// The identifier information for an Amazon S3 bucket. type S3Identifier struct { // The name of the S3 bucket. S3BucketName *string - // The S3 object key containing the resource. + // The S3 object key for the S3 resource. S3ObjectKey *string noSmithyDocumentSerde } +// An Amazon S3 location. +type S3Location struct { + + // The location's URI. For example, s3://my-bucket/chunk-processor/ . + // + // This member is required. + Uri *string + + noSmithyDocumentSerde +} + +// The configuration of the Salesforce content. For example, configuring specific +// types of Salesforce content. +type SalesforceCrawlerConfiguration struct { + + // The configuration of filtering the Salesforce content. For example, configuring + // regular expression patterns to include or exclude certain content. + FilterConfiguration *CrawlFilterConfiguration + + noSmithyDocumentSerde +} + +// The configuration information to connect to Salesforce as your data source. +type SalesforceDataSourceConfiguration struct { + + // The endpoint information to connect to your Salesforce data source. + // + // This member is required. + SourceConfiguration *SalesforceSourceConfiguration + + // The configuration of the Salesforce content. For example, configuring specific + // types of Salesforce content. + CrawlerConfiguration *SalesforceCrawlerConfiguration + + noSmithyDocumentSerde +} + +// The endpoint information to connect to your Salesforce data source. +type SalesforceSourceConfiguration struct { + + // The supported authentication type to authenticate and connect to your + // Salesforce instance. + // + // This member is required. + AuthType SalesforceAuthType + + // The Amazon Resource Name of an Secrets Manager secret that stores your + // authentication credentials for your SharePoint site/sites. For more information + // on the key-value pairs that must be included in your secret, depending on your + // authentication type, see [Salesforce connection configuration]. + // + // [Salesforce connection configuration]: https://docs.aws.amazon.com/bedrock/latest/userguide/salesforce-data-source-connector.html#configuration-salesforce-connector + // + // This member is required. + CredentialsSecretArn *string + + // The Salesforce host URL or instance URL. + // + // This member is required. + HostUrl *string + + noSmithyDocumentSerde +} + +// The seed or starting point URL. You should be authorized to crawl the URL. +type SeedUrl struct { + + // A seed or starting point URL. + Url *string + + noSmithyDocumentSerde +} + +// Settings for semantic document chunking for a data source. Semantic chunking +// splits a document into into smaller documents based on groups of similar content +// derived from the text with natural language processing. +// +// With semantic chunking, each sentence is compared to the next to determine how +// similar they are. You specify a threshold in the form of a percentile, where +// adjacent sentences that are less similar than that percentage of sentence pairs +// are divided into separate chunks. For example, if you set the threshold to 90, +// then the 10 percent of sentence pairs that are least similar are split. So if +// you have 101 sentences, 100 sentence pairs are compared, and the 10 with the +// least similarity are split, creating 11 chunks. These chunks are further split +// if they exceed the max token size. +// +// You must also specify a buffer size, which determines whether sentences are +// compared in isolation, or within a moving context window that includes the +// previous and following sentence. For example, if you set the buffer size to 1 , +// the embedding for sentence 10 is derived from sentences 9, 10, and 11 combined. +type SemanticChunkingConfiguration struct { + + // The dissimilarity threshold for splitting chunks. + // + // This member is required. + BreakpointPercentileThreshold *int32 + + // The buffer size. + // + // This member is required. + BufferSize *int32 + + // The maximum number of tokens that a chunk can contain. + // + // This member is required. + MaxTokens *int32 + + noSmithyDocumentSerde +} + // Contains the configuration for server-side encryption. type ServerSideEncryptionConfiguration struct { @@ -1698,6 +3024,72 @@ type ServerSideEncryptionConfiguration struct { noSmithyDocumentSerde } +// The configuration of the SharePoint content. For example, configuring specific +// types of SharePoint content. +type SharePointCrawlerConfiguration struct { + + // The configuration of filtering the SharePoint content. For example, configuring + // regular expression patterns to include or exclude certain content. + FilterConfiguration *CrawlFilterConfiguration + + noSmithyDocumentSerde +} + +// The configuration information to connect to SharePoint as your data source. +type SharePointDataSourceConfiguration struct { + + // The endpoint information to connect to your SharePoint data source. + // + // This member is required. + SourceConfiguration *SharePointSourceConfiguration + + // The configuration of the SharePoint content. For example, configuring specific + // types of SharePoint content. + CrawlerConfiguration *SharePointCrawlerConfiguration + + noSmithyDocumentSerde +} + +// The endpoint information to connect to your SharePoint data source. +type SharePointSourceConfiguration struct { + + // The supported authentication type to authenticate and connect to your + // SharePoint site/sites. + // + // This member is required. + AuthType SharePointAuthType + + // The Amazon Resource Name of an Secrets Manager secret that stores your + // authentication credentials for your SharePoint site/sites. For more information + // on the key-value pairs that must be included in your secret, depending on your + // authentication type, see [SharePoint connection configuration]. + // + // [SharePoint connection configuration]: https://docs.aws.amazon.com/bedrock/latest/userguide/sharepoint-data-source-connector.html#configuration-sharepoint-connector + // + // This member is required. + CredentialsSecretArn *string + + // The domain of your SharePoint instance or site URL/URLs. + // + // This member is required. + Domain *string + + // The supported host type, whether online/cloud or server/on-premises. + // + // This member is required. + HostType SharePointHostType + + // A list of one or more SharePoint site URLs. + // + // This member is required. + SiteUrls []string + + // The identifier of your Microsoft 365 tenant. + TenantId *string + + noSmithyDocumentSerde +} + // Contains the storage configuration of the knowledge base. type StorageConfiguration struct { @@ -1729,6 +3121,116 @@ type StorageConfiguration struct { noSmithyDocumentSerde } +// Contains configurations for a Storage node in a flow. This node stores the +// input in an Amazon S3 location that you specify. +type StorageFlowNodeConfiguration struct { + + // Contains configurations for the service to use for storing the input into the + // node. + // + // This member is required. + ServiceConfiguration StorageFlowNodeServiceConfiguration + + noSmithyDocumentSerde +} + +// Contains configurations for the Amazon S3 location in which to store the input +// into the node. +type StorageFlowNodeS3Configuration struct { + + // The name of the Amazon S3 bucket in which to store the input into the node. + // + // This member is required. + BucketName *string + + noSmithyDocumentSerde +} + +// Contains configurations for the service to use for storing the input into the +// node. +// +// The following types satisfy this interface: +// +// StorageFlowNodeServiceConfigurationMemberS3 +type StorageFlowNodeServiceConfiguration interface { + isStorageFlowNodeServiceConfiguration() +} + +// Contains configurations for the Amazon S3 location in which to store the input +// into the node. +type StorageFlowNodeServiceConfigurationMemberS3 struct { + Value StorageFlowNodeS3Configuration + + noSmithyDocumentSerde +} + +func (*StorageFlowNodeServiceConfigurationMemberS3) isStorageFlowNodeServiceConfiguration() {} + +// Contains configurations for a text prompt template. To include a variable, +// enclose a word in double curly braces as in {{variable}} . +type TextPromptTemplateConfiguration struct { + + // The message for the prompt. + // + // This member is required. + Text *string + + // An array of the variables in the prompt template. + InputVariables []PromptInputVariable + + noSmithyDocumentSerde +} + +// A custom processing step for documents moving through a data source ingestion +// pipeline. To process documents after they have been converted into chunks, set +// the step to apply to POST_CHUNKING . +type Transformation struct { + + // When the service applies the transformation. + // + // This member is required. + StepToApply StepType + + // A Lambda function that processes documents. + // + // This member is required. + TransformationFunction *TransformationFunction + + noSmithyDocumentSerde +} + +// A Lambda function that processes documents. +type TransformationFunction struct { + + // The Lambda function. + // + // This member is required. + TransformationLambdaConfiguration *TransformationLambdaConfiguration + + noSmithyDocumentSerde +} + +// A Lambda function that processes documents. +type TransformationLambdaConfiguration struct { + + // The function's ARN identifier. + // + // This member is required. + LambdaArn *string + + noSmithyDocumentSerde +} + +// The configuration of web URLs that you want to crawl. You should be authorized +// to crawl the URLs. +type UrlConfiguration struct { + + // One or more seed or starting point URLs. + SeedUrls []SeedUrl + + noSmithyDocumentSerde +} + // Stores information about a field passed inside a request that resulted in an // validation error. type ValidationExceptionField struct { @@ -1754,6 +3256,12 @@ type VectorIngestionConfiguration struct { // belongs to is queried. ChunkingConfiguration *ChunkingConfiguration + // A custom document transformer for parsed data source documents. + CustomTransformationConfiguration *CustomTransformationConfiguration + + // A custom parser for data source documents. + ParsingConfiguration *ParsingConfiguration + noSmithyDocumentSerde } @@ -1774,6 +3282,74 @@ type VectorKnowledgeBaseConfiguration struct { noSmithyDocumentSerde } +// The configuration of web URLs that you want to crawl. You should be authorized +// to crawl the URLs. +type WebCrawlerConfiguration struct { + + // The configuration of crawl limits for the web URLs. + CrawlerLimits *WebCrawlerLimits + + // A list of one or more exclusion regular expression patterns to exclude certain + // URLs. If you specify an inclusion and exclusion filter/pattern and both match a + // URL, the exclusion filter takes precedence and the web content of the URL isn’t + // crawled. + ExclusionFilters []string + + // A list of one or more inclusion regular expression patterns to include certain + // URLs. If you specify an inclusion and exclusion filter/pattern and both match a + // URL, the exclusion filter takes precedence and the web content of the URL isn’t + // crawled. + InclusionFilters []string + + // The scope of what is crawled for your URLs. + // + // You can choose to crawl only web pages that belong to the same host or primary + // domain. For example, only web pages that contain the seed URL + // "https://docs.aws.amazon.com/bedrock/latest/userguide/" and no other domains. + // You can choose to include sub domains in addition to the host or primary domain. + // For example, web pages that contain "aws.amazon.com" can also include sub domain + // "docs.aws.amazon.com". + Scope WebScopeType + + noSmithyDocumentSerde +} + +// The rate limits for the URLs that you want to crawl. You should be authorized +// to crawl the URLs. +type WebCrawlerLimits struct { + + // The max rate at which pages are crawled, up to 300 per minute per host. + RateLimit *int32 + + noSmithyDocumentSerde +} + +// The configuration details for the web data source. +type WebDataSourceConfiguration struct { + + // The source configuration details for the web data source. + // + // This member is required. + SourceConfiguration *WebSourceConfiguration + + // The Web Crawler configuration details for the web data source. + CrawlerConfiguration *WebCrawlerConfiguration + + noSmithyDocumentSerde +} + +// The configuration of the URL/URLs for the web content that you want to crawl. +// You should be authorized to crawl the URLs. +type WebSourceConfiguration struct { + + // The configuration of the URL/URLs. + // + // This member is required. + UrlConfiguration *UrlConfiguration + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde // UnknownUnionMember is returned when a union member is returned over the wire, @@ -1785,6 +3361,13 @@ type UnknownUnionMember struct { noSmithyDocumentSerde } -func (*UnknownUnionMember) isActionGroupExecutor() {} -func (*UnknownUnionMember) isAPISchema() {} -func (*UnknownUnionMember) isFunctionSchema() {} +func (*UnknownUnionMember) isActionGroupExecutor() {} +func (*UnknownUnionMember) isAPISchema() {} +func (*UnknownUnionMember) isFlowConnectionConfiguration() {} +func (*UnknownUnionMember) isFlowNodeConfiguration() {} +func (*UnknownUnionMember) isFunctionSchema() {} +func (*UnknownUnionMember) isPromptFlowNodeSourceConfiguration() {} +func (*UnknownUnionMember) isPromptInferenceConfiguration() {} +func (*UnknownUnionMember) isPromptTemplateConfiguration() {} +func (*UnknownUnionMember) isRetrievalFlowNodeServiceConfiguration() {} +func (*UnknownUnionMember) isStorageFlowNodeServiceConfiguration() {} diff --git a/service/bedrockagent/types/types_exported_test.go b/service/bedrockagent/types/types_exported_test.go index f38a171b5d7..b26d2965879 100644 --- a/service/bedrockagent/types/types_exported_test.go +++ b/service/bedrockagent/types/types_exported_test.go @@ -51,6 +51,90 @@ func ExampleAPISchema_outputUsage() { var _ *string var _ *types.S3Identifier +func ExampleFlowConnectionConfiguration_outputUsage() { + var union types.FlowConnectionConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.FlowConnectionConfigurationMemberConditional: + _ = v.Value // Value is types.FlowConditionalConnectionConfiguration + + case *types.FlowConnectionConfigurationMemberData: + _ = v.Value // Value is types.FlowDataConnectionConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.FlowConditionalConnectionConfiguration +var _ *types.FlowDataConnectionConfiguration + +func ExampleFlowNodeConfiguration_outputUsage() { + var union types.FlowNodeConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.FlowNodeConfigurationMemberAgent: + _ = v.Value // Value is types.AgentFlowNodeConfiguration + + case *types.FlowNodeConfigurationMemberCollector: + _ = v.Value // Value is types.CollectorFlowNodeConfiguration + + case *types.FlowNodeConfigurationMemberCondition: + _ = v.Value // Value is types.ConditionFlowNodeConfiguration + + case *types.FlowNodeConfigurationMemberInput: + _ = v.Value // Value is types.InputFlowNodeConfiguration + + case *types.FlowNodeConfigurationMemberIterator: + _ = v.Value // Value is types.IteratorFlowNodeConfiguration + + case *types.FlowNodeConfigurationMemberKnowledgeBase: + _ = v.Value // Value is types.KnowledgeBaseFlowNodeConfiguration + + case *types.FlowNodeConfigurationMemberLambdaFunction: + _ = v.Value // Value is types.LambdaFunctionFlowNodeConfiguration + + case *types.FlowNodeConfigurationMemberLex: + _ = v.Value // Value is types.LexFlowNodeConfiguration + + case *types.FlowNodeConfigurationMemberOutput: + _ = v.Value // Value is types.OutputFlowNodeConfiguration + + case *types.FlowNodeConfigurationMemberPrompt: + _ = v.Value // Value is types.PromptFlowNodeConfiguration + + case *types.FlowNodeConfigurationMemberRetrieval: + _ = v.Value // Value is types.RetrievalFlowNodeConfiguration + + case *types.FlowNodeConfigurationMemberStorage: + _ = v.Value // Value is types.StorageFlowNodeConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.IteratorFlowNodeConfiguration +var _ *types.LambdaFunctionFlowNodeConfiguration +var _ *types.ConditionFlowNodeConfiguration +var _ *types.CollectorFlowNodeConfiguration +var _ *types.OutputFlowNodeConfiguration +var _ *types.AgentFlowNodeConfiguration +var _ *types.RetrievalFlowNodeConfiguration +var _ *types.StorageFlowNodeConfiguration +var _ *types.KnowledgeBaseFlowNodeConfiguration +var _ *types.LexFlowNodeConfiguration +var _ *types.PromptFlowNodeConfiguration +var _ *types.InputFlowNodeConfiguration + func ExampleFunctionSchema_outputUsage() { var union types.FunctionSchema // type switches can be used to check the union value @@ -68,3 +152,97 @@ func ExampleFunctionSchema_outputUsage() { } var _ []types.Function + +func ExamplePromptFlowNodeSourceConfiguration_outputUsage() { + var union types.PromptFlowNodeSourceConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.PromptFlowNodeSourceConfigurationMemberInline: + _ = v.Value // Value is types.PromptFlowNodeInlineConfiguration + + case *types.PromptFlowNodeSourceConfigurationMemberResource: + _ = v.Value // Value is types.PromptFlowNodeResourceConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.PromptFlowNodeInlineConfiguration +var _ *types.PromptFlowNodeResourceConfiguration + +func ExamplePromptInferenceConfiguration_outputUsage() { + var union types.PromptInferenceConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.PromptInferenceConfigurationMemberText: + _ = v.Value // Value is types.PromptModelInferenceConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.PromptModelInferenceConfiguration + +func ExamplePromptTemplateConfiguration_outputUsage() { + var union types.PromptTemplateConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.PromptTemplateConfigurationMemberText: + _ = v.Value // Value is types.TextPromptTemplateConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.TextPromptTemplateConfiguration + +func ExampleRetrievalFlowNodeServiceConfiguration_outputUsage() { + var union types.RetrievalFlowNodeServiceConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.RetrievalFlowNodeServiceConfigurationMemberS3: + _ = v.Value // Value is types.RetrievalFlowNodeS3Configuration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.RetrievalFlowNodeS3Configuration + +func ExampleStorageFlowNodeServiceConfiguration_outputUsage() { + var union types.StorageFlowNodeServiceConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.StorageFlowNodeServiceConfigurationMemberS3: + _ = v.Value // Value is types.StorageFlowNodeS3Configuration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.StorageFlowNodeS3Configuration diff --git a/service/bedrockagent/validators.go b/service/bedrockagent/validators.go index 8148389b9dc..e923868eaf9 100644 --- a/service/bedrockagent/validators.go +++ b/service/bedrockagent/validators.go @@ -110,6 +110,66 @@ func (m *validateOpCreateDataSource) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpCreateFlowAlias struct { +} + +func (*validateOpCreateFlowAlias) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateFlowAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateFlowAliasInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateFlowAliasInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateFlow struct { +} + +func (*validateOpCreateFlow) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateFlow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateFlowInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateFlowInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateFlowVersion struct { +} + +func (*validateOpCreateFlowVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateFlowVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateFlowVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateFlowVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateKnowledgeBase struct { } @@ -130,6 +190,46 @@ func (m *validateOpCreateKnowledgeBase) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpCreatePrompt struct { +} + +func (*validateOpCreatePrompt) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreatePrompt) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreatePromptInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreatePromptInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreatePromptVersion struct { +} + +func (*validateOpCreatePromptVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreatePromptVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreatePromptVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreatePromptVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteAgentActionGroup struct { } @@ -230,6 +330,66 @@ func (m *validateOpDeleteDataSource) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpDeleteFlowAlias struct { +} + +func (*validateOpDeleteFlowAlias) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteFlowAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteFlowAliasInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteFlowAliasInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteFlow struct { +} + +func (*validateOpDeleteFlow) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteFlow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteFlowInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteFlowInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteFlowVersion struct { +} + +func (*validateOpDeleteFlowVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteFlowVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteFlowVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteFlowVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteKnowledgeBase struct { } @@ -250,6 +410,26 @@ func (m *validateOpDeleteKnowledgeBase) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpDeletePrompt struct { +} + +func (*validateOpDeletePrompt) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeletePrompt) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeletePromptInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeletePromptInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDisassociateAgentKnowledgeBase struct { } @@ -390,6 +570,66 @@ func (m *validateOpGetDataSource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpGetFlowAlias struct { +} + +func (*validateOpGetFlowAlias) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetFlowAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetFlowAliasInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetFlowAliasInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetFlow struct { +} + +func (*validateOpGetFlow) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetFlow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetFlowInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetFlowInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetFlowVersion struct { +} + +func (*validateOpGetFlowVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetFlowVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetFlowVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetFlowVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetIngestionJob struct { } @@ -430,6 +670,26 @@ func (m *validateOpGetKnowledgeBase) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpGetPrompt struct { +} + +func (*validateOpGetPrompt) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetPrompt) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetPromptInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetPromptInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListAgentActionGroups struct { } @@ -530,6 +790,46 @@ func (m *validateOpListDataSources) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpListFlowAliases struct { +} + +func (*validateOpListFlowAliases) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListFlowAliases) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListFlowAliasesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListFlowAliasesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListFlowVersions struct { +} + +func (*validateOpListFlowVersions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListFlowVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListFlowVersionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListFlowVersionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListIngestionJobs struct { } @@ -590,6 +890,26 @@ func (m *validateOpPrepareAgent) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpPrepareFlow struct { +} + +func (*validateOpPrepareFlow) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPrepareFlow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PrepareFlowInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPrepareFlowInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartIngestionJob struct { } @@ -750,50 +1070,130 @@ func (m *validateOpUpdateDataSource) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } -type validateOpUpdateKnowledgeBase struct { +type validateOpUpdateFlowAlias struct { } -func (*validateOpUpdateKnowledgeBase) ID() string { +func (*validateOpUpdateFlowAlias) ID() string { return "OperationInputValidation" } -func (m *validateOpUpdateKnowledgeBase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( +func (m *validateOpUpdateFlowAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { - input, ok := in.Parameters.(*UpdateKnowledgeBaseInput) + input, ok := in.Parameters.(*UpdateFlowAliasInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } - if err := validateOpUpdateKnowledgeBaseInput(input); err != nil { + if err := validateOpUpdateFlowAliasInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } -func addOpAssociateAgentKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateAgentKnowledgeBase{}, middleware.After) -} - -func addOpCreateAgentActionGroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateAgentActionGroup{}, middleware.After) +type validateOpUpdateFlow struct { } -func addOpCreateAgentAliasValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateAgentAlias{}, middleware.After) +func (*validateOpUpdateFlow) ID() string { + return "OperationInputValidation" } -func addOpCreateAgentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateAgent{}, middleware.After) +func (m *validateOpUpdateFlow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateFlowInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateFlowInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateKnowledgeBase struct { +} + +func (*validateOpUpdateKnowledgeBase) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateKnowledgeBase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateKnowledgeBaseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateKnowledgeBaseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdatePrompt struct { +} + +func (*validateOpUpdatePrompt) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePrompt) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePromptInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePromptInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAssociateAgentKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateAgentKnowledgeBase{}, middleware.After) +} + +func addOpCreateAgentActionGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAgentActionGroup{}, middleware.After) +} + +func addOpCreateAgentAliasValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAgentAlias{}, middleware.After) +} + +func addOpCreateAgentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAgent{}, middleware.After) } func addOpCreateDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDataSource{}, middleware.After) } +func addOpCreateFlowAliasValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateFlowAlias{}, middleware.After) +} + +func addOpCreateFlowValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateFlow{}, middleware.After) +} + +func addOpCreateFlowVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateFlowVersion{}, middleware.After) +} + func addOpCreateKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateKnowledgeBase{}, middleware.After) } +func addOpCreatePromptValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreatePrompt{}, middleware.After) +} + +func addOpCreatePromptVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreatePromptVersion{}, middleware.After) +} + func addOpDeleteAgentActionGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAgentActionGroup{}, middleware.After) } @@ -814,10 +1214,26 @@ func addOpDeleteDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDataSource{}, middleware.After) } +func addOpDeleteFlowAliasValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteFlowAlias{}, middleware.After) +} + +func addOpDeleteFlowValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteFlow{}, middleware.After) +} + +func addOpDeleteFlowVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteFlowVersion{}, middleware.After) +} + func addOpDeleteKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteKnowledgeBase{}, middleware.After) } +func addOpDeletePromptValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeletePrompt{}, middleware.After) +} + func addOpDisassociateAgentKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateAgentKnowledgeBase{}, middleware.After) } @@ -846,6 +1262,18 @@ func addOpGetDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDataSource{}, middleware.After) } +func addOpGetFlowAliasValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetFlowAlias{}, middleware.After) +} + +func addOpGetFlowValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetFlow{}, middleware.After) +} + +func addOpGetFlowVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetFlowVersion{}, middleware.After) +} + func addOpGetIngestionJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetIngestionJob{}, middleware.After) } @@ -854,6 +1282,10 @@ func addOpGetKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetKnowledgeBase{}, middleware.After) } +func addOpGetPromptValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetPrompt{}, middleware.After) +} + func addOpListAgentActionGroupsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAgentActionGroups{}, middleware.After) } @@ -874,6 +1306,14 @@ func addOpListDataSourcesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDataSources{}, middleware.After) } +func addOpListFlowAliasesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListFlowAliases{}, middleware.After) +} + +func addOpListFlowVersionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListFlowVersions{}, middleware.After) +} + func addOpListIngestionJobsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListIngestionJobs{}, middleware.After) } @@ -886,6 +1326,10 @@ func addOpPrepareAgentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPrepareAgent{}, middleware.After) } +func addOpPrepareFlowValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPrepareFlow{}, middleware.After) +} + func addOpStartIngestionJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartIngestionJob{}, middleware.After) } @@ -918,22 +1362,29 @@ func addOpUpdateDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDataSource{}, middleware.After) } +func addOpUpdateFlowAliasValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateFlowAlias{}, middleware.After) +} + +func addOpUpdateFlowValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateFlow{}, middleware.After) +} + func addOpUpdateKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateKnowledgeBase{}, middleware.After) } -func validateChunkingConfiguration(v *types.ChunkingConfiguration) error { +func addOpUpdatePromptValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePrompt{}, middleware.After) +} + +func validateAgentFlowNodeConfiguration(v *types.AgentFlowNodeConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "ChunkingConfiguration"} - if len(v.ChunkingStrategy) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("ChunkingStrategy")) - } - if v.FixedSizeChunkingConfiguration != nil { - if err := validateFixedSizeChunkingConfiguration(v.FixedSizeChunkingConfiguration); err != nil { - invalidParams.AddNested("FixedSizeChunkingConfiguration", err.(smithy.InvalidParamsError)) - } + invalidParams := smithy.InvalidParamsError{Context: "AgentFlowNodeConfiguration"} + if v.AgentAliasArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AgentAliasArn")) } if invalidParams.Len() > 0 { return invalidParams @@ -942,17 +1393,17 @@ func validateChunkingConfiguration(v *types.ChunkingConfiguration) error { } } -func validateDataSourceConfiguration(v *types.DataSourceConfiguration) error { +func validateBedrockFoundationModelConfiguration(v *types.BedrockFoundationModelConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "DataSourceConfiguration"} - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) + invalidParams := smithy.InvalidParamsError{Context: "BedrockFoundationModelConfiguration"} + if v.ModelArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelArn")) } - if v.S3Configuration != nil { - if err := validateS3DataSourceConfiguration(v.S3Configuration); err != nil { - invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError)) + if v.ParsingPrompt != nil { + if err := validateParsingPrompt(v.ParsingPrompt); err != nil { + invalidParams.AddNested("ParsingPrompt", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -962,16 +1413,28 @@ func validateDataSourceConfiguration(v *types.DataSourceConfiguration) error { } } -func validateFixedSizeChunkingConfiguration(v *types.FixedSizeChunkingConfiguration) error { +func validateChunkingConfiguration(v *types.ChunkingConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "FixedSizeChunkingConfiguration"} - if v.MaxTokens == nil { - invalidParams.Add(smithy.NewErrParamRequired("MaxTokens")) + invalidParams := smithy.InvalidParamsError{Context: "ChunkingConfiguration"} + if len(v.ChunkingStrategy) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ChunkingStrategy")) } - if v.OverlapPercentage == nil { - invalidParams.Add(smithy.NewErrParamRequired("OverlapPercentage")) + if v.FixedSizeChunkingConfiguration != nil { + if err := validateFixedSizeChunkingConfiguration(v.FixedSizeChunkingConfiguration); err != nil { + invalidParams.AddNested("FixedSizeChunkingConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.HierarchicalChunkingConfiguration != nil { + if err := validateHierarchicalChunkingConfiguration(v.HierarchicalChunkingConfiguration); err != nil { + invalidParams.AddNested("HierarchicalChunkingConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.SemanticChunkingConfiguration != nil { + if err := validateSemanticChunkingConfiguration(v.SemanticChunkingConfiguration); err != nil { + invalidParams.AddNested("SemanticChunkingConfiguration", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -980,17 +1443,16 @@ func validateFixedSizeChunkingConfiguration(v *types.FixedSizeChunkingConfigurat } } -func validateFunction(v *types.Function) error { +func validateConditionFlowNodeConfiguration(v *types.ConditionFlowNodeConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "Function"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.Parameters != nil { - if err := validateParameterMap(v.Parameters); err != nil { - invalidParams.AddNested("Parameters", err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "ConditionFlowNodeConfiguration"} + if v.Conditions == nil { + invalidParams.Add(smithy.NewErrParamRequired("Conditions")) + } else if v.Conditions != nil { + if err := validateFlowConditions(v.Conditions); err != nil { + invalidParams.AddNested("Conditions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -1000,14 +1462,14 @@ func validateFunction(v *types.Function) error { } } -func validateFunctions(v []types.Function) error { +func validateConfluenceCrawlerConfiguration(v *types.ConfluenceCrawlerConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "Functions"} - for i := range v { - if err := validateFunction(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "ConfluenceCrawlerConfiguration"} + if v.FilterConfiguration != nil { + if err := validateCrawlFilterConfiguration(v.FilterConfiguration); err != nil { + invalidParams.AddNested("FilterConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -1017,17 +1479,22 @@ func validateFunctions(v []types.Function) error { } } -func validateFunctionSchema(v types.FunctionSchema) error { +func validateConfluenceDataSourceConfiguration(v *types.ConfluenceDataSourceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "FunctionSchema"} - switch uv := v.(type) { - case *types.FunctionSchemaMemberFunctions: - if err := validateFunctions(uv.Value); err != nil { - invalidParams.AddNested("[functions]", err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "ConfluenceDataSourceConfiguration"} + if v.SourceConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceConfiguration")) + } else if v.SourceConfiguration != nil { + if err := validateConfluenceSourceConfiguration(v.SourceConfiguration); err != nil { + invalidParams.AddNested("SourceConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.CrawlerConfiguration != nil { + if err := validateConfluenceCrawlerConfiguration(v.CrawlerConfiguration); err != nil { + invalidParams.AddNested("CrawlerConfiguration", err.(smithy.InvalidParamsError)) } - } if invalidParams.Len() > 0 { return invalidParams @@ -1036,19 +1503,22 @@ func validateFunctionSchema(v types.FunctionSchema) error { } } -func validateIngestionJobFilter(v *types.IngestionJobFilter) error { +func validateConfluenceSourceConfiguration(v *types.ConfluenceSourceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "IngestionJobFilter"} - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) + invalidParams := smithy.InvalidParamsError{Context: "ConfluenceSourceConfiguration"} + if v.HostUrl == nil { + invalidParams.Add(smithy.NewErrParamRequired("HostUrl")) } - if len(v.Operator) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Operator")) + if len(v.HostType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("HostType")) } - if v.Values == nil { - invalidParams.Add(smithy.NewErrParamRequired("Values")) + if len(v.AuthType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AuthType")) + } + if v.CredentialsSecretArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) } if invalidParams.Len() > 0 { return invalidParams @@ -1057,14 +1527,17 @@ func validateIngestionJobFilter(v *types.IngestionJobFilter) error { } } -func validateIngestionJobFilters(v []types.IngestionJobFilter) error { +func validateCrawlFilterConfiguration(v *types.CrawlFilterConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "IngestionJobFilters"} - for i := range v { - if err := validateIngestionJobFilter(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "CrawlFilterConfiguration"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.PatternObjectFilter != nil { + if err := validatePatternObjectFilterConfiguration(v.PatternObjectFilter); err != nil { + invalidParams.AddNested("PatternObjectFilter", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -1074,16 +1547,24 @@ func validateIngestionJobFilters(v []types.IngestionJobFilter) error { } } -func validateIngestionJobSortBy(v *types.IngestionJobSortBy) error { +func validateCustomTransformationConfiguration(v *types.CustomTransformationConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "IngestionJobSortBy"} - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) + invalidParams := smithy.InvalidParamsError{Context: "CustomTransformationConfiguration"} + if v.IntermediateStorage == nil { + invalidParams.Add(smithy.NewErrParamRequired("IntermediateStorage")) + } else if v.IntermediateStorage != nil { + if err := validateIntermediateStorage(v.IntermediateStorage); err != nil { + invalidParams.AddNested("IntermediateStorage", err.(smithy.InvalidParamsError)) + } } - if len(v.Order) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Order")) + if v.Transformations == nil { + invalidParams.Add(smithy.NewErrParamRequired("Transformations")) + } else if v.Transformations != nil { + if err := validateTransformations(v.Transformations); err != nil { + invalidParams.AddNested("Transformations", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -1092,17 +1573,37 @@ func validateIngestionJobSortBy(v *types.IngestionJobSortBy) error { } } -func validateKnowledgeBaseConfiguration(v *types.KnowledgeBaseConfiguration) error { +func validateDataSourceConfiguration(v *types.DataSourceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "KnowledgeBaseConfiguration"} + invalidParams := smithy.InvalidParamsError{Context: "DataSourceConfiguration"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } - if v.VectorKnowledgeBaseConfiguration != nil { - if err := validateVectorKnowledgeBaseConfiguration(v.VectorKnowledgeBaseConfiguration); err != nil { - invalidParams.AddNested("VectorKnowledgeBaseConfiguration", err.(smithy.InvalidParamsError)) + if v.S3Configuration != nil { + if err := validateS3DataSourceConfiguration(v.S3Configuration); err != nil { + invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError)) + } + } + if v.WebConfiguration != nil { + if err := validateWebDataSourceConfiguration(v.WebConfiguration); err != nil { + invalidParams.AddNested("WebConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.ConfluenceConfiguration != nil { + if err := validateConfluenceDataSourceConfiguration(v.ConfluenceConfiguration); err != nil { + invalidParams.AddNested("ConfluenceConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.SalesforceConfiguration != nil { + if err := validateSalesforceDataSourceConfiguration(v.SalesforceConfiguration); err != nil { + invalidParams.AddNested("SalesforceConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.SharePointConfiguration != nil { + if err := validateSharePointDataSourceConfiguration(v.SharePointConfiguration); err != nil { + invalidParams.AddNested("SharePointConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -1112,32 +1613,16 @@ func validateKnowledgeBaseConfiguration(v *types.KnowledgeBaseConfiguration) err } } -func validateMongoDbAtlasConfiguration(v *types.MongoDbAtlasConfiguration) error { +func validateFixedSizeChunkingConfiguration(v *types.FixedSizeChunkingConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "MongoDbAtlasConfiguration"} - if v.Endpoint == nil { - invalidParams.Add(smithy.NewErrParamRequired("Endpoint")) - } - if v.DatabaseName == nil { - invalidParams.Add(smithy.NewErrParamRequired("DatabaseName")) - } - if v.CollectionName == nil { - invalidParams.Add(smithy.NewErrParamRequired("CollectionName")) - } - if v.VectorIndexName == nil { - invalidParams.Add(smithy.NewErrParamRequired("VectorIndexName")) - } - if v.CredentialsSecretArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) + invalidParams := smithy.InvalidParamsError{Context: "FixedSizeChunkingConfiguration"} + if v.MaxTokens == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxTokens")) } - if v.FieldMapping == nil { - invalidParams.Add(smithy.NewErrParamRequired("FieldMapping")) - } else if v.FieldMapping != nil { - if err := validateMongoDbAtlasFieldMapping(v.FieldMapping); err != nil { - invalidParams.AddNested("FieldMapping", err.(smithy.InvalidParamsError)) - } + if v.OverlapPercentage == nil { + invalidParams.Add(smithy.NewErrParamRequired("OverlapPercentage")) } if invalidParams.Len() > 0 { return invalidParams @@ -1146,19 +1631,13 @@ func validateMongoDbAtlasConfiguration(v *types.MongoDbAtlasConfiguration) error } } -func validateMongoDbAtlasFieldMapping(v *types.MongoDbAtlasFieldMapping) error { +func validateFlowCondition(v *types.FlowCondition) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "MongoDbAtlasFieldMapping"} - if v.VectorField == nil { - invalidParams.Add(smithy.NewErrParamRequired("VectorField")) - } - if v.TextField == nil { - invalidParams.Add(smithy.NewErrParamRequired("TextField")) - } - if v.MetadataField == nil { - invalidParams.Add(smithy.NewErrParamRequired("MetadataField")) + invalidParams := smithy.InvalidParamsError{Context: "FlowCondition"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams @@ -1167,23 +1646,13 @@ func validateMongoDbAtlasFieldMapping(v *types.MongoDbAtlasFieldMapping) error { } } -func validateOpenSearchServerlessConfiguration(v *types.OpenSearchServerlessConfiguration) error { +func validateFlowConditionalConnectionConfiguration(v *types.FlowConditionalConnectionConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "OpenSearchServerlessConfiguration"} - if v.CollectionArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CollectionArn")) - } - if v.VectorIndexName == nil { - invalidParams.Add(smithy.NewErrParamRequired("VectorIndexName")) - } - if v.FieldMapping == nil { - invalidParams.Add(smithy.NewErrParamRequired("FieldMapping")) - } else if v.FieldMapping != nil { - if err := validateOpenSearchServerlessFieldMapping(v.FieldMapping); err != nil { - invalidParams.AddNested("FieldMapping", err.(smithy.InvalidParamsError)) - } + invalidParams := smithy.InvalidParamsError{Context: "FlowConditionalConnectionConfiguration"} + if v.Condition == nil { + invalidParams.Add(smithy.NewErrParamRequired("Condition")) } if invalidParams.Len() > 0 { return invalidParams @@ -1192,19 +1661,1113 @@ func validateOpenSearchServerlessConfiguration(v *types.OpenSearchServerlessConf } } -func validateOpenSearchServerlessFieldMapping(v *types.OpenSearchServerlessFieldMapping) error { +func validateFlowConditions(v []types.FlowCondition) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "OpenSearchServerlessFieldMapping"} - if v.VectorField == nil { - invalidParams.Add(smithy.NewErrParamRequired("VectorField")) + invalidParams := smithy.InvalidParamsError{Context: "FlowConditions"} + for i := range v { + if err := validateFlowCondition(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowConnection(v *types.FlowConnection) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowConnection"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.Target == nil { + invalidParams.Add(smithy.NewErrParamRequired("Target")) + } + if v.Configuration != nil { + if err := validateFlowConnectionConfiguration(v.Configuration); err != nil { + invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowConnectionConfiguration(v types.FlowConnectionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowConnectionConfiguration"} + switch uv := v.(type) { + case *types.FlowConnectionConfigurationMemberConditional: + if err := validateFlowConditionalConnectionConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[conditional]", err.(smithy.InvalidParamsError)) + } + + case *types.FlowConnectionConfigurationMemberData: + if err := validateFlowDataConnectionConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[data]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowConnections(v []types.FlowConnection) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowConnections"} + for i := range v { + if err := validateFlowConnection(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowDataConnectionConfiguration(v *types.FlowDataConnectionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowDataConnectionConfiguration"} + if v.SourceOutput == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceOutput")) + } + if v.TargetInput == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetInput")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowDefinition(v *types.FlowDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowDefinition"} + if v.Nodes != nil { + if err := validateFlowNodes(v.Nodes); err != nil { + invalidParams.AddNested("Nodes", err.(smithy.InvalidParamsError)) + } + } + if v.Connections != nil { + if err := validateFlowConnections(v.Connections); err != nil { + invalidParams.AddNested("Connections", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowNode(v *types.FlowNode) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowNode"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Configuration != nil { + if err := validateFlowNodeConfiguration(v.Configuration); err != nil { + invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) + } + } + if v.Inputs != nil { + if err := validateFlowNodeInputs(v.Inputs); err != nil { + invalidParams.AddNested("Inputs", err.(smithy.InvalidParamsError)) + } + } + if v.Outputs != nil { + if err := validateFlowNodeOutputs(v.Outputs); err != nil { + invalidParams.AddNested("Outputs", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowNodeConfiguration(v types.FlowNodeConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowNodeConfiguration"} + switch uv := v.(type) { + case *types.FlowNodeConfigurationMemberAgent: + if err := validateAgentFlowNodeConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[agent]", err.(smithy.InvalidParamsError)) + } + + case *types.FlowNodeConfigurationMemberCondition: + if err := validateConditionFlowNodeConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[condition]", err.(smithy.InvalidParamsError)) + } + + case *types.FlowNodeConfigurationMemberKnowledgeBase: + if err := validateKnowledgeBaseFlowNodeConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[knowledgeBase]", err.(smithy.InvalidParamsError)) + } + + case *types.FlowNodeConfigurationMemberLambdaFunction: + if err := validateLambdaFunctionFlowNodeConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[lambdaFunction]", err.(smithy.InvalidParamsError)) + } + + case *types.FlowNodeConfigurationMemberLex: + if err := validateLexFlowNodeConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[lex]", err.(smithy.InvalidParamsError)) + } + + case *types.FlowNodeConfigurationMemberPrompt: + if err := validatePromptFlowNodeConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[prompt]", err.(smithy.InvalidParamsError)) + } + + case *types.FlowNodeConfigurationMemberRetrieval: + if err := validateRetrievalFlowNodeConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[retrieval]", err.(smithy.InvalidParamsError)) + } + + case *types.FlowNodeConfigurationMemberStorage: + if err := validateStorageFlowNodeConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[storage]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowNodeInput(v *types.FlowNodeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowNodeInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Expression == nil { + invalidParams.Add(smithy.NewErrParamRequired("Expression")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowNodeInputs(v []types.FlowNodeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowNodeInputs"} + for i := range v { + if err := validateFlowNodeInput(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowNodeOutput(v *types.FlowNodeOutput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowNodeOutput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowNodeOutputs(v []types.FlowNodeOutput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowNodeOutputs"} + for i := range v { + if err := validateFlowNodeOutput(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowNodes(v []types.FlowNode) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowNodes"} + for i := range v { + if err := validateFlowNode(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFunction(v *types.Function) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Function"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Parameters != nil { + if err := validateParameterMap(v.Parameters); err != nil { + invalidParams.AddNested("Parameters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFunctions(v []types.Function) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Functions"} + for i := range v { + if err := validateFunction(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFunctionSchema(v types.FunctionSchema) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FunctionSchema"} + switch uv := v.(type) { + case *types.FunctionSchemaMemberFunctions: + if err := validateFunctions(uv.Value); err != nil { + invalidParams.AddNested("[functions]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateHierarchicalChunkingConfiguration(v *types.HierarchicalChunkingConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "HierarchicalChunkingConfiguration"} + if v.LevelConfigurations == nil { + invalidParams.Add(smithy.NewErrParamRequired("LevelConfigurations")) + } else if v.LevelConfigurations != nil { + if err := validateHierarchicalChunkingLevelConfigurations(v.LevelConfigurations); err != nil { + invalidParams.AddNested("LevelConfigurations", err.(smithy.InvalidParamsError)) + } + } + if v.OverlapTokens == nil { + invalidParams.Add(smithy.NewErrParamRequired("OverlapTokens")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateHierarchicalChunkingLevelConfiguration(v *types.HierarchicalChunkingLevelConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "HierarchicalChunkingLevelConfiguration"} + if v.MaxTokens == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxTokens")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateHierarchicalChunkingLevelConfigurations(v []types.HierarchicalChunkingLevelConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "HierarchicalChunkingLevelConfigurations"} + for i := range v { + if err := validateHierarchicalChunkingLevelConfiguration(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIngestionJobFilter(v *types.IngestionJobFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IngestionJobFilter"} + if len(v.Attribute) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Attribute")) + } + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIngestionJobFilters(v []types.IngestionJobFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IngestionJobFilters"} + for i := range v { + if err := validateIngestionJobFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIngestionJobSortBy(v *types.IngestionJobSortBy) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IngestionJobSortBy"} + if len(v.Attribute) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Attribute")) + } + if len(v.Order) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Order")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIntermediateStorage(v *types.IntermediateStorage) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IntermediateStorage"} + if v.S3Location == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Location")) + } else if v.S3Location != nil { + if err := validateS3Location(v.S3Location); err != nil { + invalidParams.AddNested("S3Location", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateKnowledgeBaseConfiguration(v *types.KnowledgeBaseConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KnowledgeBaseConfiguration"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.VectorKnowledgeBaseConfiguration != nil { + if err := validateVectorKnowledgeBaseConfiguration(v.VectorKnowledgeBaseConfiguration); err != nil { + invalidParams.AddNested("VectorKnowledgeBaseConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateKnowledgeBaseFlowNodeConfiguration(v *types.KnowledgeBaseFlowNodeConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KnowledgeBaseFlowNodeConfiguration"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaFunctionFlowNodeConfiguration(v *types.LambdaFunctionFlowNodeConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaFunctionFlowNodeConfiguration"} + if v.LambdaArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("LambdaArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLexFlowNodeConfiguration(v *types.LexFlowNodeConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LexFlowNodeConfiguration"} + if v.BotAliasArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("BotAliasArn")) + } + if v.LocaleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("LocaleId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMemoryConfiguration(v *types.MemoryConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MemoryConfiguration"} + if v.EnabledMemoryTypes == nil { + invalidParams.Add(smithy.NewErrParamRequired("EnabledMemoryTypes")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMongoDbAtlasConfiguration(v *types.MongoDbAtlasConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MongoDbAtlasConfiguration"} + if v.Endpoint == nil { + invalidParams.Add(smithy.NewErrParamRequired("Endpoint")) + } + if v.DatabaseName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DatabaseName")) + } + if v.CollectionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("CollectionName")) + } + if v.VectorIndexName == nil { + invalidParams.Add(smithy.NewErrParamRequired("VectorIndexName")) + } + if v.CredentialsSecretArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) + } + if v.FieldMapping == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldMapping")) + } else if v.FieldMapping != nil { + if err := validateMongoDbAtlasFieldMapping(v.FieldMapping); err != nil { + invalidParams.AddNested("FieldMapping", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMongoDbAtlasFieldMapping(v *types.MongoDbAtlasFieldMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MongoDbAtlasFieldMapping"} + if v.VectorField == nil { + invalidParams.Add(smithy.NewErrParamRequired("VectorField")) + } + if v.TextField == nil { + invalidParams.Add(smithy.NewErrParamRequired("TextField")) + } + if v.MetadataField == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetadataField")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpenSearchServerlessConfiguration(v *types.OpenSearchServerlessConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OpenSearchServerlessConfiguration"} + if v.CollectionArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CollectionArn")) + } + if v.VectorIndexName == nil { + invalidParams.Add(smithy.NewErrParamRequired("VectorIndexName")) + } + if v.FieldMapping == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldMapping")) + } else if v.FieldMapping != nil { + if err := validateOpenSearchServerlessFieldMapping(v.FieldMapping); err != nil { + invalidParams.AddNested("FieldMapping", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpenSearchServerlessFieldMapping(v *types.OpenSearchServerlessFieldMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OpenSearchServerlessFieldMapping"} + if v.VectorField == nil { + invalidParams.Add(smithy.NewErrParamRequired("VectorField")) + } + if v.TextField == nil { + invalidParams.Add(smithy.NewErrParamRequired("TextField")) + } + if v.MetadataField == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetadataField")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateParameterDetail(v *types.ParameterDetail) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ParameterDetail"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateParameterMap(v map[string]types.ParameterDetail) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ParameterMap"} + for key := range v { + value := v[key] + if err := validateParameterDetail(&value); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateParsingConfiguration(v *types.ParsingConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ParsingConfiguration"} + if len(v.ParsingStrategy) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ParsingStrategy")) + } + if v.BedrockFoundationModelConfiguration != nil { + if err := validateBedrockFoundationModelConfiguration(v.BedrockFoundationModelConfiguration); err != nil { + invalidParams.AddNested("BedrockFoundationModelConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateParsingPrompt(v *types.ParsingPrompt) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ParsingPrompt"} + if v.ParsingPromptText == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParsingPromptText")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePatternObjectFilter(v *types.PatternObjectFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PatternObjectFilter"} + if v.ObjectType == nil { + invalidParams.Add(smithy.NewErrParamRequired("ObjectType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePatternObjectFilterConfiguration(v *types.PatternObjectFilterConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PatternObjectFilterConfiguration"} + if v.Filters == nil { + invalidParams.Add(smithy.NewErrParamRequired("Filters")) + } else if v.Filters != nil { + if err := validatePatternObjectFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePatternObjectFilterList(v []types.PatternObjectFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PatternObjectFilterList"} + for i := range v { + if err := validatePatternObjectFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePineconeConfiguration(v *types.PineconeConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PineconeConfiguration"} + if v.ConnectionString == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectionString")) + } + if v.CredentialsSecretArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) + } + if v.FieldMapping == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldMapping")) + } else if v.FieldMapping != nil { + if err := validatePineconeFieldMapping(v.FieldMapping); err != nil { + invalidParams.AddNested("FieldMapping", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePineconeFieldMapping(v *types.PineconeFieldMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PineconeFieldMapping"} + if v.TextField == nil { + invalidParams.Add(smithy.NewErrParamRequired("TextField")) + } + if v.MetadataField == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetadataField")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePromptFlowNodeConfiguration(v *types.PromptFlowNodeConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PromptFlowNodeConfiguration"} + if v.SourceConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceConfiguration")) + } else if v.SourceConfiguration != nil { + if err := validatePromptFlowNodeSourceConfiguration(v.SourceConfiguration); err != nil { + invalidParams.AddNested("SourceConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePromptFlowNodeInlineConfiguration(v *types.PromptFlowNodeInlineConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PromptFlowNodeInlineConfiguration"} + if len(v.TemplateType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("TemplateType")) + } + if v.TemplateConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateConfiguration")) + } else if v.TemplateConfiguration != nil { + if err := validatePromptTemplateConfiguration(v.TemplateConfiguration); err != nil { + invalidParams.AddNested("TemplateConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.ModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePromptFlowNodeResourceConfiguration(v *types.PromptFlowNodeResourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PromptFlowNodeResourceConfiguration"} + if v.PromptArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("PromptArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePromptFlowNodeSourceConfiguration(v types.PromptFlowNodeSourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PromptFlowNodeSourceConfiguration"} + switch uv := v.(type) { + case *types.PromptFlowNodeSourceConfigurationMemberInline: + if err := validatePromptFlowNodeInlineConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[inline]", err.(smithy.InvalidParamsError)) + } + + case *types.PromptFlowNodeSourceConfigurationMemberResource: + if err := validatePromptFlowNodeResourceConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[resource]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePromptOverrideConfiguration(v *types.PromptOverrideConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PromptOverrideConfiguration"} + if v.PromptConfigurations == nil { + invalidParams.Add(smithy.NewErrParamRequired("PromptConfigurations")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePromptTemplateConfiguration(v types.PromptTemplateConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PromptTemplateConfiguration"} + switch uv := v.(type) { + case *types.PromptTemplateConfigurationMemberText: + if err := validateTextPromptTemplateConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[text]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePromptVariant(v *types.PromptVariant) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PromptVariant"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.TemplateType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("TemplateType")) + } + if v.TemplateConfiguration != nil { + if err := validatePromptTemplateConfiguration(v.TemplateConfiguration); err != nil { + invalidParams.AddNested("TemplateConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePromptVariantList(v []types.PromptVariant) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PromptVariantList"} + for i := range v { + if err := validatePromptVariant(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRdsConfiguration(v *types.RdsConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RdsConfiguration"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.CredentialsSecretArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) + } + if v.DatabaseName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DatabaseName")) + } + if v.TableName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TableName")) + } + if v.FieldMapping == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldMapping")) + } else if v.FieldMapping != nil { + if err := validateRdsFieldMapping(v.FieldMapping); err != nil { + invalidParams.AddNested("FieldMapping", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRdsFieldMapping(v *types.RdsFieldMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RdsFieldMapping"} + if v.PrimaryKeyField == nil { + invalidParams.Add(smithy.NewErrParamRequired("PrimaryKeyField")) + } + if v.VectorField == nil { + invalidParams.Add(smithy.NewErrParamRequired("VectorField")) + } + if v.TextField == nil { + invalidParams.Add(smithy.NewErrParamRequired("TextField")) + } + if v.MetadataField == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetadataField")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRedisEnterpriseCloudConfiguration(v *types.RedisEnterpriseCloudConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RedisEnterpriseCloudConfiguration"} + if v.Endpoint == nil { + invalidParams.Add(smithy.NewErrParamRequired("Endpoint")) + } + if v.VectorIndexName == nil { + invalidParams.Add(smithy.NewErrParamRequired("VectorIndexName")) + } + if v.CredentialsSecretArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) + } + if v.FieldMapping == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldMapping")) + } else if v.FieldMapping != nil { + if err := validateRedisEnterpriseCloudFieldMapping(v.FieldMapping); err != nil { + invalidParams.AddNested("FieldMapping", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRedisEnterpriseCloudFieldMapping(v *types.RedisEnterpriseCloudFieldMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RedisEnterpriseCloudFieldMapping"} + if v.VectorField == nil { + invalidParams.Add(smithy.NewErrParamRequired("VectorField")) } if v.TextField == nil { invalidParams.Add(smithy.NewErrParamRequired("TextField")) } - if v.MetadataField == nil { - invalidParams.Add(smithy.NewErrParamRequired("MetadataField")) + if v.MetadataField == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetadataField")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRetrievalFlowNodeConfiguration(v *types.RetrievalFlowNodeConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RetrievalFlowNodeConfiguration"} + if v.ServiceConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceConfiguration")) + } else if v.ServiceConfiguration != nil { + if err := validateRetrievalFlowNodeServiceConfiguration(v.ServiceConfiguration); err != nil { + invalidParams.AddNested("ServiceConfiguration", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -1213,13 +2776,13 @@ func validateOpenSearchServerlessFieldMapping(v *types.OpenSearchServerlessField } } -func validateParameterDetail(v *types.ParameterDetail) error { +func validateRetrievalFlowNodeS3Configuration(v *types.RetrievalFlowNodeS3Configuration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "ParameterDetail"} - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) + invalidParams := smithy.InvalidParamsError{Context: "RetrievalFlowNodeS3Configuration"} + if v.BucketName == nil { + invalidParams.Add(smithy.NewErrParamRequired("BucketName")) } if invalidParams.Len() > 0 { return invalidParams @@ -1228,16 +2791,17 @@ func validateParameterDetail(v *types.ParameterDetail) error { } } -func validateParameterMap(v map[string]types.ParameterDetail) error { +func validateRetrievalFlowNodeServiceConfiguration(v types.RetrievalFlowNodeServiceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "ParameterMap"} - for key := range v { - value := v[key] - if err := validateParameterDetail(&value); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "RetrievalFlowNodeServiceConfiguration"} + switch uv := v.(type) { + case *types.RetrievalFlowNodeServiceConfigurationMemberS3: + if err := validateRetrievalFlowNodeS3Configuration(&uv.Value); err != nil { + invalidParams.AddNested("[s3]", err.(smithy.InvalidParamsError)) } + } if invalidParams.Len() > 0 { return invalidParams @@ -1246,23 +2810,13 @@ func validateParameterMap(v map[string]types.ParameterDetail) error { } } -func validatePineconeConfiguration(v *types.PineconeConfiguration) error { +func validateS3DataSourceConfiguration(v *types.S3DataSourceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "PineconeConfiguration"} - if v.ConnectionString == nil { - invalidParams.Add(smithy.NewErrParamRequired("ConnectionString")) - } - if v.CredentialsSecretArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) - } - if v.FieldMapping == nil { - invalidParams.Add(smithy.NewErrParamRequired("FieldMapping")) - } else if v.FieldMapping != nil { - if err := validatePineconeFieldMapping(v.FieldMapping); err != nil { - invalidParams.AddNested("FieldMapping", err.(smithy.InvalidParamsError)) - } + invalidParams := smithy.InvalidParamsError{Context: "S3DataSourceConfiguration"} + if v.BucketArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("BucketArn")) } if invalidParams.Len() > 0 { return invalidParams @@ -1271,16 +2825,13 @@ func validatePineconeConfiguration(v *types.PineconeConfiguration) error { } } -func validatePineconeFieldMapping(v *types.PineconeFieldMapping) error { +func validateS3Location(v *types.S3Location) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "PineconeFieldMapping"} - if v.TextField == nil { - invalidParams.Add(smithy.NewErrParamRequired("TextField")) - } - if v.MetadataField == nil { - invalidParams.Add(smithy.NewErrParamRequired("MetadataField")) + invalidParams := smithy.InvalidParamsError{Context: "S3Location"} + if v.Uri == nil { + invalidParams.Add(smithy.NewErrParamRequired("Uri")) } if invalidParams.Len() > 0 { return invalidParams @@ -1289,13 +2840,15 @@ func validatePineconeFieldMapping(v *types.PineconeFieldMapping) error { } } -func validatePromptOverrideConfiguration(v *types.PromptOverrideConfiguration) error { +func validateSalesforceCrawlerConfiguration(v *types.SalesforceCrawlerConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "PromptOverrideConfiguration"} - if v.PromptConfigurations == nil { - invalidParams.Add(smithy.NewErrParamRequired("PromptConfigurations")) + invalidParams := smithy.InvalidParamsError{Context: "SalesforceCrawlerConfiguration"} + if v.FilterConfiguration != nil { + if err := validateCrawlFilterConfiguration(v.FilterConfiguration); err != nil { + invalidParams.AddNested("FilterConfiguration", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -1304,28 +2857,21 @@ func validatePromptOverrideConfiguration(v *types.PromptOverrideConfiguration) e } } -func validateRdsConfiguration(v *types.RdsConfiguration) error { +func validateSalesforceDataSourceConfiguration(v *types.SalesforceDataSourceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "RdsConfiguration"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if v.CredentialsSecretArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) - } - if v.DatabaseName == nil { - invalidParams.Add(smithy.NewErrParamRequired("DatabaseName")) - } - if v.TableName == nil { - invalidParams.Add(smithy.NewErrParamRequired("TableName")) + invalidParams := smithy.InvalidParamsError{Context: "SalesforceDataSourceConfiguration"} + if v.SourceConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceConfiguration")) + } else if v.SourceConfiguration != nil { + if err := validateSalesforceSourceConfiguration(v.SourceConfiguration); err != nil { + invalidParams.AddNested("SourceConfiguration", err.(smithy.InvalidParamsError)) + } } - if v.FieldMapping == nil { - invalidParams.Add(smithy.NewErrParamRequired("FieldMapping")) - } else if v.FieldMapping != nil { - if err := validateRdsFieldMapping(v.FieldMapping); err != nil { - invalidParams.AddNested("FieldMapping", err.(smithy.InvalidParamsError)) + if v.CrawlerConfiguration != nil { + if err := validateSalesforceCrawlerConfiguration(v.CrawlerConfiguration); err != nil { + invalidParams.AddNested("CrawlerConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -1335,22 +2881,19 @@ func validateRdsConfiguration(v *types.RdsConfiguration) error { } } -func validateRdsFieldMapping(v *types.RdsFieldMapping) error { +func validateSalesforceSourceConfiguration(v *types.SalesforceSourceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "RdsFieldMapping"} - if v.PrimaryKeyField == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrimaryKeyField")) - } - if v.VectorField == nil { - invalidParams.Add(smithy.NewErrParamRequired("VectorField")) + invalidParams := smithy.InvalidParamsError{Context: "SalesforceSourceConfiguration"} + if v.HostUrl == nil { + invalidParams.Add(smithy.NewErrParamRequired("HostUrl")) } - if v.TextField == nil { - invalidParams.Add(smithy.NewErrParamRequired("TextField")) + if len(v.AuthType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AuthType")) } - if v.MetadataField == nil { - invalidParams.Add(smithy.NewErrParamRequired("MetadataField")) + if v.CredentialsSecretArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) } if invalidParams.Len() > 0 { return invalidParams @@ -1359,25 +2902,35 @@ func validateRdsFieldMapping(v *types.RdsFieldMapping) error { } } -func validateRedisEnterpriseCloudConfiguration(v *types.RedisEnterpriseCloudConfiguration) error { +func validateSemanticChunkingConfiguration(v *types.SemanticChunkingConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "RedisEnterpriseCloudConfiguration"} - if v.Endpoint == nil { - invalidParams.Add(smithy.NewErrParamRequired("Endpoint")) + invalidParams := smithy.InvalidParamsError{Context: "SemanticChunkingConfiguration"} + if v.MaxTokens == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxTokens")) } - if v.VectorIndexName == nil { - invalidParams.Add(smithy.NewErrParamRequired("VectorIndexName")) + if v.BufferSize == nil { + invalidParams.Add(smithy.NewErrParamRequired("BufferSize")) } - if v.CredentialsSecretArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) + if v.BreakpointPercentileThreshold == nil { + invalidParams.Add(smithy.NewErrParamRequired("BreakpointPercentileThreshold")) } - if v.FieldMapping == nil { - invalidParams.Add(smithy.NewErrParamRequired("FieldMapping")) - } else if v.FieldMapping != nil { - if err := validateRedisEnterpriseCloudFieldMapping(v.FieldMapping); err != nil { - invalidParams.AddNested("FieldMapping", err.(smithy.InvalidParamsError)) + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSharePointCrawlerConfiguration(v *types.SharePointCrawlerConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SharePointCrawlerConfiguration"} + if v.FilterConfiguration != nil { + if err := validateCrawlFilterConfiguration(v.FilterConfiguration); err != nil { + invalidParams.AddNested("FilterConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -1387,19 +2940,22 @@ func validateRedisEnterpriseCloudConfiguration(v *types.RedisEnterpriseCloudConf } } -func validateRedisEnterpriseCloudFieldMapping(v *types.RedisEnterpriseCloudFieldMapping) error { +func validateSharePointDataSourceConfiguration(v *types.SharePointDataSourceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "RedisEnterpriseCloudFieldMapping"} - if v.VectorField == nil { - invalidParams.Add(smithy.NewErrParamRequired("VectorField")) - } - if v.TextField == nil { - invalidParams.Add(smithy.NewErrParamRequired("TextField")) + invalidParams := smithy.InvalidParamsError{Context: "SharePointDataSourceConfiguration"} + if v.SourceConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceConfiguration")) + } else if v.SourceConfiguration != nil { + if err := validateSharePointSourceConfiguration(v.SourceConfiguration); err != nil { + invalidParams.AddNested("SourceConfiguration", err.(smithy.InvalidParamsError)) + } } - if v.MetadataField == nil { - invalidParams.Add(smithy.NewErrParamRequired("MetadataField")) + if v.CrawlerConfiguration != nil { + if err := validateSharePointCrawlerConfiguration(v.CrawlerConfiguration); err != nil { + invalidParams.AddNested("CrawlerConfiguration", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -1408,13 +2964,25 @@ func validateRedisEnterpriseCloudFieldMapping(v *types.RedisEnterpriseCloudField } } -func validateS3DataSourceConfiguration(v *types.S3DataSourceConfiguration) error { +func validateSharePointSourceConfiguration(v *types.SharePointSourceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "S3DataSourceConfiguration"} - if v.BucketArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("BucketArn")) + invalidParams := smithy.InvalidParamsError{Context: "SharePointSourceConfiguration"} + if v.Domain == nil { + invalidParams.Add(smithy.NewErrParamRequired("Domain")) + } + if v.SiteUrls == nil { + invalidParams.Add(smithy.NewErrParamRequired("SiteUrls")) + } + if len(v.HostType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("HostType")) + } + if len(v.AuthType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AuthType")) + } + if v.CredentialsSecretArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) } if invalidParams.Len() > 0 { return invalidParams @@ -1463,14 +3031,199 @@ func validateStorageConfiguration(v *types.StorageConfiguration) error { } } -func validateVectorIngestionConfiguration(v *types.VectorIngestionConfiguration) error { +func validateStorageFlowNodeConfiguration(v *types.StorageFlowNodeConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StorageFlowNodeConfiguration"} + if v.ServiceConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceConfiguration")) + } else if v.ServiceConfiguration != nil { + if err := validateStorageFlowNodeServiceConfiguration(v.ServiceConfiguration); err != nil { + invalidParams.AddNested("ServiceConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStorageFlowNodeS3Configuration(v *types.StorageFlowNodeS3Configuration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StorageFlowNodeS3Configuration"} + if v.BucketName == nil { + invalidParams.Add(smithy.NewErrParamRequired("BucketName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStorageFlowNodeServiceConfiguration(v types.StorageFlowNodeServiceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StorageFlowNodeServiceConfiguration"} + switch uv := v.(type) { + case *types.StorageFlowNodeServiceConfigurationMemberS3: + if err := validateStorageFlowNodeS3Configuration(&uv.Value); err != nil { + invalidParams.AddNested("[s3]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTextPromptTemplateConfiguration(v *types.TextPromptTemplateConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TextPromptTemplateConfiguration"} + if v.Text == nil { + invalidParams.Add(smithy.NewErrParamRequired("Text")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTransformation(v *types.Transformation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Transformation"} + if v.TransformationFunction == nil { + invalidParams.Add(smithy.NewErrParamRequired("TransformationFunction")) + } else if v.TransformationFunction != nil { + if err := validateTransformationFunction(v.TransformationFunction); err != nil { + invalidParams.AddNested("TransformationFunction", err.(smithy.InvalidParamsError)) + } + } + if len(v.StepToApply) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("StepToApply")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTransformationFunction(v *types.TransformationFunction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TransformationFunction"} + if v.TransformationLambdaConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("TransformationLambdaConfiguration")) + } else if v.TransformationLambdaConfiguration != nil { + if err := validateTransformationLambdaConfiguration(v.TransformationLambdaConfiguration); err != nil { + invalidParams.AddNested("TransformationLambdaConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTransformationLambdaConfiguration(v *types.TransformationLambdaConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TransformationLambdaConfiguration"} + if v.LambdaArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("LambdaArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTransformations(v []types.Transformation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Transformations"} + for i := range v { + if err := validateTransformation(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateVectorIngestionConfiguration(v *types.VectorIngestionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VectorIngestionConfiguration"} + if v.ChunkingConfiguration != nil { + if err := validateChunkingConfiguration(v.ChunkingConfiguration); err != nil { + invalidParams.AddNested("ChunkingConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.CustomTransformationConfiguration != nil { + if err := validateCustomTransformationConfiguration(v.CustomTransformationConfiguration); err != nil { + invalidParams.AddNested("CustomTransformationConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.ParsingConfiguration != nil { + if err := validateParsingConfiguration(v.ParsingConfiguration); err != nil { + invalidParams.AddNested("ParsingConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateVectorKnowledgeBaseConfiguration(v *types.VectorKnowledgeBaseConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VectorKnowledgeBaseConfiguration"} + if v.EmbeddingModelArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("EmbeddingModelArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWebDataSourceConfiguration(v *types.WebDataSourceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "VectorIngestionConfiguration"} - if v.ChunkingConfiguration != nil { - if err := validateChunkingConfiguration(v.ChunkingConfiguration); err != nil { - invalidParams.AddNested("ChunkingConfiguration", err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "WebDataSourceConfiguration"} + if v.SourceConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceConfiguration")) + } else if v.SourceConfiguration != nil { + if err := validateWebSourceConfiguration(v.SourceConfiguration); err != nil { + invalidParams.AddNested("SourceConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -1480,13 +3233,13 @@ func validateVectorIngestionConfiguration(v *types.VectorIngestionConfiguration) } } -func validateVectorKnowledgeBaseConfiguration(v *types.VectorKnowledgeBaseConfiguration) error { +func validateWebSourceConfiguration(v *types.WebSourceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "VectorKnowledgeBaseConfiguration"} - if v.EmbeddingModelArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("EmbeddingModelArn")) + invalidParams := smithy.InvalidParamsError{Context: "WebSourceConfiguration"} + if v.UrlConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("UrlConfiguration")) } if invalidParams.Len() > 0 { return invalidParams @@ -1576,6 +3329,11 @@ func validateOpCreateAgentInput(v *CreateAgentInput) error { invalidParams.AddNested("PromptOverrideConfiguration", err.(smithy.InvalidParamsError)) } } + if v.MemoryConfiguration != nil { + if err := validateMemoryConfiguration(v.MemoryConfiguration); err != nil { + invalidParams.AddNested("MemoryConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1613,6 +3371,65 @@ func validateOpCreateDataSourceInput(v *CreateDataSourceInput) error { } } +func validateOpCreateFlowAliasInput(v *CreateFlowAliasInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateFlowAliasInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.RoutingConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoutingConfiguration")) + } + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateFlowInput(v *CreateFlowInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateFlowInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.ExecutionRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExecutionRoleArn")) + } + if v.Definition != nil { + if err := validateFlowDefinition(v.Definition); err != nil { + invalidParams.AddNested("Definition", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateFlowVersionInput(v *CreateFlowVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateFlowVersionInput"} + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput) error { if v == nil { return nil @@ -1645,6 +3462,41 @@ func validateOpCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput) error { } } +func validateOpCreatePromptInput(v *CreatePromptInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreatePromptInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Variants != nil { + if err := validatePromptVariantList(v.Variants); err != nil { + invalidParams.AddNested("Variants", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreatePromptVersionInput(v *CreatePromptVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreatePromptVersionInput"} + if v.PromptIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("PromptIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteAgentActionGroupInput(v *DeleteAgentActionGroupInput) error { if v == nil { return nil @@ -1735,6 +3587,57 @@ func validateOpDeleteDataSourceInput(v *DeleteDataSourceInput) error { } } +func validateOpDeleteFlowAliasInput(v *DeleteFlowAliasInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteFlowAliasInput"} + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if v.AliasIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("AliasIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteFlowInput(v *DeleteFlowInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteFlowInput"} + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteFlowVersionInput(v *DeleteFlowVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteFlowVersionInput"} + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if v.FlowVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteKnowledgeBaseInput(v *DeleteKnowledgeBaseInput) error { if v == nil { return nil @@ -1750,6 +3653,21 @@ func validateOpDeleteKnowledgeBaseInput(v *DeleteKnowledgeBaseInput) error { } } +func validateOpDeletePromptInput(v *DeletePromptInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeletePromptInput"} + if v.PromptIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("PromptIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDisassociateAgentKnowledgeBaseInput(v *DisassociateAgentKnowledgeBaseInput) error { if v == nil { return nil @@ -1882,6 +3800,57 @@ func validateOpGetDataSourceInput(v *GetDataSourceInput) error { } } +func validateOpGetFlowAliasInput(v *GetFlowAliasInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetFlowAliasInput"} + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if v.AliasIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("AliasIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetFlowInput(v *GetFlowInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetFlowInput"} + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetFlowVersionInput(v *GetFlowVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetFlowVersionInput"} + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if v.FlowVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetIngestionJobInput(v *GetIngestionJobInput) error { if v == nil { return nil @@ -1918,6 +3887,21 @@ func validateOpGetKnowledgeBaseInput(v *GetKnowledgeBaseInput) error { } } +func validateOpGetPromptInput(v *GetPromptInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetPromptInput"} + if v.PromptIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("PromptIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListAgentActionGroupsInput(v *ListAgentActionGroupsInput) error { if v == nil { return nil @@ -1999,6 +3983,36 @@ func validateOpListDataSourcesInput(v *ListDataSourcesInput) error { } } +func validateOpListFlowAliasesInput(v *ListFlowAliasesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListFlowAliasesInput"} + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListFlowVersionsInput(v *ListFlowVersionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListFlowVersionsInput"} + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListIngestionJobsInput(v *ListIngestionJobsInput) error { if v == nil { return nil @@ -2057,6 +4071,21 @@ func validateOpPrepareAgentInput(v *PrepareAgentInput) error { } } +func validateOpPrepareFlowInput(v *PrepareFlowInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PrepareFlowInput"} + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartIngestionJobInput(v *StartIngestionJobInput) error { if v == nil { return nil @@ -2183,6 +4212,11 @@ func validateOpUpdateAgentInput(v *UpdateAgentInput) error { invalidParams.AddNested("PromptOverrideConfiguration", err.(smithy.InvalidParamsError)) } } + if v.MemoryConfiguration != nil { + if err := validateMemoryConfiguration(v.MemoryConfiguration); err != nil { + invalidParams.AddNested("MemoryConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2244,6 +4278,56 @@ func validateOpUpdateDataSourceInput(v *UpdateDataSourceInput) error { } } +func validateOpUpdateFlowAliasInput(v *UpdateFlowAliasInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateFlowAliasInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.RoutingConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoutingConfiguration")) + } + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if v.AliasIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("AliasIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateFlowInput(v *UpdateFlowInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateFlowInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.ExecutionRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExecutionRoleArn")) + } + if v.Definition != nil { + if err := validateFlowDefinition(v.Definition); err != nil { + invalidParams.AddNested("Definition", err.(smithy.InvalidParamsError)) + } + } + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateKnowledgeBaseInput(v *UpdateKnowledgeBaseInput) error { if v == nil { return nil @@ -2278,3 +4362,26 @@ func validateOpUpdateKnowledgeBaseInput(v *UpdateKnowledgeBaseInput) error { return nil } } + +func validateOpUpdatePromptInput(v *UpdatePromptInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePromptInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Variants != nil { + if err := validatePromptVariantList(v.Variants); err != nil { + invalidParams.AddNested("Variants", err.(smithy.InvalidParamsError)) + } + } + if v.PromptIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("PromptIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/bedrockagentruntime/api_op_DeleteAgentMemory.go b/service/bedrockagentruntime/api_op_DeleteAgentMemory.go new file mode 100644 index 00000000000..842662a40b7 --- /dev/null +++ b/service/bedrockagentruntime/api_op_DeleteAgentMemory.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagentruntime + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes memory from the specified memory identifier. +func (c *Client) DeleteAgentMemory(ctx context.Context, params *DeleteAgentMemoryInput, optFns ...func(*Options)) (*DeleteAgentMemoryOutput, error) { + if params == nil { + params = &DeleteAgentMemoryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAgentMemory", params, optFns, c.addOperationDeleteAgentMemoryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAgentMemoryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAgentMemoryInput struct { + + // The unique identifier of an alias of an agent. + // + // This member is required. + AgentAliasId *string + + // The unique identifier of the agent to which the alias belongs. + // + // This member is required. + AgentId *string + + // The unique identifier of the memory. + MemoryId *string + + noSmithyDocumentSerde +} + +type DeleteAgentMemoryOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAgentMemoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAgentMemory{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAgentMemory{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAgentMemory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteAgentMemoryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAgentMemory(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAgentMemory(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteAgentMemory", + } +} diff --git a/service/bedrockagentruntime/api_op_GetAgentMemory.go b/service/bedrockagentruntime/api_op_GetAgentMemory.go new file mode 100644 index 00000000000..3631036bd04 --- /dev/null +++ b/service/bedrockagentruntime/api_op_GetAgentMemory.go @@ -0,0 +1,269 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagentruntime + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagentruntime/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the sessions stored in the memory of the agent. +func (c *Client) GetAgentMemory(ctx context.Context, params *GetAgentMemoryInput, optFns ...func(*Options)) (*GetAgentMemoryOutput, error) { + if params == nil { + params = &GetAgentMemoryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAgentMemory", params, optFns, c.addOperationGetAgentMemoryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAgentMemoryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAgentMemoryInput struct { + + // The unique identifier of an alias of an agent. + // + // This member is required. + AgentAliasId *string + + // The unique identifier of the agent to which the alias belongs. + // + // This member is required. + AgentId *string + + // The unique identifier of the memory. + // + // This member is required. + MemoryId *string + + // The type of memory. + // + // This member is required. + MemoryType types.MemoryType + + // The maximum number of items to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + MaxItems *int32 + + // If the total number of results is greater than the maxItems value provided in + // the request, enter the token returned in the nextToken field in the response in + // this field to return the next batch of results. + NextToken *string + + noSmithyDocumentSerde +} + +type GetAgentMemoryOutput struct { + + // Contains details of the sessions stored in the memory + MemoryContents []types.Memory + + // If the total number of results is greater than the maxItems value provided in + // the request, use this token when making another request in the nextToken field + // to return the next batch of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAgentMemoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAgentMemory{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAgentMemory{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAgentMemory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetAgentMemoryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAgentMemory(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// GetAgentMemoryPaginatorOptions is the paginator options for GetAgentMemory +type GetAgentMemoryPaginatorOptions struct { + // The maximum number of items to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// GetAgentMemoryPaginator is a paginator for GetAgentMemory +type GetAgentMemoryPaginator struct { + options GetAgentMemoryPaginatorOptions + client GetAgentMemoryAPIClient + params *GetAgentMemoryInput + nextToken *string + firstPage bool +} + +// NewGetAgentMemoryPaginator returns a new GetAgentMemoryPaginator +func NewGetAgentMemoryPaginator(client GetAgentMemoryAPIClient, params *GetAgentMemoryInput, optFns ...func(*GetAgentMemoryPaginatorOptions)) *GetAgentMemoryPaginator { + if params == nil { + params = &GetAgentMemoryInput{} + } + + options := GetAgentMemoryPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetAgentMemoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetAgentMemoryPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetAgentMemory page. +func (p *GetAgentMemoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAgentMemoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.GetAgentMemory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// GetAgentMemoryAPIClient is a client that implements the GetAgentMemory +// operation. +type GetAgentMemoryAPIClient interface { + GetAgentMemory(context.Context, *GetAgentMemoryInput, ...func(*Options)) (*GetAgentMemoryOutput, error) +} + +var _ GetAgentMemoryAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opGetAgentMemory(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetAgentMemory", + } +} diff --git a/service/bedrockagentruntime/api_op_InvokeAgent.go b/service/bedrockagentruntime/api_op_InvokeAgent.go index 42dd8c8b4ff..f03e487adc8 100644 --- a/service/bedrockagentruntime/api_op_InvokeAgent.go +++ b/service/bedrockagentruntime/api_op_InvokeAgent.go @@ -12,7 +12,8 @@ import ( "sync" ) -// The CLI doesn't support InvokeAgent . +// The CLI doesn't support streaming operations in Amazon Bedrock, including +// InvokeAgent . // // Sends a prompt for the agent to process and respond to. Note the following // fields for the request: @@ -93,6 +94,9 @@ type InvokeAgentInput struct { // inputText field will be ignored. InputText *string + // The unique identifier of the agent memory. + MemoryId *string + // Contains parameters that specify various attributes of the session. For more // information, see [Control session context]. // @@ -118,6 +122,9 @@ type InvokeAgentOutput struct { // This member is required. SessionId *string + // The unique identifier of the agent memory. + MemoryId *string + eventStream *InvokeAgentEventStream // Metadata pertaining to the operation's result. diff --git a/service/bedrockagentruntime/api_op_InvokeFlow.go b/service/bedrockagentruntime/api_op_InvokeFlow.go new file mode 100644 index 00000000000..a4a1a0278af --- /dev/null +++ b/service/bedrockagentruntime/api_op_InvokeFlow.go @@ -0,0 +1,257 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagentruntime + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockagentruntime/types" + "github.com/aws/smithy-go/middleware" + smithysync "github.com/aws/smithy-go/sync" + "sync" +) + +// Invokes an alias of a flow to run the inputs that you specify and return the +// output of each node as a stream. If there's an error, the error is returned. For +// more information, see [Test a flow in Amazon Bedrock]in the Amazon Bedrock User Guide. +// +// [Test a flow in Amazon Bedrock]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-test.html +func (c *Client) InvokeFlow(ctx context.Context, params *InvokeFlowInput, optFns ...func(*Options)) (*InvokeFlowOutput, error) { + if params == nil { + params = &InvokeFlowInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "InvokeFlow", params, optFns, c.addOperationInvokeFlowMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*InvokeFlowOutput) + out.ResultMetadata = metadata + return out, nil +} + +type InvokeFlowInput struct { + + // The unique identifier of the flow alias. + // + // This member is required. + FlowAliasIdentifier *string + + // The unique identifier of the flow. + // + // This member is required. + FlowIdentifier *string + + // A list of objects, each containing information about an input into the flow. + // + // This member is required. + Inputs []types.FlowInput + + noSmithyDocumentSerde +} + +type InvokeFlowOutput struct { + eventStream *InvokeFlowEventStream + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +// GetStream returns the type to interact with the event stream. +func (o *InvokeFlowOutput) GetStream() *InvokeFlowEventStream { + return o.eventStream +} + +func (c *Client) addOperationInvokeFlowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpInvokeFlow{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpInvokeFlow{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "InvokeFlow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addEventStreamInvokeFlowMiddleware(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpInvokeFlowValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInvokeFlow(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opInvokeFlow(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "InvokeFlow", + } +} + +// InvokeFlowEventStream provides the event stream handling for the InvokeFlow operation. +// +// For testing and mocking the event stream this type should be initialized via +// the NewInvokeFlowEventStream constructor function. Using the functional options +// to pass in nested mock behavior. +type InvokeFlowEventStream struct { + // FlowResponseStreamReader is the EventStream reader for the FlowResponseStream + // 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 FlowResponseStreamReader + + done chan struct{} + closeOnce sync.Once + err *smithysync.OnceErr +} + +// NewInvokeFlowEventStream initializes an InvokeFlowEventStream. +// This function should only be used for testing and mocking the InvokeFlowEventStream +// stream within your application. +// +// The Reader member must be set before reading events from the stream. +func NewInvokeFlowEventStream(optFns ...func(*InvokeFlowEventStream)) *InvokeFlowEventStream { + es := &InvokeFlowEventStream{ + done: make(chan struct{}), + err: smithysync.NewOnceErr(), + } + for _, fn := range optFns { + fn(es) + } + return es +} + +// Events returns a channel to read events from. +func (es *InvokeFlowEventStream) Events() <-chan types.FlowResponseStream { + return es.Reader.Events() +} + +// Close closes the stream. This will also cause the stream to be closed. +// Close must be called when done using the stream API. Not calling Close +// may result in resource leaks. +// +// Will close the underlying EventStream writer and reader, and no more events can be +// sent or received. +func (es *InvokeFlowEventStream) Close() error { + es.closeOnce.Do(es.safeClose) + return es.Err() +} + +func (es *InvokeFlowEventStream) safeClose() { + close(es.done) + + es.Reader.Close() +} + +// Err returns any error that occurred while reading or writing EventStream Events +// from the service API's response. Returns nil if there were no errors. +func (es *InvokeFlowEventStream) Err() error { + if err := es.err.Err(); err != nil { + return err + } + + if err := es.Reader.Err(); err != nil { + return err + } + + return nil +} + +func (es *InvokeFlowEventStream) waitStreamClose() { + type errorSet interface { + ErrorSet() <-chan struct{} + } + + var outputErrCh <-chan struct{} + if v, ok := es.Reader.(errorSet); ok { + outputErrCh = v.ErrorSet() + } + var outputClosedCh <-chan struct{} + if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok { + outputClosedCh = v.Closed() + } + + select { + case <-es.done: + case <-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() + + } +} diff --git a/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go b/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go index 71dfd171e93..d9737130f50 100644 --- a/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go +++ b/service/bedrockagentruntime/api_op_RetrieveAndGenerate.go @@ -44,8 +44,11 @@ type RetrieveAndGenerateInput struct { // Contains details about the session with the knowledge base. SessionConfiguration *types.RetrieveAndGenerateSessionConfiguration - // The unique identifier of the session. Reuse the same value to continue the same - // session with the knowledge base. + // The unique identifier of the session. When you first make a RetrieveAndGenerate + // request, Amazon Bedrock automatically generates this value. You must reuse this + // value for all subsequent requests in the same conversational session. This value + // allows Amazon Bedrock to maintain context and knowledge from previous + // interactions. You can't explicitly set the sessionId yourself. SessionId *string noSmithyDocumentSerde @@ -58,8 +61,11 @@ type RetrieveAndGenerateOutput struct { // This member is required. Output *types.RetrieveAndGenerateOutput - // The unique identifier of the session. Reuse the same value to continue the same - // session with the knowledge base. + // The unique identifier of the session. When you first make a RetrieveAndGenerate + // request, Amazon Bedrock automatically generates this value. You must reuse this + // value for all subsequent requests in the same conversational session. This value + // allows Amazon Bedrock to maintain context and knowledge from previous + // interactions. You can't explicitly set the sessionId yourself. // // This member is required. SessionId *string diff --git a/service/bedrockagentruntime/deserializers.go b/service/bedrockagentruntime/deserializers.go index d3a75ca351d..e27857dcf48 100644 --- a/service/bedrockagentruntime/deserializers.go +++ b/service/bedrockagentruntime/deserializers.go @@ -34,14 +34,14 @@ func deserializeS3Expires(v string) (*time.Time, error) { return &t, nil } -type awsRestjson1_deserializeOpInvokeAgent struct { +type awsRestjson1_deserializeOpDeleteAgentMemory struct { } -func (*awsRestjson1_deserializeOpInvokeAgent) ID() string { +func (*awsRestjson1_deserializeOpDeleteAgentMemory) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpInvokeAgent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAgentMemory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -55,20 +55,15 @@ func (m *awsRestjson1_deserializeOpInvokeAgent) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorInvokeAgent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAgentMemory(response, &metadata) } - output := &InvokeAgentOutput{} + output := &DeleteAgentMemoryOutput{} out.Result = output - err = awsRestjson1_deserializeOpHttpBindingsInvokeAgentOutput(output, response) - if err != nil { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} - } - return out, metadata, err } -func awsRestjson1_deserializeOpErrorInvokeAgent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAgentMemory(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -146,32 +141,14 @@ func awsRestjson1_deserializeOpErrorInvokeAgent(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpHttpBindingsInvokeAgentOutput(v *InvokeAgentOutput, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) - } - - if headerValues := response.Header.Values("x-amzn-bedrock-agent-content-type"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - v.ContentType = ptr.String(headerValues[0]) - } - - if headerValues := response.Header.Values("x-amz-bedrock-agent-session-id"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - v.SessionId = ptr.String(headerValues[0]) - } - - return nil -} - -type awsRestjson1_deserializeOpRetrieve struct { +type awsRestjson1_deserializeOpGetAgentMemory struct { } -func (*awsRestjson1_deserializeOpRetrieve) ID() string { +func (*awsRestjson1_deserializeOpGetAgentMemory) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRetrieve) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAgentMemory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -185,9 +162,9 @@ func (m *awsRestjson1_deserializeOpRetrieve) HandleDeserialize(ctx context.Conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRetrieve(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAgentMemory(response, &metadata) } - output := &RetrieveOutput{} + output := &GetAgentMemoryOutput{} out.Result = output var buff [1024]byte @@ -208,7 +185,7 @@ func (m *awsRestjson1_deserializeOpRetrieve) HandleDeserialize(ctx context.Conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentRetrieveOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAgentMemoryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -221,7 +198,7 @@ func (m *awsRestjson1_deserializeOpRetrieve) HandleDeserialize(ctx context.Conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorRetrieve(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAgentMemory(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -299,7 +276,7 @@ func awsRestjson1_deserializeOpErrorRetrieve(response *smithyhttp.Response, meta } } -func awsRestjson1_deserializeOpDocumentRetrieveOutput(v **RetrieveOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAgentMemoryOutput(v **GetAgentMemoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -312,15 +289,20 @@ func awsRestjson1_deserializeOpDocumentRetrieveOutput(v **RetrieveOutput, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *RetrieveOutput + var sv *GetAgentMemoryOutput if *v == nil { - sv = &RetrieveOutput{} + sv = &GetAgentMemoryOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "memoryContents": + if err := awsRestjson1_deserializeDocumentMemories(&sv.MemoryContents, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -330,11 +312,6 @@ func awsRestjson1_deserializeOpDocumentRetrieveOutput(v **RetrieveOutput, value sv.NextToken = ptr.String(jtv) } - case "retrievalResults": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseRetrievalResults(&sv.RetrievalResults, value); err != nil { - return err - } - default: _, _ = key, value @@ -344,14 +321,14 @@ func awsRestjson1_deserializeOpDocumentRetrieveOutput(v **RetrieveOutput, value return nil } -type awsRestjson1_deserializeOpRetrieveAndGenerate struct { +type awsRestjson1_deserializeOpInvokeAgent struct { } -func (*awsRestjson1_deserializeOpRetrieveAndGenerate) ID() string { +func (*awsRestjson1_deserializeOpInvokeAgent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRetrieveAndGenerate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpInvokeAgent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -365,43 +342,20 @@ func (m *awsRestjson1_deserializeOpRetrieveAndGenerate) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRetrieveAndGenerate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorInvokeAgent(response, &metadata) } - output := &RetrieveAndGenerateOutput{} + output := &InvokeAgentOutput{} out.Result = output - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentRetrieveAndGenerateOutput(&output, shape) + err = awsRestjson1_deserializeOpHttpBindingsInvokeAgentOutput(output, response) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } return out, metadata, err } -func awsRestjson1_deserializeOpErrorRetrieveAndGenerate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorInvokeAgent(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -479,186 +433,167 @@ func awsRestjson1_deserializeOpErrorRetrieveAndGenerate(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentRetrieveAndGenerateOutput(v **RetrieveAndGenerateOutput, value interface{}) error { +func awsRestjson1_deserializeOpHttpBindingsInvokeAgentOutput(v *InvokeAgentOutput, response *smithyhttp.Response) error { if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil + return fmt.Errorf("unsupported deserialization for nil %T", v) } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) + if headerValues := response.Header.Values("x-amzn-bedrock-agent-content-type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = ptr.String(headerValues[0]) } - var sv *RetrieveAndGenerateOutput - if *v == nil { - sv = &RetrieveAndGenerateOutput{} - } else { - sv = *v + if headerValues := response.Header.Values("x-amz-bedrock-agent-memory-id"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.MemoryId = ptr.String(headerValues[0]) } - for key, value := range shape { - switch key { - case "citations": - if err := awsRestjson1_deserializeDocumentCitations(&sv.Citations, value); err != nil { - return err - } + if headerValues := response.Header.Values("x-amz-bedrock-agent-session-id"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.SessionId = ptr.String(headerValues[0]) + } - case "guardrailAction": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GuadrailAction to be of type string, got %T instead", value) - } - sv.GuardrailAction = types.GuadrailAction(jtv) - } + return nil +} - case "output": - if err := awsRestjson1_deserializeDocumentRetrieveAndGenerateOutput(&sv.Output, value); err != nil { - return err - } +type awsRestjson1_deserializeOpInvokeFlow struct { +} - case "sessionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SessionId to be of type string, got %T instead", value) - } - sv.SessionId = ptr.String(jtv) - } +func (*awsRestjson1_deserializeOpInvokeFlow) ID() string { + return "OperationDeserializer" +} - default: - _, _ = key, value +func (m *awsRestjson1_deserializeOpInvokeFlow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } - } + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } - *v = sv - return nil -} -func awsRestjson1_deserializeEventStreamResponseStream(v *types.ResponseStream, msg *eventstream.Message) error { - if v == nil { - return fmt.Errorf("unexpected serialization of nil %T", v) + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorInvokeFlow(response, &metadata) } + output := &InvokeFlowOutput{} + out.Result = output - eventType := msg.Headers.Get(eventstreamapi.EventTypeHeader) - if eventType == nil { - return fmt.Errorf("%s event header not present", eventstreamapi.EventTypeHeader) + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorInvokeFlow(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } + errorBody := bytes.NewReader(errorBuffer.Bytes()) - switch { - case strings.EqualFold("chunk", eventType.String()): - vv := &types.ResponseStreamMemberChunk{} - if err := awsRestjson1_deserializeEventMessagePayloadPart(&vv.Value, msg); err != nil { - return err - } - *v = vv - return nil + errorCode := "UnknownError" + errorMessage := errorCode - case strings.EqualFold("returnControl", eventType.String()): - vv := &types.ResponseStreamMemberReturnControl{} - if err := awsRestjson1_deserializeEventMessageReturnControlPayload(&vv.Value, msg); err != nil { - return err - } - *v = vv - return nil + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } - case strings.EqualFold("trace", eventType.String()): - vv := &types.ResponseStreamMemberTrace{} - if err := awsRestjson1_deserializeEventMessageTracePart(&vv.Value, msg); err != nil { - return err - } - *v = vv - return nil + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) - default: - buffer := bytes.NewBuffer(nil) - eventstream.NewEncoder().Encode(buffer, *msg) - *v = &types.UnknownUnionMember{ - Tag: eventType.String(), - Value: buffer.Bytes(), + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } - return nil - + return err } -} -func awsRestjson1_deserializeEventStreamExceptionResponseStream(msg *eventstream.Message) error { - exceptionType := msg.Headers.Get(eventstreamapi.ExceptionTypeHeader) - if exceptionType == nil { - return fmt.Errorf("%s event header not present", eventstreamapi.ExceptionTypeHeader) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message } switch { - case strings.EqualFold("accessDeniedException", exceptionType.String()): - return awsRestjson1_deserializeEventMessageExceptionAccessDeniedException(msg) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("badGatewayException", exceptionType.String()): - return awsRestjson1_deserializeEventMessageExceptionBadGatewayException(msg) + case strings.EqualFold("BadGatewayException", errorCode): + return awsRestjson1_deserializeErrorBadGatewayException(response, errorBody) - case strings.EqualFold("conflictException", exceptionType.String()): - return awsRestjson1_deserializeEventMessageExceptionConflictException(msg) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("dependencyFailedException", exceptionType.String()): - return awsRestjson1_deserializeEventMessageExceptionDependencyFailedException(msg) + case strings.EqualFold("DependencyFailedException", errorCode): + return awsRestjson1_deserializeErrorDependencyFailedException(response, errorBody) - case strings.EqualFold("internalServerException", exceptionType.String()): - return awsRestjson1_deserializeEventMessageExceptionInternalServerException(msg) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("resourceNotFoundException", exceptionType.String()): - return awsRestjson1_deserializeEventMessageExceptionResourceNotFoundException(msg) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("serviceQuotaExceededException", exceptionType.String()): - return awsRestjson1_deserializeEventMessageExceptionServiceQuotaExceededException(msg) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("throttlingException", exceptionType.String()): - return awsRestjson1_deserializeEventMessageExceptionThrottlingException(msg) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("validationException", exceptionType.String()): - return awsRestjson1_deserializeEventMessageExceptionValidationException(msg) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: - br := bytes.NewReader(msg.Payload) - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(br, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - return err - } - errorCode := "UnknownError" - errorMessage := errorCode - if ev := exceptionType.String(); len(ev) > 0 { - errorCode = ev - } else if ev := code; len(ev) > 0 { - errorCode = ev - } - if ev := message; len(ev) > 0 { - errorMessage = ev - } - return &smithy.GenericAPIError{ + genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } + return genericError } } -func awsRestjson1_deserializeEventMessagePayloadPart(v *types.PayloadPart, msg *eventstream.Message) error { - if v == nil { - return fmt.Errorf("unexpected serialization of nil %T", v) +type awsRestjson1_deserializeOpRetrieve struct { +} + +func (*awsRestjson1_deserializeOpRetrieve) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRetrieve) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err } - br := bytes.NewReader(msg.Payload) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorRetrieve(response, &metadata) + } + output := &RetrieveOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(br, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -669,38 +604,45 @@ func awsRestjson1_deserializeEventMessagePayloadPart(v *types.PayloadPart, msg * Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - if err := awsRestjson1_deserializeDocumentPayloadPart(&v, shape); err != nil { - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + err = awsRestjson1_deserializeOpDocumentRetrieveOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } - } - return nil + + return out, metadata, err } -func awsRestjson1_deserializeEventMessageTracePart(v *types.TracePart, msg *eventstream.Message) error { - if v == nil { - return fmt.Errorf("unexpected serialization of nil %T", v) +func awsRestjson1_deserializeOpErrorRetrieve(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } - br := bytes.NewReader(msg.Payload) var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(br, ringBuffer) + body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -710,65 +652,128 @@ func awsRestjson1_deserializeEventMessageTracePart(v *types.TracePart, msg *even return err } - if err := awsRestjson1_deserializeDocumentTracePart(&v, shape); err != nil { - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadGatewayException", errorCode): + return awsRestjson1_deserializeErrorBadGatewayException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("DependencyFailedException", errorCode): + return awsRestjson1_deserializeErrorDependencyFailedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError } - return nil } -func awsRestjson1_deserializeEventMessageReturnControlPayload(v *types.ReturnControlPayload, msg *eventstream.Message) error { +func awsRestjson1_deserializeOpDocumentRetrieveOutput(v **RetrieveOutput, value interface{}) error { if v == nil { - return fmt.Errorf("unexpected serialization of nil %T", v) + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - br := bytes.NewReader(msg.Payload) - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - body := io.TeeReader(br, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + var sv *RetrieveOutput + if *v == nil { + sv = &RetrieveOutput{} + } else { + sv = *v } - if err := awsRestjson1_deserializeDocumentReturnControlPayload(&v, shape); err != nil { - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) } - return err - } + case "retrievalResults": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseRetrievalResults(&sv.RetrievalResults, value); err != nil { + return err + } + + default: + _, _ = key, value + + } } + *v = sv return nil } -func awsRestjson1_deserializeEventMessageExceptionInternalServerException(msg *eventstream.Message) error { - br := bytes.NewReader(msg.Payload) +type awsRestjson1_deserializeOpRetrieveAndGenerate struct { +} + +func (*awsRestjson1_deserializeOpRetrieveAndGenerate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRetrieveAndGenerate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorRetrieveAndGenerate(response, &metadata) + } + output := &RetrieveAndGenerateOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(br, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -779,105 +784,45 @@ func awsRestjson1_deserializeEventMessageExceptionInternalServerException(msg *e Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - v := &types.InternalServerException{} - if err := awsRestjson1_deserializeDocumentInternalServerException(&v, shape); err != nil { - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - } - return v -} - -func awsRestjson1_deserializeEventMessageExceptionValidationException(msg *eventstream.Message) error { - br := bytes.NewReader(msg.Payload) - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(br, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + err = awsRestjson1_deserializeOpDocumentRetrieveAndGenerateOutput(&output, shape) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - v := &types.ValidationException{} - if err := awsRestjson1_deserializeDocumentValidationException(&v, shape); err != nil { - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - } - return v + return out, metadata, err } -func awsRestjson1_deserializeEventMessageExceptionResourceNotFoundException(msg *eventstream.Message) error { - br := bytes.NewReader(msg.Payload) - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(br, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err +func awsRestjson1_deserializeOpErrorRetrieveAndGenerate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } + errorBody := bytes.NewReader(errorBuffer.Bytes()) - v := &types.ResourceNotFoundException{} - if err := awsRestjson1_deserializeDocumentResourceNotFoundException(&v, shape); err != nil { - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + errorCode := "UnknownError" + errorMessage := errorCode + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } - return v -} -func awsRestjson1_deserializeEventMessageExceptionServiceQuotaExceededException(msg *eventstream.Message) error { - br := bytes.NewReader(msg.Payload) var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(br, ringBuffer) + body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -887,148 +832,292 @@ func awsRestjson1_deserializeEventMessageExceptionServiceQuotaExceededException( return err } - v := &types.ServiceQuotaExceededException{} - if err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&v, shape); err != nil { - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - return v -} - -func awsRestjson1_deserializeEventMessageExceptionThrottlingException(msg *eventstream.Message) error { - br := bytes.NewReader(msg.Payload) - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(br, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + if len(message) != 0 { + errorMessage = message } - v := &types.ThrottlingException{} - if err := awsRestjson1_deserializeDocumentThrottlingException(&v, shape); err != nil { - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - } - return v -} + case strings.EqualFold("BadGatewayException", errorCode): + return awsRestjson1_deserializeErrorBadGatewayException(response, errorBody) -func awsRestjson1_deserializeEventMessageExceptionAccessDeniedException(msg *eventstream.Message) error { - br := bytes.NewReader(msg.Payload) - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) - body := io.TeeReader(br, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case strings.EqualFold("DependencyFailedException", errorCode): + return awsRestjson1_deserializeErrorDependencyFailedException(response, errorBody) - v := &types.AccessDeniedException{} - if err := awsRestjson1_deserializeDocumentAccessDeniedException(&v, shape); err != nil { - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - } - return v -} + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) -func awsRestjson1_deserializeEventMessageExceptionConflictException(msg *eventstream.Message) error { - br := bytes.NewReader(msg.Payload) - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - body := io.TeeReader(br, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - v := &types.ConflictException{} - if err := awsRestjson1_deserializeDocumentConflictException(&v, shape); err != nil { - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError } - return v } -func awsRestjson1_deserializeEventMessageExceptionDependencyFailedException(msg *eventstream.Message) error { - br := bytes.NewReader(msg.Payload) - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) +func awsRestjson1_deserializeOpDocumentRetrieveAndGenerateOutput(v **RetrieveAndGenerateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - body := io.TeeReader(br, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - v := &types.DependencyFailedException{} - if err := awsRestjson1_deserializeDocumentDependencyFailedException(&v, shape); err != nil { + var sv *RetrieveAndGenerateOutput + if *v == nil { + sv = &RetrieveAndGenerateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "citations": + if err := awsRestjson1_deserializeDocumentCitations(&sv.Citations, value); err != nil { + return err + } + + case "guardrailAction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuadrailAction to be of type string, got %T instead", value) + } + sv.GuardrailAction = types.GuadrailAction(jtv) + } + + case "output": + if err := awsRestjson1_deserializeDocumentRetrieveAndGenerateOutput(&sv.Output, value); err != nil { + return err + } + + case "sessionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SessionId to be of type string, got %T instead", value) + } + sv.SessionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeEventStreamResponseStream(v *types.ResponseStream, msg *eventstream.Message) error { + if v == nil { + return fmt.Errorf("unexpected serialization of nil %T", v) + } + + eventType := msg.Headers.Get(eventstreamapi.EventTypeHeader) + if eventType == nil { + return fmt.Errorf("%s event header not present", eventstreamapi.EventTypeHeader) + } + + switch { + case strings.EqualFold("chunk", eventType.String()): + vv := &types.ResponseStreamMemberChunk{} + if err := awsRestjson1_deserializeEventMessagePayloadPart(&vv.Value, msg); err != nil { + return err + } + *v = vv + return nil + + case strings.EqualFold("files", eventType.String()): + vv := &types.ResponseStreamMemberFiles{} + if err := awsRestjson1_deserializeEventMessageFilePart(&vv.Value, msg); err != nil { + return err + } + *v = vv + return nil + + case strings.EqualFold("returnControl", eventType.String()): + vv := &types.ResponseStreamMemberReturnControl{} + if err := awsRestjson1_deserializeEventMessageReturnControlPayload(&vv.Value, msg); err != nil { + return err + } + *v = vv + return nil + + case strings.EqualFold("trace", eventType.String()): + vv := &types.ResponseStreamMemberTrace{} + if err := awsRestjson1_deserializeEventMessageTracePart(&vv.Value, msg); err != nil { + return err + } + *v = vv + return nil + + default: + buffer := bytes.NewBuffer(nil) + eventstream.NewEncoder().Encode(buffer, *msg) + *v = &types.UnknownUnionMember{ + Tag: eventType.String(), + Value: buffer.Bytes(), + } + return nil + + } +} + +func awsRestjson1_deserializeEventStreamExceptionResponseStream(msg *eventstream.Message) error { + exceptionType := msg.Headers.Get(eventstreamapi.ExceptionTypeHeader) + if exceptionType == nil { + return fmt.Errorf("%s event header not present", eventstreamapi.ExceptionTypeHeader) + } + + switch { + case strings.EqualFold("accessDeniedException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionAccessDeniedException(msg) + + case strings.EqualFold("badGatewayException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionBadGatewayException(msg) + + case strings.EqualFold("conflictException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionConflictException(msg) + + case strings.EqualFold("dependencyFailedException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionDependencyFailedException(msg) + + case strings.EqualFold("internalServerException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionInternalServerException(msg) + + case strings.EqualFold("resourceNotFoundException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionResourceNotFoundException(msg) + + case strings.EqualFold("serviceQuotaExceededException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionServiceQuotaExceededException(msg) + + case strings.EqualFold("throttlingException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionThrottlingException(msg) + + case strings.EqualFold("validationException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionValidationException(msg) + + default: + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + return err + } + errorCode := "UnknownError" + errorMessage := errorCode + if ev := exceptionType.String(); len(ev) > 0 { + errorCode = ev + } else if ev := code; len(ev) > 0 { + errorCode = ev + } + if ev := message; len(ev) > 0 { + errorMessage = ev + } + return &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + + } +} + +func awsRestjson1_deserializeEventMessagePayloadPart(v *types.PayloadPart, msg *eventstream.Message) error { + if v == nil { + return fmt.Errorf("unexpected serialization of nil %T", v) + } + + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + if err := awsRestjson1_deserializeDocumentPayloadPart(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return nil +} + +func awsRestjson1_deserializeEventMessageTracePart(v *types.TracePart, msg *eventstream.Message) error { + if v == nil { + return fmt.Errorf("unexpected serialization of nil %T", v) + } + + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + if err := awsRestjson1_deserializeDocumentTracePart(&v, shape); err != nil { if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1036,49 +1125,1079 @@ func awsRestjson1_deserializeEventMessageExceptionDependencyFailedException(msg Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err - } + return err + } + + } + return nil +} + +func awsRestjson1_deserializeEventMessageReturnControlPayload(v *types.ReturnControlPayload, msg *eventstream.Message) error { + if v == nil { + return fmt.Errorf("unexpected serialization of nil %T", v) + } + + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + if err := awsRestjson1_deserializeDocumentReturnControlPayload(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return nil +} + +func awsRestjson1_deserializeEventMessageExceptionInternalServerException(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.InternalServerException{} + if err := awsRestjson1_deserializeDocumentInternalServerException(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + +func awsRestjson1_deserializeEventMessageExceptionValidationException(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.ValidationException{} + if err := awsRestjson1_deserializeDocumentValidationException(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + +func awsRestjson1_deserializeEventMessageExceptionResourceNotFoundException(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.ResourceNotFoundException{} + if err := awsRestjson1_deserializeDocumentResourceNotFoundException(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + +func awsRestjson1_deserializeEventMessageExceptionServiceQuotaExceededException(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.ServiceQuotaExceededException{} + if err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + +func awsRestjson1_deserializeEventMessageExceptionThrottlingException(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.ThrottlingException{} + if err := awsRestjson1_deserializeDocumentThrottlingException(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + +func awsRestjson1_deserializeEventMessageExceptionAccessDeniedException(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.AccessDeniedException{} + if err := awsRestjson1_deserializeDocumentAccessDeniedException(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + +func awsRestjson1_deserializeEventMessageExceptionConflictException(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.ConflictException{} + if err := awsRestjson1_deserializeDocumentConflictException(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + +func awsRestjson1_deserializeEventMessageExceptionDependencyFailedException(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.DependencyFailedException{} + if err := awsRestjson1_deserializeDocumentDependencyFailedException(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + +func awsRestjson1_deserializeEventMessageExceptionBadGatewayException(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.BadGatewayException{} + if err := awsRestjson1_deserializeDocumentBadGatewayException(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + +func awsRestjson1_deserializeEventMessageFilePart(v *types.FilePart, msg *eventstream.Message) error { + if v == nil { + return fmt.Errorf("unexpected serialization of nil %T", v) + } + + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + if err := awsRestjson1_deserializeDocumentFilePart(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return nil +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentActionGroupInvocationInput(v **types.ActionGroupInvocationInput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ActionGroupInvocationInput + if *v == nil { + sv = &types.ActionGroupInvocationInput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actionGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActionGroupName to be of type string, got %T instead", value) + } + sv.ActionGroupName = ptr.String(jtv) + } + + case "apiPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApiPath to be of type string, got %T instead", value) + } + sv.ApiPath = ptr.String(jtv) + } + + case "executionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExecutionType to be of type string, got %T instead", value) + } + sv.ExecutionType = types.ExecutionType(jtv) + } + + case "function": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Function to be of type string, got %T instead", value) + } + sv.Function = ptr.String(jtv) + } + + case "invocationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InvocationId = ptr.String(jtv) + } + + case "parameters": + if err := awsRestjson1_deserializeDocumentParameters(&sv.Parameters, value); err != nil { + return err + } + + case "requestBody": + if err := awsRestjson1_deserializeDocumentRequestBody(&sv.RequestBody, value); err != nil { + return err + } + + case "verb": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Verb to be of type string, got %T instead", value) + } + sv.Verb = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentActionGroupInvocationOutput(v **types.ActionGroupInvocationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ActionGroupInvocationOutput + if *v == nil { + sv = &types.ActionGroupInvocationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActionGroupOutputString to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentApiContentMap(v *map[string]types.PropertyParameters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]types.PropertyParameters + if *v == nil { + mv = map[string]types.PropertyParameters{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.PropertyParameters + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentPropertyParameters(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentApiInvocationInput(v **types.ApiInvocationInput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ApiInvocationInput + if *v == nil { + sv = &types.ApiInvocationInput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actionGroup": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ActionGroup = ptr.String(jtv) + } + + case "apiPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApiPath to be of type string, got %T instead", value) + } + sv.ApiPath = ptr.String(jtv) + } + + case "httpMethod": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.HttpMethod = ptr.String(jtv) + } + + case "parameters": + if err := awsRestjson1_deserializeDocumentApiParameters(&sv.Parameters, value); err != nil { + return err + } + + case "requestBody": + if err := awsRestjson1_deserializeDocumentApiRequestBody(&sv.RequestBody, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentApiParameter(v **types.ApiParameter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ApiParameter + if *v == nil { + sv = &types.ApiParameter{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentApiParameters(v *[]types.ApiParameter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ApiParameter + if *v == nil { + cv = []types.ApiParameter{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ApiParameter + destAddr := &col + if err := awsRestjson1_deserializeDocumentApiParameter(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentApiRequestBody(v **types.ApiRequestBody, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ApiRequestBody + if *v == nil { + sv = &types.ApiRequestBody{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "content": + if err := awsRestjson1_deserializeDocumentApiContentMap(&sv.Content, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAttribution(v **types.Attribution, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Attribution + if *v == nil { + sv = &types.Attribution{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "citations": + if err := awsRestjson1_deserializeDocumentCitations(&sv.Citations, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBadGatewayException(v **types.BadGatewayException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BadGatewayException + if *v == nil { + sv = &types.BadGatewayException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.ResourceName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCitation(v **types.Citation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Citation + if *v == nil { + sv = &types.Citation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "generatedResponsePart": + if err := awsRestjson1_deserializeDocumentGeneratedResponsePart(&sv.GeneratedResponsePart, value); err != nil { + return err + } + + case "retrievedReferences": + if err := awsRestjson1_deserializeDocumentRetrievedReferences(&sv.RetrievedReferences, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCitations(v *[]types.Citation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Citation + if *v == nil { + cv = []types.Citation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Citation + destAddr := &col + if err := awsRestjson1_deserializeDocumentCitation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCodeInterpreterInvocationInput(v **types.CodeInterpreterInvocationInput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CodeInterpreterInvocationInput + if *v == nil { + sv = &types.CodeInterpreterInvocationInput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "files": + if err := awsRestjson1_deserializeDocumentFiles(&sv.Files, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCodeInterpreterInvocationOutput(v **types.CodeInterpreterInvocationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CodeInterpreterInvocationOutput + if *v == nil { + sv = &types.CodeInterpreterInvocationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "executionError": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ExecutionError = ptr.String(jtv) + } + + case "executionOutput": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ExecutionOutput = ptr.String(jtv) + } - } - return v -} + case "executionTimeout": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.ExecutionTimeout = ptr.Bool(jtv) + } -func awsRestjson1_deserializeEventMessageExceptionBadGatewayException(msg *eventstream.Message) error { - br := bytes.NewReader(msg.Payload) - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "files": + if err := awsRestjson1_deserializeDocumentFiles(&sv.Files, value); err != nil { + return err + } - body := io.TeeReader(br, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + default: + _, _ = key, value - v := &types.BadGatewayException{} - if err := awsRestjson1_deserializeDocumentBadGatewayException(&v, shape); err != nil { - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err } - } - return v + *v = sv + return nil } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1091,9 +2210,9 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *types.ConflictException if *v == nil { - sv = &types.AccessDeniedException{} + sv = &types.ConflictException{} } else { sv = *v } @@ -1118,7 +2237,7 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } -func awsRestjson1_deserializeDocumentActionGroupInvocationInput(v **types.ActionGroupInvocationInput, value interface{}) error { +func awsRestjson1_deserializeDocumentContentMap(v *map[string][]types.Parameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1131,59 +2250,114 @@ func awsRestjson1_deserializeDocumentActionGroupInvocationInput(v **types.Action return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ActionGroupInvocationInput + var mv map[string][]types.Parameter if *v == nil { - sv = &types.ActionGroupInvocationInput{} + mv = map[string][]types.Parameter{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal []types.Parameter + mapVar := parsedVal + if err := awsRestjson1_deserializeDocumentParameters(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentDependencyFailedException(v **types.DependencyFailedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DependencyFailedException + if *v == nil { + sv = &types.DependencyFailedException{} } else { sv = *v } for key, value := range shape { switch key { - case "actionGroupName": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ActionGroupName to be of type string, got %T instead", value) + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) } - sv.ActionGroupName = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "apiPath": + case "resourceName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ApiPath to be of type string, got %T instead", value) + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) } - sv.ApiPath = ptr.String(jtv) + sv.ResourceName = ptr.String(jtv) } - case "function": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFailureTrace(v **types.FailureTrace, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FailureTrace + if *v == nil { + sv = &types.FailureTrace{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Function to be of type string, got %T instead", value) + return fmt.Errorf("expected FailureReasonString to be of type string, got %T instead", value) } - sv.Function = ptr.String(jtv) - } - - case "parameters": - if err := awsRestjson1_deserializeDocumentParameters(&sv.Parameters, value); err != nil { - return err - } - - case "requestBody": - if err := awsRestjson1_deserializeDocumentRequestBody(&sv.RequestBody, value); err != nil { - return err + sv.FailureReason = ptr.String(jtv) } - case "verb": + case "traceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Verb to be of type string, got %T instead", value) + return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) } - sv.Verb = ptr.String(jtv) + sv.TraceId = ptr.String(jtv) } default: @@ -1195,7 +2369,7 @@ func awsRestjson1_deserializeDocumentActionGroupInvocationInput(v **types.Action return nil } -func awsRestjson1_deserializeDocumentActionGroupInvocationOutput(v **types.ActionGroupInvocationOutput, value interface{}) error { +func awsRestjson1_deserializeDocumentFilePart(v **types.FilePart, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1208,22 +2382,18 @@ func awsRestjson1_deserializeDocumentActionGroupInvocationOutput(v **types.Actio return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ActionGroupInvocationOutput + var sv *types.FilePart if *v == nil { - sv = &types.ActionGroupInvocationOutput{} + sv = &types.FilePart{} } else { sv = *v } for key, value := range shape { switch key { - case "text": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ActionGroupOutputString to be of type string, got %T instead", value) - } - sv.Text = ptr.String(jtv) + case "files": + if err := awsRestjson1_deserializeDocumentOutputFiles(&sv.Files, value); err != nil { + return err } default: @@ -1235,7 +2405,7 @@ func awsRestjson1_deserializeDocumentActionGroupInvocationOutput(v **types.Actio return nil } -func awsRestjson1_deserializeDocumentApiContentMap(v *map[string]types.PropertyParameters, value interface{}) error { +func awsRestjson1_deserializeDocumentFiles(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1243,34 +2413,35 @@ func awsRestjson1_deserializeDocumentApiContentMap(v *map[string]types.PropertyP return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.PropertyParameters + var cv []string if *v == nil { - mv = map[string]types.PropertyParameters{} + cv = []string{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal types.PropertyParameters - mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentPropertyParameters(&destAddr, value); err != nil { - return err + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv } - parsedVal = *destAddr - mv[key] = parsedVal + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentApiInvocationInput(v **types.ApiInvocationInput, value interface{}) error { +func awsRestjson1_deserializeDocumentFinalResponse(v **types.FinalResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1283,49 +2454,75 @@ func awsRestjson1_deserializeDocumentApiInvocationInput(v **types.ApiInvocationI return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ApiInvocationInput + var sv *types.FinalResponse if *v == nil { - sv = &types.ApiInvocationInput{} + sv = &types.FinalResponse{} } else { sv = *v } for key, value := range shape { switch key { - case "actionGroup": + case "text": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected FinalResponseString to be of type string, got %T instead", value) } - sv.ActionGroup = ptr.String(jtv) + sv.Text = ptr.String(jtv) } - case "apiPath": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFunctionInvocationInput(v **types.FunctionInvocationInput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FunctionInvocationInput + if *v == nil { + sv = &types.FunctionInvocationInput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actionGroup": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ApiPath to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ApiPath = ptr.String(jtv) + sv.ActionGroup = ptr.String(jtv) } - case "httpMethod": + case "function": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.HttpMethod = ptr.String(jtv) - } - - case "parameters": - if err := awsRestjson1_deserializeDocumentApiParameters(&sv.Parameters, value); err != nil { - return err + sv.Function = ptr.String(jtv) } - case "requestBody": - if err := awsRestjson1_deserializeDocumentApiRequestBody(&sv.RequestBody, value); err != nil { + case "parameters": + if err := awsRestjson1_deserializeDocumentFunctionParameters(&sv.Parameters, value); err != nil { return err } @@ -1338,7 +2535,7 @@ func awsRestjson1_deserializeDocumentApiInvocationInput(v **types.ApiInvocationI return nil } -func awsRestjson1_deserializeDocumentApiParameter(v **types.ApiParameter, value interface{}) error { +func awsRestjson1_deserializeDocumentFunctionParameter(v **types.FunctionParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1351,9 +2548,9 @@ func awsRestjson1_deserializeDocumentApiParameter(v **types.ApiParameter, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ApiParameter + var sv *types.FunctionParameter if *v == nil { - sv = &types.ApiParameter{} + sv = &types.FunctionParameter{} } else { sv = *v } @@ -1396,7 +2593,7 @@ func awsRestjson1_deserializeDocumentApiParameter(v **types.ApiParameter, value return nil } -func awsRestjson1_deserializeDocumentApiParameters(v *[]types.ApiParameter, value interface{}) error { +func awsRestjson1_deserializeDocumentFunctionParameters(v *[]types.FunctionParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1409,17 +2606,17 @@ func awsRestjson1_deserializeDocumentApiParameters(v *[]types.ApiParameter, valu return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ApiParameter + var cv []types.FunctionParameter if *v == nil { - cv = []types.ApiParameter{} + cv = []types.FunctionParameter{} } else { cv = *v } for _, value := range shape { - var col types.ApiParameter + var col types.FunctionParameter destAddr := &col - if err := awsRestjson1_deserializeDocumentApiParameter(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentFunctionParameter(&destAddr, value); err != nil { return err } col = *destAddr @@ -1430,7 +2627,7 @@ func awsRestjson1_deserializeDocumentApiParameters(v *[]types.ApiParameter, valu return nil } -func awsRestjson1_deserializeDocumentApiRequestBody(v **types.ApiRequestBody, value interface{}) error { +func awsRestjson1_deserializeDocumentGeneratedResponsePart(v **types.GeneratedResponsePart, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1443,17 +2640,17 @@ func awsRestjson1_deserializeDocumentApiRequestBody(v **types.ApiRequestBody, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ApiRequestBody + var sv *types.GeneratedResponsePart if *v == nil { - sv = &types.ApiRequestBody{} + sv = &types.GeneratedResponsePart{} } else { sv = *v } for key, value := range shape { switch key { - case "content": - if err := awsRestjson1_deserializeDocumentApiContentMap(&sv.Content, value); err != nil { + case "textResponsePart": + if err := awsRestjson1_deserializeDocumentTextResponsePart(&sv.TextResponsePart, value); err != nil { return err } @@ -1466,7 +2663,7 @@ func awsRestjson1_deserializeDocumentApiRequestBody(v **types.ApiRequestBody, va return nil } -func awsRestjson1_deserializeDocumentAttribution(v **types.Attribution, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailAssessment(v **types.GuardrailAssessment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1479,17 +2676,32 @@ func awsRestjson1_deserializeDocumentAttribution(v **types.Attribution, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Attribution + var sv *types.GuardrailAssessment if *v == nil { - sv = &types.Attribution{} + sv = &types.GuardrailAssessment{} } else { sv = *v } for key, value := range shape { switch key { - case "citations": - if err := awsRestjson1_deserializeDocumentCitations(&sv.Citations, value); err != nil { + case "contentPolicy": + if err := awsRestjson1_deserializeDocumentGuardrailContentPolicyAssessment(&sv.ContentPolicy, value); err != nil { + return err + } + + case "sensitiveInformationPolicy": + if err := awsRestjson1_deserializeDocumentGuardrailSensitiveInformationPolicyAssessment(&sv.SensitiveInformationPolicy, value); err != nil { + return err + } + + case "topicPolicy": + if err := awsRestjson1_deserializeDocumentGuardrailTopicPolicyAssessment(&sv.TopicPolicy, value); err != nil { + return err + } + + case "wordPolicy": + if err := awsRestjson1_deserializeDocumentGuardrailWordPolicyAssessment(&sv.WordPolicy, value); err != nil { return err } @@ -1502,7 +2714,7 @@ func awsRestjson1_deserializeDocumentAttribution(v **types.Attribution, value in return nil } -func awsRestjson1_deserializeDocumentBadGatewayException(v **types.BadGatewayException, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailAssessmentList(v *[]types.GuardrailAssessment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1510,48 +2722,33 @@ func awsRestjson1_deserializeDocumentBadGatewayException(v **types.BadGatewayExc return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BadGatewayException + var cv []types.GuardrailAssessment if *v == nil { - sv = &types.BadGatewayException{} + cv = []types.GuardrailAssessment{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "resourceName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) - } - sv.ResourceName = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.GuardrailAssessment + destAddr := &col + if err := awsRestjson1_deserializeDocumentGuardrailAssessment(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentCitation(v **types.Citation, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailContentFilter(v **types.GuardrailContentFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1564,23 +2761,40 @@ func awsRestjson1_deserializeDocumentCitation(v **types.Citation, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Citation + var sv *types.GuardrailContentFilter if *v == nil { - sv = &types.Citation{} + sv = &types.GuardrailContentFilter{} } else { sv = *v } for key, value := range shape { switch key { - case "generatedResponsePart": - if err := awsRestjson1_deserializeDocumentGeneratedResponsePart(&sv.GeneratedResponsePart, value); err != nil { - return err + case "action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuardrailContentPolicyAction to be of type string, got %T instead", value) + } + sv.Action = types.GuardrailContentPolicyAction(jtv) } - case "retrievedReferences": - if err := awsRestjson1_deserializeDocumentRetrievedReferences(&sv.RetrievedReferences, value); err != nil { - return err + case "confidence": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuardrailContentFilterConfidence to be of type string, got %T instead", value) + } + sv.Confidence = types.GuardrailContentFilterConfidence(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuardrailContentFilterType to be of type string, got %T instead", value) + } + sv.Type = types.GuardrailContentFilterType(jtv) } default: @@ -1592,7 +2806,7 @@ func awsRestjson1_deserializeDocumentCitation(v **types.Citation, value interfac return nil } -func awsRestjson1_deserializeDocumentCitations(v *[]types.Citation, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailContentFilterList(v *[]types.GuardrailContentFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1605,17 +2819,17 @@ func awsRestjson1_deserializeDocumentCitations(v *[]types.Citation, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Citation + var cv []types.GuardrailContentFilter if *v == nil { - cv = []types.Citation{} + cv = []types.GuardrailContentFilter{} } else { cv = *v } for _, value := range shape { - var col types.Citation + var col types.GuardrailContentFilter destAddr := &col - if err := awsRestjson1_deserializeDocumentCitation(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentGuardrailContentFilter(&destAddr, value); err != nil { return err } col = *destAddr @@ -1626,7 +2840,7 @@ func awsRestjson1_deserializeDocumentCitations(v *[]types.Citation, value interf return nil } -func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailContentPolicyAssessment(v **types.GuardrailContentPolicyAssessment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1639,22 +2853,18 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConflictException + var sv *types.GuardrailContentPolicyAssessment if *v == nil { - sv = &types.ConflictException{} + sv = &types.GuardrailContentPolicyAssessment{} } else { sv = *v } for key, value := range shape { switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "filters": + if err := awsRestjson1_deserializeDocumentGuardrailContentFilterList(&sv.Filters, value); err != nil { + return err } default: @@ -1666,41 +2876,7 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } -func awsRestjson1_deserializeDocumentContentMap(v *map[string][]types.Parameter, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string][]types.Parameter - if *v == nil { - mv = map[string][]types.Parameter{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal []types.Parameter - mapVar := parsedVal - if err := awsRestjson1_deserializeDocumentParameters(&mapVar, value); err != nil { - return err - } - parsedVal = mapVar - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentDependencyFailedException(v **types.DependencyFailedException, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailCustomWord(v **types.GuardrailCustomWord, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1713,31 +2889,31 @@ func awsRestjson1_deserializeDocumentDependencyFailedException(v **types.Depende return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DependencyFailedException + var sv *types.GuardrailCustomWord if *v == nil { - sv = &types.DependencyFailedException{} + sv = &types.GuardrailCustomWord{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "action": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + return fmt.Errorf("expected GuardrailWordPolicyAction to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Action = types.GuardrailWordPolicyAction(jtv) } - case "resourceName": + case "match": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ResourceName = ptr.String(jtv) + sv.Match = ptr.String(jtv) } default: @@ -1749,7 +2925,7 @@ func awsRestjson1_deserializeDocumentDependencyFailedException(v **types.Depende return nil } -func awsRestjson1_deserializeDocumentFailureTrace(v **types.FailureTrace, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailCustomWordList(v *[]types.GuardrailCustomWord, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1757,48 +2933,33 @@ func awsRestjson1_deserializeDocumentFailureTrace(v **types.FailureTrace, value return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FailureTrace + var cv []types.GuardrailCustomWord if *v == nil { - sv = &types.FailureTrace{} + cv = []types.GuardrailCustomWord{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "failureReason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FailureReasonString to be of type string, got %T instead", value) - } - sv.FailureReason = ptr.String(jtv) - } - - case "traceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) - } - sv.TraceId = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.GuardrailCustomWord + destAddr := &col + if err := awsRestjson1_deserializeDocumentGuardrailCustomWord(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentFinalResponse(v **types.FinalResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailManagedWord(v **types.GuardrailManagedWord, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1811,22 +2972,40 @@ func awsRestjson1_deserializeDocumentFinalResponse(v **types.FinalResponse, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FinalResponse + var sv *types.GuardrailManagedWord if *v == nil { - sv = &types.FinalResponse{} + sv = &types.GuardrailManagedWord{} } else { sv = *v } for key, value := range shape { switch key { - case "text": + case "action": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FinalResponseString to be of type string, got %T instead", value) + return fmt.Errorf("expected GuardrailWordPolicyAction to be of type string, got %T instead", value) } - sv.Text = ptr.String(jtv) + sv.Action = types.GuardrailWordPolicyAction(jtv) + } + + case "match": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Match = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuardrailManagedWordType to be of type string, got %T instead", value) + } + sv.Type = types.GuardrailManagedWordType(jtv) } default: @@ -1838,7 +3017,7 @@ func awsRestjson1_deserializeDocumentFinalResponse(v **types.FinalResponse, valu return nil } -func awsRestjson1_deserializeDocumentFunctionInvocationInput(v **types.FunctionInvocationInput, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailManagedWordList(v *[]types.GuardrailManagedWord, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1846,53 +3025,33 @@ func awsRestjson1_deserializeDocumentFunctionInvocationInput(v **types.FunctionI return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FunctionInvocationInput + var cv []types.GuardrailManagedWord if *v == nil { - sv = &types.FunctionInvocationInput{} + cv = []types.GuardrailManagedWord{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "actionGroup": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ActionGroup = ptr.String(jtv) - } - - case "function": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Function = ptr.String(jtv) - } - - case "parameters": - if err := awsRestjson1_deserializeDocumentFunctionParameters(&sv.Parameters, value); err != nil { - return err - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.GuardrailManagedWord + destAddr := &col + if err := awsRestjson1_deserializeDocumentGuardrailManagedWord(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentFunctionParameter(v **types.FunctionParameter, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailPiiEntityFilter(v **types.GuardrailPiiEntityFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1905,40 +3064,40 @@ func awsRestjson1_deserializeDocumentFunctionParameter(v **types.FunctionParamet return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FunctionParameter + var sv *types.GuardrailPiiEntityFilter if *v == nil { - sv = &types.FunctionParameter{} + sv = &types.GuardrailPiiEntityFilter{} } else { sv = *v } for key, value := range shape { switch key { - case "name": + case "action": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected GuardrailSensitiveInformationPolicyAction to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Action = types.GuardrailSensitiveInformationPolicyAction(jtv) } - case "type": + case "match": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Type = ptr.String(jtv) + sv.Match = ptr.String(jtv) } - case "value": + case "type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected GuardrailPiiEntityType to be of type string, got %T instead", value) } - sv.Value = ptr.String(jtv) + sv.Type = types.GuardrailPiiEntityType(jtv) } default: @@ -1950,7 +3109,7 @@ func awsRestjson1_deserializeDocumentFunctionParameter(v **types.FunctionParamet return nil } -func awsRestjson1_deserializeDocumentFunctionParameters(v *[]types.FunctionParameter, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailPiiEntityFilterList(v *[]types.GuardrailPiiEntityFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1963,17 +3122,17 @@ func awsRestjson1_deserializeDocumentFunctionParameters(v *[]types.FunctionParam return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.FunctionParameter + var cv []types.GuardrailPiiEntityFilter if *v == nil { - cv = []types.FunctionParameter{} + cv = []types.GuardrailPiiEntityFilter{} } else { cv = *v } for _, value := range shape { - var col types.FunctionParameter + var col types.GuardrailPiiEntityFilter destAddr := &col - if err := awsRestjson1_deserializeDocumentFunctionParameter(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentGuardrailPiiEntityFilter(&destAddr, value); err != nil { return err } col = *destAddr @@ -1984,7 +3143,7 @@ func awsRestjson1_deserializeDocumentFunctionParameters(v *[]types.FunctionParam return nil } -func awsRestjson1_deserializeDocumentGeneratedResponsePart(v **types.GeneratedResponsePart, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailRegexFilter(v **types.GuardrailRegexFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1997,18 +3156,49 @@ func awsRestjson1_deserializeDocumentGeneratedResponsePart(v **types.GeneratedRe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GeneratedResponsePart + var sv *types.GuardrailRegexFilter if *v == nil { - sv = &types.GeneratedResponsePart{} + sv = &types.GuardrailRegexFilter{} } else { sv = *v } for key, value := range shape { switch key { - case "textResponsePart": - if err := awsRestjson1_deserializeDocumentTextResponsePart(&sv.TextResponsePart, value); err != nil { - return err + case "action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuardrailSensitiveInformationPolicyAction to be of type string, got %T instead", value) + } + sv.Action = types.GuardrailSensitiveInformationPolicyAction(jtv) + } + + case "match": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Match = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "regex": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Regex = ptr.String(jtv) } default: @@ -2020,7 +3210,7 @@ func awsRestjson1_deserializeDocumentGeneratedResponsePart(v **types.GeneratedRe return nil } -func awsRestjson1_deserializeDocumentGuardrailAssessment(v **types.GuardrailAssessment, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailRegexFilterList(v *[]types.GuardrailRegexFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2028,50 +3218,33 @@ func awsRestjson1_deserializeDocumentGuardrailAssessment(v **types.GuardrailAsse return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailAssessment + var cv []types.GuardrailRegexFilter if *v == nil { - sv = &types.GuardrailAssessment{} + cv = []types.GuardrailRegexFilter{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "contentPolicy": - if err := awsRestjson1_deserializeDocumentGuardrailContentPolicyAssessment(&sv.ContentPolicy, value); err != nil { - return err - } - - case "sensitiveInformationPolicy": - if err := awsRestjson1_deserializeDocumentGuardrailSensitiveInformationPolicyAssessment(&sv.SensitiveInformationPolicy, value); err != nil { - return err - } - - case "topicPolicy": - if err := awsRestjson1_deserializeDocumentGuardrailTopicPolicyAssessment(&sv.TopicPolicy, value); err != nil { - return err - } - - case "wordPolicy": - if err := awsRestjson1_deserializeDocumentGuardrailWordPolicyAssessment(&sv.WordPolicy, value); err != nil { - return err - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.GuardrailRegexFilter + destAddr := &col + if err := awsRestjson1_deserializeDocumentGuardrailRegexFilter(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentGuardrailAssessmentList(v *[]types.GuardrailAssessment, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailSensitiveInformationPolicyAssessment(v **types.GuardrailSensitiveInformationPolicyAssessment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2079,33 +3252,40 @@ func awsRestjson1_deserializeDocumentGuardrailAssessmentList(v *[]types.Guardrai return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.GuardrailAssessment + var sv *types.GuardrailSensitiveInformationPolicyAssessment if *v == nil { - cv = []types.GuardrailAssessment{} + sv = &types.GuardrailSensitiveInformationPolicyAssessment{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.GuardrailAssessment - destAddr := &col - if err := awsRestjson1_deserializeDocumentGuardrailAssessment(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "piiEntities": + if err := awsRestjson1_deserializeDocumentGuardrailPiiEntityFilterList(&sv.PiiEntities, value); err != nil { + return err + } + + case "regexes": + if err := awsRestjson1_deserializeDocumentGuardrailRegexFilterList(&sv.Regexes, value); err != nil { + return err + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentGuardrailContentFilter(v **types.GuardrailContentFilter, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailTopic(v **types.GuardrailTopic, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2118,9 +3298,9 @@ func awsRestjson1_deserializeDocumentGuardrailContentFilter(v **types.GuardrailC return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailContentFilter + var sv *types.GuardrailTopic if *v == nil { - sv = &types.GuardrailContentFilter{} + sv = &types.GuardrailTopic{} } else { sv = *v } @@ -2131,27 +3311,27 @@ func awsRestjson1_deserializeDocumentGuardrailContentFilter(v **types.GuardrailC if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GuardrailContentPolicyAction to be of type string, got %T instead", value) + return fmt.Errorf("expected GuardrailTopicPolicyAction to be of type string, got %T instead", value) } - sv.Action = types.GuardrailContentPolicyAction(jtv) + sv.Action = types.GuardrailTopicPolicyAction(jtv) } - case "confidence": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GuardrailContentFilterConfidence to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Confidence = types.GuardrailContentFilterConfidence(jtv) + sv.Name = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GuardrailContentFilterType to be of type string, got %T instead", value) + return fmt.Errorf("expected GuardrailTopicType to be of type string, got %T instead", value) } - sv.Type = types.GuardrailContentFilterType(jtv) + sv.Type = types.GuardrailTopicType(jtv) } default: @@ -2163,7 +3343,7 @@ func awsRestjson1_deserializeDocumentGuardrailContentFilter(v **types.GuardrailC return nil } -func awsRestjson1_deserializeDocumentGuardrailContentFilterList(v *[]types.GuardrailContentFilter, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailTopicList(v *[]types.GuardrailTopic, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2176,17 +3356,17 @@ func awsRestjson1_deserializeDocumentGuardrailContentFilterList(v *[]types.Guard return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.GuardrailContentFilter + var cv []types.GuardrailTopic if *v == nil { - cv = []types.GuardrailContentFilter{} + cv = []types.GuardrailTopic{} } else { cv = *v } for _, value := range shape { - var col types.GuardrailContentFilter + var col types.GuardrailTopic destAddr := &col - if err := awsRestjson1_deserializeDocumentGuardrailContentFilter(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentGuardrailTopic(&destAddr, value); err != nil { return err } col = *destAddr @@ -2197,7 +3377,7 @@ func awsRestjson1_deserializeDocumentGuardrailContentFilterList(v *[]types.Guard return nil } -func awsRestjson1_deserializeDocumentGuardrailContentPolicyAssessment(v **types.GuardrailContentPolicyAssessment, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailTopicPolicyAssessment(v **types.GuardrailTopicPolicyAssessment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2210,17 +3390,17 @@ func awsRestjson1_deserializeDocumentGuardrailContentPolicyAssessment(v **types. return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailContentPolicyAssessment + var sv *types.GuardrailTopicPolicyAssessment if *v == nil { - sv = &types.GuardrailContentPolicyAssessment{} + sv = &types.GuardrailTopicPolicyAssessment{} } else { sv = *v } for key, value := range shape { switch key { - case "filters": - if err := awsRestjson1_deserializeDocumentGuardrailContentFilterList(&sv.Filters, value); err != nil { + case "topics": + if err := awsRestjson1_deserializeDocumentGuardrailTopicList(&sv.Topics, value); err != nil { return err } @@ -2233,7 +3413,7 @@ func awsRestjson1_deserializeDocumentGuardrailContentPolicyAssessment(v **types. return nil } -func awsRestjson1_deserializeDocumentGuardrailCustomWord(v **types.GuardrailCustomWord, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailTrace(v **types.GuardrailTrace, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2246,9 +3426,9 @@ func awsRestjson1_deserializeDocumentGuardrailCustomWord(v **types.GuardrailCust return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailCustomWord + var sv *types.GuardrailTrace if *v == nil { - sv = &types.GuardrailCustomWord{} + sv = &types.GuardrailTrace{} } else { sv = *v } @@ -2259,18 +3439,28 @@ func awsRestjson1_deserializeDocumentGuardrailCustomWord(v **types.GuardrailCust if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GuardrailWordPolicyAction to be of type string, got %T instead", value) + return fmt.Errorf("expected GuardrailAction to be of type string, got %T instead", value) } - sv.Action = types.GuardrailWordPolicyAction(jtv) + sv.Action = types.GuardrailAction(jtv) } - case "match": + case "inputAssessments": + if err := awsRestjson1_deserializeDocumentGuardrailAssessmentList(&sv.InputAssessments, value); err != nil { + return err + } + + case "outputAssessments": + if err := awsRestjson1_deserializeDocumentGuardrailAssessmentList(&sv.OutputAssessments, value); err != nil { + return err + } + + case "traceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) } - sv.Match = ptr.String(jtv) + sv.TraceId = ptr.String(jtv) } default: @@ -2282,7 +3472,7 @@ func awsRestjson1_deserializeDocumentGuardrailCustomWord(v **types.GuardrailCust return nil } -func awsRestjson1_deserializeDocumentGuardrailCustomWordList(v *[]types.GuardrailCustomWord, value interface{}) error { +func awsRestjson1_deserializeDocumentGuardrailWordPolicyAssessment(v **types.GuardrailWordPolicyAssessment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2290,33 +3480,40 @@ func awsRestjson1_deserializeDocumentGuardrailCustomWordList(v *[]types.Guardrai return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.GuardrailCustomWord + var sv *types.GuardrailWordPolicyAssessment if *v == nil { - cv = []types.GuardrailCustomWord{} + sv = &types.GuardrailWordPolicyAssessment{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.GuardrailCustomWord - destAddr := &col - if err := awsRestjson1_deserializeDocumentGuardrailCustomWord(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "customWords": + if err := awsRestjson1_deserializeDocumentGuardrailCustomWordList(&sv.CustomWords, value); err != nil { + return err + } + + case "managedWordLists": + if err := awsRestjson1_deserializeDocumentGuardrailManagedWordList(&sv.ManagedWordLists, value); err != nil { + return err + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentGuardrailManagedWord(v **types.GuardrailManagedWord, value interface{}) error { +func awsRestjson1_deserializeDocumentInferenceConfiguration(v **types.InferenceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2329,40 +3526,152 @@ func awsRestjson1_deserializeDocumentGuardrailManagedWord(v **types.GuardrailMan return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailManagedWord + var sv *types.InferenceConfiguration if *v == nil { - sv = &types.GuardrailManagedWord{} + sv = &types.InferenceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "action": + case "maximumLength": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected GuardrailWordPolicyAction to be of type string, got %T instead", value) + return fmt.Errorf("expected MaximumLength to be json.Number, got %T instead", value) } - sv.Action = types.GuardrailWordPolicyAction(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumLength = ptr.Int32(int32(i64)) } - case "match": + case "stopSequences": + if err := awsRestjson1_deserializeDocumentStopSequences(&sv.StopSequences, value); err != nil { + return err + } + + case "temperature": if value != nil { - jtv, ok := value.(string) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Temperature = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Temperature = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Temperature to be a JSON Number, got %T instead", value) + + } + } + + case "topK": + if value != nil { + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected TopK to be json.Number, got %T instead", value) } - sv.Match = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TopK = ptr.Int32(int32(i64)) } - case "type": + case "topP": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TopP = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.TopP = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected TopP to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GuardrailManagedWordType to be of type string, got %T instead", value) + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) } - sv.Type = types.GuardrailManagedWordType(jtv) + sv.Message = ptr.String(jtv) } default: @@ -2374,7 +3683,7 @@ func awsRestjson1_deserializeDocumentGuardrailManagedWord(v **types.GuardrailMan return nil } -func awsRestjson1_deserializeDocumentGuardrailManagedWordList(v *[]types.GuardrailManagedWord, value interface{}) error { +func awsRestjson1_deserializeDocumentInvocationInput(v **types.InvocationInput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2382,33 +3691,63 @@ func awsRestjson1_deserializeDocumentGuardrailManagedWordList(v *[]types.Guardra return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.GuardrailManagedWord + var sv *types.InvocationInput if *v == nil { - cv = []types.GuardrailManagedWord{} + sv = &types.InvocationInput{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.GuardrailManagedWord - destAddr := &col - if err := awsRestjson1_deserializeDocumentGuardrailManagedWord(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "actionGroupInvocationInput": + if err := awsRestjson1_deserializeDocumentActionGroupInvocationInput(&sv.ActionGroupInvocationInput, value); err != nil { + return err + } + + case "codeInterpreterInvocationInput": + if err := awsRestjson1_deserializeDocumentCodeInterpreterInvocationInput(&sv.CodeInterpreterInvocationInput, value); err != nil { + return err + } + + case "invocationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InvocationType to be of type string, got %T instead", value) + } + sv.InvocationType = types.InvocationType(jtv) + } + + case "knowledgeBaseLookupInput": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseLookupInput(&sv.KnowledgeBaseLookupInput, value); err != nil { + return err + } + + case "traceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) + } + sv.TraceId = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentGuardrailPiiEntityFilter(v **types.GuardrailPiiEntityFilter, value interface{}) error { +func awsRestjson1_deserializeDocumentInvocationInputMember(v *types.InvocationInputMember, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2421,52 +3760,44 @@ func awsRestjson1_deserializeDocumentGuardrailPiiEntityFilter(v **types.Guardrai return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailPiiEntityFilter - if *v == nil { - sv = &types.GuardrailPiiEntityFilter{} - } else { - sv = *v - } - + var uv types.InvocationInputMember +loop: for key, value := range shape { + if value == nil { + continue + } switch key { - case "action": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GuardrailSensitiveInformationPolicyAction to be of type string, got %T instead", value) - } - sv.Action = types.GuardrailSensitiveInformationPolicyAction(jtv) - } - - case "match": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Match = ptr.String(jtv) + case "apiInvocationInput": + var mv types.ApiInvocationInput + destAddr := &mv + if err := awsRestjson1_deserializeDocumentApiInvocationInput(&destAddr, value); err != nil { + return err } + mv = *destAddr + uv = &types.InvocationInputMemberMemberApiInvocationInput{Value: mv} + break loop - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GuardrailPiiEntityType to be of type string, got %T instead", value) - } - sv.Type = types.GuardrailPiiEntityType(jtv) + case "functionInvocationInput": + var mv types.FunctionInvocationInput + destAddr := &mv + if err := awsRestjson1_deserializeDocumentFunctionInvocationInput(&destAddr, value); err != nil { + return err } + mv = *destAddr + uv = &types.InvocationInputMemberMemberFunctionInvocationInput{Value: mv} + break loop default: - _, _ = key, value + uv = &types.UnknownUnionMember{Tag: key} + break loop } } - *v = sv + *v = uv return nil } -func awsRestjson1_deserializeDocumentGuardrailPiiEntityFilterList(v *[]types.GuardrailPiiEntityFilter, value interface{}) error { +func awsRestjson1_deserializeDocumentInvocationInputs(v *[]types.InvocationInputMember, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2479,20 +3810,18 @@ func awsRestjson1_deserializeDocumentGuardrailPiiEntityFilterList(v *[]types.Gua return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.GuardrailPiiEntityFilter + var cv []types.InvocationInputMember if *v == nil { - cv = []types.GuardrailPiiEntityFilter{} + cv = []types.InvocationInputMember{} } else { cv = *v } for _, value := range shape { - var col types.GuardrailPiiEntityFilter - destAddr := &col - if err := awsRestjson1_deserializeDocumentGuardrailPiiEntityFilter(&destAddr, value); err != nil { + var col types.InvocationInputMember + if err := awsRestjson1_deserializeDocumentInvocationInputMember(&col, value); err != nil { return err } - col = *destAddr cv = append(cv, col) } @@ -2500,7 +3829,7 @@ func awsRestjson1_deserializeDocumentGuardrailPiiEntityFilterList(v *[]types.Gua return nil } -func awsRestjson1_deserializeDocumentGuardrailRegexFilter(v **types.GuardrailRegexFilter, value interface{}) error { +func awsRestjson1_deserializeDocumentKnowledgeBaseLookupInput(v **types.KnowledgeBaseLookupInput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2513,49 +3842,31 @@ func awsRestjson1_deserializeDocumentGuardrailRegexFilter(v **types.GuardrailReg return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailRegexFilter + var sv *types.KnowledgeBaseLookupInput if *v == nil { - sv = &types.GuardrailRegexFilter{} + sv = &types.KnowledgeBaseLookupInput{} } else { sv = *v } for key, value := range shape { switch key { - case "action": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GuardrailSensitiveInformationPolicyAction to be of type string, got %T instead", value) - } - sv.Action = types.GuardrailSensitiveInformationPolicyAction(jtv) - } - - case "match": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Match = ptr.String(jtv) - } - - case "name": + case "knowledgeBaseId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected TraceKnowledgeBaseId to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.KnowledgeBaseId = ptr.String(jtv) } - case "regex": + case "text": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected KnowledgeBaseLookupInputString to be of type string, got %T instead", value) } - sv.Regex = ptr.String(jtv) + sv.Text = ptr.String(jtv) } default: @@ -2567,41 +3878,7 @@ func awsRestjson1_deserializeDocumentGuardrailRegexFilter(v **types.GuardrailReg return nil } -func awsRestjson1_deserializeDocumentGuardrailRegexFilterList(v *[]types.GuardrailRegexFilter, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.GuardrailRegexFilter - if *v == nil { - cv = []types.GuardrailRegexFilter{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.GuardrailRegexFilter - destAddr := &col - if err := awsRestjson1_deserializeDocumentGuardrailRegexFilter(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentGuardrailSensitiveInformationPolicyAssessment(v **types.GuardrailSensitiveInformationPolicyAssessment, value interface{}) error { +func awsRestjson1_deserializeDocumentKnowledgeBaseLookupOutput(v **types.KnowledgeBaseLookupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2614,22 +3891,17 @@ func awsRestjson1_deserializeDocumentGuardrailSensitiveInformationPolicyAssessme return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailSensitiveInformationPolicyAssessment + var sv *types.KnowledgeBaseLookupOutput if *v == nil { - sv = &types.GuardrailSensitiveInformationPolicyAssessment{} + sv = &types.KnowledgeBaseLookupOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "piiEntities": - if err := awsRestjson1_deserializeDocumentGuardrailPiiEntityFilterList(&sv.PiiEntities, value); err != nil { - return err - } - - case "regexes": - if err := awsRestjson1_deserializeDocumentGuardrailRegexFilterList(&sv.Regexes, value); err != nil { + case "retrievedReferences": + if err := awsRestjson1_deserializeDocumentRetrievedReferences(&sv.RetrievedReferences, value); err != nil { return err } @@ -2642,7 +3914,7 @@ func awsRestjson1_deserializeDocumentGuardrailSensitiveInformationPolicyAssessme return nil } -func awsRestjson1_deserializeDocumentGuardrailTopic(v **types.GuardrailTopic, value interface{}) error { +func awsRestjson1_deserializeDocumentModelInvocationInput(v **types.ModelInvocationInput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2655,110 +3927,72 @@ func awsRestjson1_deserializeDocumentGuardrailTopic(v **types.GuardrailTopic, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailTopic + var sv *types.ModelInvocationInput if *v == nil { - sv = &types.GuardrailTopic{} + sv = &types.ModelInvocationInput{} } else { sv = *v } for key, value := range shape { switch key { - case "action": + case "inferenceConfiguration": + if err := awsRestjson1_deserializeDocumentInferenceConfiguration(&sv.InferenceConfiguration, value); err != nil { + return err + } + + case "overrideLambda": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GuardrailTopicPolicyAction to be of type string, got %T instead", value) + return fmt.Errorf("expected LambdaArn to be of type string, got %T instead", value) } - sv.Action = types.GuardrailTopicPolicyAction(jtv) + sv.OverrideLambda = ptr.String(jtv) } - case "name": + case "parserMode": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected CreationMode to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.ParserMode = types.CreationMode(jtv) } - case "type": + case "promptCreationMode": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GuardrailTopicType to be of type string, got %T instead", value) + return fmt.Errorf("expected CreationMode to be of type string, got %T instead", value) } - sv.Type = types.GuardrailTopicType(jtv) + sv.PromptCreationMode = types.CreationMode(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentGuardrailTopicList(v *[]types.GuardrailTopic, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.GuardrailTopic - if *v == nil { - cv = []types.GuardrailTopic{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.GuardrailTopic - destAddr := &col - if err := awsRestjson1_deserializeDocumentGuardrailTopic(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentGuardrailTopicPolicyAssessment(v **types.GuardrailTopicPolicyAssessment, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptText to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } - var sv *types.GuardrailTopicPolicyAssessment - if *v == nil { - sv = &types.GuardrailTopicPolicyAssessment{} - } else { - sv = *v - } + case "traceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) + } + sv.TraceId = ptr.String(jtv) + } - for key, value := range shape { - switch key { - case "topics": - if err := awsRestjson1_deserializeDocumentGuardrailTopicList(&sv.Topics, value); err != nil { - return err + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptType to be of type string, got %T instead", value) + } + sv.Type = types.PromptType(jtv) } default: @@ -2770,7 +4004,7 @@ func awsRestjson1_deserializeDocumentGuardrailTopicPolicyAssessment(v **types.Gu return nil } -func awsRestjson1_deserializeDocumentGuardrailTrace(v **types.GuardrailTrace, value interface{}) error { +func awsRestjson1_deserializeDocumentObservation(v **types.Observation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2783,31 +4017,37 @@ func awsRestjson1_deserializeDocumentGuardrailTrace(v **types.GuardrailTrace, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailTrace + var sv *types.Observation if *v == nil { - sv = &types.GuardrailTrace{} + sv = &types.Observation{} } else { sv = *v } for key, value := range shape { switch key { - case "action": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GuardrailAction to be of type string, got %T instead", value) - } - sv.Action = types.GuardrailAction(jtv) + case "actionGroupInvocationOutput": + if err := awsRestjson1_deserializeDocumentActionGroupInvocationOutput(&sv.ActionGroupInvocationOutput, value); err != nil { + return err } - case "inputAssessments": - if err := awsRestjson1_deserializeDocumentGuardrailAssessmentList(&sv.InputAssessments, value); err != nil { + case "codeInterpreterInvocationOutput": + if err := awsRestjson1_deserializeDocumentCodeInterpreterInvocationOutput(&sv.CodeInterpreterInvocationOutput, value); err != nil { return err } - case "outputAssessments": - if err := awsRestjson1_deserializeDocumentGuardrailAssessmentList(&sv.OutputAssessments, value); err != nil { + case "finalResponse": + if err := awsRestjson1_deserializeDocumentFinalResponse(&sv.FinalResponse, value); err != nil { + return err + } + + case "knowledgeBaseLookupOutput": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseLookupOutput(&sv.KnowledgeBaseLookupOutput, value); err != nil { + return err + } + + case "repromptResponse": + if err := awsRestjson1_deserializeDocumentRepromptResponse(&sv.RepromptResponse, value); err != nil { return err } @@ -2820,6 +4060,15 @@ func awsRestjson1_deserializeDocumentGuardrailTrace(v **types.GuardrailTrace, va sv.TraceId = ptr.String(jtv) } + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Type to be of type string, got %T instead", value) + } + sv.Type = types.Type(jtv) + } + default: _, _ = key, value @@ -2829,7 +4078,7 @@ func awsRestjson1_deserializeDocumentGuardrailTrace(v **types.GuardrailTrace, va return nil } -func awsRestjson1_deserializeDocumentGuardrailWordPolicyAssessment(v **types.GuardrailWordPolicyAssessment, value interface{}) error { +func awsRestjson1_deserializeDocumentOrchestrationTrace(v *types.OrchestrationTrace, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2842,35 +4091,64 @@ func awsRestjson1_deserializeDocumentGuardrailWordPolicyAssessment(v **types.Gua return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GuardrailWordPolicyAssessment - if *v == nil { - sv = &types.GuardrailWordPolicyAssessment{} - } else { - sv = *v - } - + var uv types.OrchestrationTrace +loop: for key, value := range shape { + if value == nil { + continue + } switch key { - case "customWords": - if err := awsRestjson1_deserializeDocumentGuardrailCustomWordList(&sv.CustomWords, value); err != nil { + case "invocationInput": + var mv types.InvocationInput + destAddr := &mv + if err := awsRestjson1_deserializeDocumentInvocationInput(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.OrchestrationTraceMemberInvocationInput{Value: mv} + break loop + + case "modelInvocationInput": + var mv types.ModelInvocationInput + destAddr := &mv + if err := awsRestjson1_deserializeDocumentModelInvocationInput(&destAddr, value); err != nil { return err } + mv = *destAddr + uv = &types.OrchestrationTraceMemberModelInvocationInput{Value: mv} + break loop - case "managedWordLists": - if err := awsRestjson1_deserializeDocumentGuardrailManagedWordList(&sv.ManagedWordLists, value); err != nil { + case "observation": + var mv types.Observation + destAddr := &mv + if err := awsRestjson1_deserializeDocumentObservation(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.OrchestrationTraceMemberObservation{Value: mv} + break loop + + case "rationale": + var mv types.Rationale + destAddr := &mv + if err := awsRestjson1_deserializeDocumentRationale(&destAddr, value); err != nil { return err } + mv = *destAddr + uv = &types.OrchestrationTraceMemberRationale{Value: mv} + break loop default: - _, _ = key, value + uv = &types.UnknownUnionMember{Tag: key} + break loop } } - *v = sv + *v = uv return nil } -func awsRestjson1_deserializeDocumentInferenceConfiguration(v **types.InferenceConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentOutputFile(v **types.OutputFile, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2883,112 +4161,44 @@ func awsRestjson1_deserializeDocumentInferenceConfiguration(v **types.InferenceC return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InferenceConfiguration + var sv *types.OutputFile if *v == nil { - sv = &types.InferenceConfiguration{} + sv = &types.OutputFile{} } else { sv = *v } for key, value := range shape { switch key { - case "maximumLength": + case "bytes": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MaximumLength to be json.Number, got %T instead", value) + return fmt.Errorf("expected FileBody to be []byte, got %T instead", value) } - i64, err := jtv.Int64() + dv, err := base64.StdEncoding.DecodeString(jtv) if err != nil { - return err - } - sv.MaximumLength = ptr.Int32(int32(i64)) - } - - case "stopSequences": - if err := awsRestjson1_deserializeDocumentStopSequences(&sv.StopSequences, value); err != nil { - return err - } - - case "temperature": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Temperature = ptr.Float32(float32(f64)) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.Temperature = ptr.Float32(float32(f64)) - - default: - return fmt.Errorf("expected Temperature to be a JSON Number, got %T instead", value) - + return fmt.Errorf("failed to base64 decode FileBody, %w", err) } + sv.Bytes = dv } - case "topK": + case "name": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TopK to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.TopK = ptr.Int32(int32(i64)) + sv.Name = ptr.String(jtv) } - case "topP": + case "type": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.TopP = ptr.Float32(float32(f64)) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.TopP = ptr.Float32(float32(f64)) - - default: - return fmt.Errorf("expected TopP to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MimeType to be of type string, got %T instead", value) } + sv.Type = ptr.String(jtv) } default: @@ -3000,47 +4210,41 @@ func awsRestjson1_deserializeDocumentInferenceConfiguration(v **types.InferenceC return nil } -func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { +func awsRestjson1_deserializeDocumentOutputFiles(v *[]types.OutputFile, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InternalServerException - if *v == nil { - sv = &types.InternalServerException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } + return nil + } - default: - _, _ = key, value + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var cv []types.OutputFile + if *v == nil { + cv = []types.OutputFile{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OutputFile + destAddr := &col + if err := awsRestjson1_deserializeDocumentOutputFile(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentInvocationInput(v **types.InvocationInput, value interface{}) error { +func awsRestjson1_deserializeDocumentParameter(v **types.Parameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3053,41 +4257,40 @@ func awsRestjson1_deserializeDocumentInvocationInput(v **types.InvocationInput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvocationInput + var sv *types.Parameter if *v == nil { - sv = &types.InvocationInput{} + sv = &types.Parameter{} } else { sv = *v } for key, value := range shape { switch key { - case "actionGroupInvocationInput": - if err := awsRestjson1_deserializeDocumentActionGroupInvocationInput(&sv.ActionGroupInvocationInput, value); err != nil { - return err - } - - case "invocationType": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected InvocationType to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.InvocationType = types.InvocationType(jtv) + sv.Name = ptr.String(jtv) } - case "knowledgeBaseLookupInput": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseLookupInput(&sv.KnowledgeBaseLookupInput, value); err != nil { - return err + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) } - case "traceId": + case "value": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.TraceId = ptr.String(jtv) + sv.Value = ptr.String(jtv) } default: @@ -3099,7 +4302,7 @@ func awsRestjson1_deserializeDocumentInvocationInput(v **types.InvocationInput, return nil } -func awsRestjson1_deserializeDocumentInvocationInputMember(v *types.InvocationInputMember, value interface{}) error { +func awsRestjson1_deserializeDocumentParameterList(v *[]types.Parameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3107,49 +4310,33 @@ func awsRestjson1_deserializeDocumentInvocationInputMember(v *types.InvocationIn return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var uv types.InvocationInputMember -loop: - for key, value := range shape { - if value == nil { - continue - } - switch key { - case "apiInvocationInput": - var mv types.ApiInvocationInput - destAddr := &mv - if err := awsRestjson1_deserializeDocumentApiInvocationInput(&destAddr, value); err != nil { - return err - } - mv = *destAddr - uv = &types.InvocationInputMemberMemberApiInvocationInput{Value: mv} - break loop - - case "functionInvocationInput": - var mv types.FunctionInvocationInput - destAddr := &mv - if err := awsRestjson1_deserializeDocumentFunctionInvocationInput(&destAddr, value); err != nil { - return err - } - mv = *destAddr - uv = &types.InvocationInputMemberMemberFunctionInvocationInput{Value: mv} - break loop - - default: - uv = &types.UnknownUnionMember{Tag: key} - break loop + var cv []types.Parameter + if *v == nil { + cv = []types.Parameter{} + } else { + cv = *v + } + for _, value := range shape { + var col types.Parameter + destAddr := &col + if err := awsRestjson1_deserializeDocumentParameter(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = uv + *v = cv return nil } -func awsRestjson1_deserializeDocumentInvocationInputs(v *[]types.InvocationInputMember, value interface{}) error { +func awsRestjson1_deserializeDocumentParameters(v *[]types.Parameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3162,18 +4349,20 @@ func awsRestjson1_deserializeDocumentInvocationInputs(v *[]types.InvocationInput return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.InvocationInputMember + var cv []types.Parameter if *v == nil { - cv = []types.InvocationInputMember{} + cv = []types.Parameter{} } else { cv = *v } for _, value := range shape { - var col types.InvocationInputMember - if err := awsRestjson1_deserializeDocumentInvocationInputMember(&col, value); err != nil { + var col types.Parameter + destAddr := &col + if err := awsRestjson1_deserializeDocumentParameter(&destAddr, value); err != nil { return err } + col = *destAddr cv = append(cv, col) } @@ -3181,7 +4370,7 @@ func awsRestjson1_deserializeDocumentInvocationInputs(v *[]types.InvocationInput return nil } -func awsRestjson1_deserializeDocumentKnowledgeBaseLookupInput(v **types.KnowledgeBaseLookupInput, value interface{}) error { +func awsRestjson1_deserializeDocumentPayloadPart(v **types.PayloadPart, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3194,31 +4383,31 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseLookupInput(v **types.Knowledg return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KnowledgeBaseLookupInput + var sv *types.PayloadPart if *v == nil { - sv = &types.KnowledgeBaseLookupInput{} + sv = &types.PayloadPart{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBaseId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TraceKnowledgeBaseId to be of type string, got %T instead", value) - } - sv.KnowledgeBaseId = ptr.String(jtv) + case "attribution": + if err := awsRestjson1_deserializeDocumentAttribution(&sv.Attribution, value); err != nil { + return err } - case "text": + case "bytes": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KnowledgeBaseLookupInputString to be of type string, got %T instead", value) + return fmt.Errorf("expected PartBody to be []byte, got %T instead", value) } - sv.Text = ptr.String(jtv) + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode PartBody, %w", err) + } + sv.Bytes = dv } default: @@ -3230,7 +4419,7 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseLookupInput(v **types.Knowledg return nil } -func awsRestjson1_deserializeDocumentKnowledgeBaseLookupOutput(v **types.KnowledgeBaseLookupOutput, value interface{}) error { +func awsRestjson1_deserializeDocumentPostProcessingModelInvocationOutput(v **types.PostProcessingModelInvocationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3243,20 +4432,29 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseLookupOutput(v **types.Knowled return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KnowledgeBaseLookupOutput + var sv *types.PostProcessingModelInvocationOutput if *v == nil { - sv = &types.KnowledgeBaseLookupOutput{} + sv = &types.PostProcessingModelInvocationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "retrievedReferences": - if err := awsRestjson1_deserializeDocumentRetrievedReferences(&sv.RetrievedReferences, value); err != nil { + case "parsedResponse": + if err := awsRestjson1_deserializeDocumentPostProcessingParsedResponse(&sv.ParsedResponse, value); err != nil { return err } + case "traceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) + } + sv.TraceId = ptr.String(jtv) + } + default: _, _ = key, value @@ -3266,7 +4464,7 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseLookupOutput(v **types.Knowled return nil } -func awsRestjson1_deserializeDocumentModelInvocationInput(v **types.ModelInvocationInput, value interface{}) error { +func awsRestjson1_deserializeDocumentPostProcessingParsedResponse(v **types.PostProcessingParsedResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3279,54 +4477,108 @@ func awsRestjson1_deserializeDocumentModelInvocationInput(v **types.ModelInvocat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ModelInvocationInput + var sv *types.PostProcessingParsedResponse if *v == nil { - sv = &types.ModelInvocationInput{} + sv = &types.PostProcessingParsedResponse{} } else { sv = *v } for key, value := range shape { switch key { - case "inferenceConfiguration": - if err := awsRestjson1_deserializeDocumentInferenceConfiguration(&sv.InferenceConfiguration, value); err != nil { - return err - } - - case "overrideLambda": + case "text": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LambdaArn to be of type string, got %T instead", value) + return fmt.Errorf("expected OutputString to be of type string, got %T instead", value) } - sv.OverrideLambda = ptr.String(jtv) + sv.Text = ptr.String(jtv) } - case "parserMode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CreationMode to be of type string, got %T instead", value) - } - sv.ParserMode = types.CreationMode(jtv) + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPostProcessingTrace(v *types.PostProcessingTrace, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.PostProcessingTrace +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "modelInvocationInput": + var mv types.ModelInvocationInput + destAddr := &mv + if err := awsRestjson1_deserializeDocumentModelInvocationInput(&destAddr, value); err != nil { + return err } + mv = *destAddr + uv = &types.PostProcessingTraceMemberModelInvocationInput{Value: mv} + break loop - case "promptCreationMode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CreationMode to be of type string, got %T instead", value) - } - sv.PromptCreationMode = types.CreationMode(jtv) + case "modelInvocationOutput": + var mv types.PostProcessingModelInvocationOutput + destAddr := &mv + if err := awsRestjson1_deserializeDocumentPostProcessingModelInvocationOutput(&destAddr, value); err != nil { + return err } + mv = *destAddr + uv = &types.PostProcessingTraceMemberModelInvocationOutput{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentPreProcessingModelInvocationOutput(v **types.PreProcessingModelInvocationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - case "text": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PromptText to be of type string, got %T instead", value) - } - sv.Text = ptr.String(jtv) + var sv *types.PreProcessingModelInvocationOutput + if *v == nil { + sv = &types.PreProcessingModelInvocationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "parsedResponse": + if err := awsRestjson1_deserializeDocumentPreProcessingParsedResponse(&sv.ParsedResponse, value); err != nil { + return err } case "traceId": @@ -3338,15 +4590,6 @@ func awsRestjson1_deserializeDocumentModelInvocationInput(v **types.ModelInvocat sv.TraceId = ptr.String(jtv) } - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PromptType to be of type string, got %T instead", value) - } - sv.Type = types.PromptType(jtv) - } - default: _, _ = key, value @@ -3356,7 +4599,7 @@ func awsRestjson1_deserializeDocumentModelInvocationInput(v **types.ModelInvocat return nil } -func awsRestjson1_deserializeDocumentObservation(v **types.Observation, value interface{}) error { +func awsRestjson1_deserializeDocumentPreProcessingParsedResponse(v **types.PreProcessingParsedResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3369,51 +4612,31 @@ func awsRestjson1_deserializeDocumentObservation(v **types.Observation, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Observation + var sv *types.PreProcessingParsedResponse if *v == nil { - sv = &types.Observation{} + sv = &types.PreProcessingParsedResponse{} } else { sv = *v } for key, value := range shape { switch key { - case "actionGroupInvocationOutput": - if err := awsRestjson1_deserializeDocumentActionGroupInvocationOutput(&sv.ActionGroupInvocationOutput, value); err != nil { - return err - } - - case "finalResponse": - if err := awsRestjson1_deserializeDocumentFinalResponse(&sv.FinalResponse, value); err != nil { - return err - } - - case "knowledgeBaseLookupOutput": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseLookupOutput(&sv.KnowledgeBaseLookupOutput, value); err != nil { - return err - } - - case "repromptResponse": - if err := awsRestjson1_deserializeDocumentRepromptResponse(&sv.RepromptResponse, value); err != nil { - return err - } - - case "traceId": + case "isValid": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.TraceId = ptr.String(jtv) + sv.IsValid = ptr.Bool(jtv) } - case "type": + case "rationale": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Type to be of type string, got %T instead", value) + return fmt.Errorf("expected RationaleString to be of type string, got %T instead", value) } - sv.Type = types.Type(jtv) + sv.Rationale = ptr.String(jtv) } default: @@ -3425,7 +4648,7 @@ func awsRestjson1_deserializeDocumentObservation(v **types.Observation, value in return nil } -func awsRestjson1_deserializeDocumentOrchestrationTrace(v *types.OrchestrationTrace, value interface{}) error { +func awsRestjson1_deserializeDocumentPreProcessingTrace(v *types.PreProcessingTrace, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3438,23 +4661,13 @@ func awsRestjson1_deserializeDocumentOrchestrationTrace(v *types.OrchestrationTr return fmt.Errorf("unexpected JSON type %v", value) } - var uv types.OrchestrationTrace + var uv types.PreProcessingTrace loop: for key, value := range shape { if value == nil { continue } switch key { - case "invocationInput": - var mv types.InvocationInput - destAddr := &mv - if err := awsRestjson1_deserializeDocumentInvocationInput(&destAddr, value); err != nil { - return err - } - mv = *destAddr - uv = &types.OrchestrationTraceMemberInvocationInput{Value: mv} - break loop - case "modelInvocationInput": var mv types.ModelInvocationInput destAddr := &mv @@ -3462,27 +4675,17 @@ loop: return err } mv = *destAddr - uv = &types.OrchestrationTraceMemberModelInvocationInput{Value: mv} - break loop - - case "observation": - var mv types.Observation - destAddr := &mv - if err := awsRestjson1_deserializeDocumentObservation(&destAddr, value); err != nil { - return err - } - mv = *destAddr - uv = &types.OrchestrationTraceMemberObservation{Value: mv} + uv = &types.PreProcessingTraceMemberModelInvocationInput{Value: mv} break loop - case "rationale": - var mv types.Rationale + case "modelInvocationOutput": + var mv types.PreProcessingModelInvocationOutput destAddr := &mv - if err := awsRestjson1_deserializeDocumentRationale(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentPreProcessingModelInvocationOutput(&destAddr, value); err != nil { return err } mv = *destAddr - uv = &types.OrchestrationTraceMemberRationale{Value: mv} + uv = &types.PreProcessingTraceMemberModelInvocationOutput{Value: mv} break loop default: @@ -3495,7 +4698,7 @@ loop: return nil } -func awsRestjson1_deserializeDocumentParameter(v **types.Parameter, value interface{}) error { +func awsRestjson1_deserializeDocumentPropertyParameters(v **types.PropertyParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3508,40 +4711,67 @@ func awsRestjson1_deserializeDocumentParameter(v **types.Parameter, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Parameter + var sv *types.PropertyParameters if *v == nil { - sv = &types.Parameter{} + sv = &types.PropertyParameters{} } else { sv = *v } for key, value := range shape { switch key { - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) + case "properties": + if err := awsRestjson1_deserializeDocumentParameterList(&sv.Properties, value); err != nil { + return err } - case "type": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRationale(v **types.Rationale, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Rationale + if *v == nil { + sv = &types.Rationale{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "text": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected RationaleString to be of type string, got %T instead", value) } - sv.Type = ptr.String(jtv) + sv.Text = ptr.String(jtv) } - case "value": + case "traceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) } - sv.Value = ptr.String(jtv) + sv.TraceId = ptr.String(jtv) } default: @@ -3553,7 +4783,7 @@ func awsRestjson1_deserializeDocumentParameter(v **types.Parameter, value interf return nil } -func awsRestjson1_deserializeDocumentParameterList(v *[]types.Parameter, value interface{}) error { +func awsRestjson1_deserializeDocumentRepromptResponse(v **types.RepromptResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3561,33 +4791,48 @@ func awsRestjson1_deserializeDocumentParameterList(v *[]types.Parameter, value i return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Parameter + var sv *types.RepromptResponse if *v == nil { - cv = []types.Parameter{} + sv = &types.RepromptResponse{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.Parameter - destAddr := &col - if err := awsRestjson1_deserializeDocumentParameter(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = types.Source(jtv) + } + + case "text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentParameters(v *[]types.Parameter, value interface{}) error { +func awsRestjson1_deserializeDocumentRequestBody(v **types.RequestBody, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3595,33 +4840,35 @@ func awsRestjson1_deserializeDocumentParameters(v *[]types.Parameter, value inte return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Parameter + var sv *types.RequestBody if *v == nil { - cv = []types.Parameter{} + sv = &types.RequestBody{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.Parameter - destAddr := &col - if err := awsRestjson1_deserializeDocumentParameter(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "content": + if err := awsRestjson1_deserializeDocumentContentMap(&sv.Content, value); err != nil { + return err + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentPayloadPart(v **types.PayloadPart, value interface{}) error { +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3634,31 +4881,22 @@ func awsRestjson1_deserializeDocumentPayloadPart(v **types.PayloadPart, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PayloadPart + var sv *types.ResourceNotFoundException if *v == nil { - sv = &types.PayloadPart{} + sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { - case "attribution": - if err := awsRestjson1_deserializeDocumentAttribution(&sv.Attribution, value); err != nil { - return err - } - - case "bytes": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PartBody to be []byte, got %T instead", value) - } - dv, err := base64.StdEncoding.DecodeString(jtv) - if err != nil { - return fmt.Errorf("failed to base64 decode PartBody, %w", err) + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) } - sv.Bytes = dv + sv.Message = ptr.String(jtv) } default: @@ -3670,7 +4908,7 @@ func awsRestjson1_deserializeDocumentPayloadPart(v **types.PayloadPart, value in return nil } -func awsRestjson1_deserializeDocumentPostProcessingModelInvocationOutput(v **types.PostProcessingModelInvocationOutput, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievalResultConfluenceLocation(v **types.RetrievalResultConfluenceLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3683,27 +4921,22 @@ func awsRestjson1_deserializeDocumentPostProcessingModelInvocationOutput(v **typ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PostProcessingModelInvocationOutput + var sv *types.RetrievalResultConfluenceLocation if *v == nil { - sv = &types.PostProcessingModelInvocationOutput{} + sv = &types.RetrievalResultConfluenceLocation{} } else { sv = *v } for key, value := range shape { switch key { - case "parsedResponse": - if err := awsRestjson1_deserializeDocumentPostProcessingParsedResponse(&sv.ParsedResponse, value); err != nil { - return err - } - - case "traceId": + case "url": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.TraceId = ptr.String(jtv) + sv.Url = ptr.String(jtv) } default: @@ -3715,7 +4948,7 @@ func awsRestjson1_deserializeDocumentPostProcessingModelInvocationOutput(v **typ return nil } -func awsRestjson1_deserializeDocumentPostProcessingParsedResponse(v **types.PostProcessingParsedResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievalResultContent(v **types.RetrievalResultContent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3728,9 +4961,9 @@ func awsRestjson1_deserializeDocumentPostProcessingParsedResponse(v **types.Post return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PostProcessingParsedResponse + var sv *types.RetrievalResultContent if *v == nil { - sv = &types.PostProcessingParsedResponse{} + sv = &types.RetrievalResultContent{} } else { sv = *v } @@ -3741,7 +4974,7 @@ func awsRestjson1_deserializeDocumentPostProcessingParsedResponse(v **types.Post if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected OutputString to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Text = ptr.String(jtv) } @@ -3755,7 +4988,7 @@ func awsRestjson1_deserializeDocumentPostProcessingParsedResponse(v **types.Post return nil } -func awsRestjson1_deserializeDocumentPostProcessingTrace(v *types.PostProcessingTrace, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievalResultLocation(v **types.RetrievalResultLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3768,44 +5001,59 @@ func awsRestjson1_deserializeDocumentPostProcessingTrace(v *types.PostProcessing return fmt.Errorf("unexpected JSON type %v", value) } - var uv types.PostProcessingTrace -loop: + var sv *types.RetrievalResultLocation + if *v == nil { + sv = &types.RetrievalResultLocation{} + } else { + sv = *v + } + for key, value := range shape { - if value == nil { - continue - } switch key { - case "modelInvocationInput": - var mv types.ModelInvocationInput - destAddr := &mv - if err := awsRestjson1_deserializeDocumentModelInvocationInput(&destAddr, value); err != nil { + case "confluenceLocation": + if err := awsRestjson1_deserializeDocumentRetrievalResultConfluenceLocation(&sv.ConfluenceLocation, value); err != nil { return err } - mv = *destAddr - uv = &types.PostProcessingTraceMemberModelInvocationInput{Value: mv} - break loop - case "modelInvocationOutput": - var mv types.PostProcessingModelInvocationOutput - destAddr := &mv - if err := awsRestjson1_deserializeDocumentPostProcessingModelInvocationOutput(&destAddr, value); err != nil { + case "s3Location": + if err := awsRestjson1_deserializeDocumentRetrievalResultS3Location(&sv.S3Location, value); err != nil { + return err + } + + case "salesforceLocation": + if err := awsRestjson1_deserializeDocumentRetrievalResultSalesforceLocation(&sv.SalesforceLocation, value); err != nil { + return err + } + + case "sharePointLocation": + if err := awsRestjson1_deserializeDocumentRetrievalResultSharePointLocation(&sv.SharePointLocation, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetrievalResultLocationType to be of type string, got %T instead", value) + } + sv.Type = types.RetrievalResultLocationType(jtv) + } + + case "webLocation": + if err := awsRestjson1_deserializeDocumentRetrievalResultWebLocation(&sv.WebLocation, value); err != nil { return err } - mv = *destAddr - uv = &types.PostProcessingTraceMemberModelInvocationOutput{Value: mv} - break loop default: - uv = &types.UnknownUnionMember{Tag: key} - break loop + _, _ = key, value } } - *v = uv + *v = sv return nil } -func awsRestjson1_deserializeDocumentPreProcessingModelInvocationOutput(v **types.PreProcessingModelInvocationOutput, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievalResultMetadata(v *map[string]document.Interface, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3818,39 +5066,36 @@ func awsRestjson1_deserializeDocumentPreProcessingModelInvocationOutput(v **type return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PreProcessingModelInvocationOutput + var mv map[string]document.Interface if *v == nil { - sv = &types.PreProcessingModelInvocationOutput{} + mv = map[string]document.Interface{} } else { - sv = *v + mv = *v } for key, value := range shape { - switch key { - case "parsedResponse": - if err := awsRestjson1_deserializeDocumentPreProcessingParsedResponse(&sv.ParsedResponse, value); err != nil { - return err - } - - case "traceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) - } - sv.TraceId = ptr.String(jtv) - } + var parsedVal document.Interface + mapVar := parsedVal + if err := awsRestjson1_deserializeDocumentRetrievalResultMetadataValue(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal - default: - _, _ = key, value + } + *v = mv + return nil +} - } +func awsRestjson1_deserializeDocumentRetrievalResultMetadataValue(v *document.Interface, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) } - *v = sv + *v = internaldocument.NewDocumentUnmarshaler(value) return nil } -func awsRestjson1_deserializeDocumentPreProcessingParsedResponse(v **types.PreProcessingParsedResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievalResultS3Location(v **types.RetrievalResultS3Location, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3863,31 +5108,22 @@ func awsRestjson1_deserializeDocumentPreProcessingParsedResponse(v **types.PrePr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PreProcessingParsedResponse + var sv *types.RetrievalResultS3Location if *v == nil { - sv = &types.PreProcessingParsedResponse{} + sv = &types.RetrievalResultS3Location{} } else { sv = *v } for key, value := range shape { switch key { - case "isValid": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.IsValid = ptr.Bool(jtv) - } - - case "rationale": + case "uri": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RationaleString to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Rationale = ptr.String(jtv) + sv.Uri = ptr.String(jtv) } default: @@ -3899,7 +5135,7 @@ func awsRestjson1_deserializeDocumentPreProcessingParsedResponse(v **types.PrePr return nil } -func awsRestjson1_deserializeDocumentPreProcessingTrace(v *types.PreProcessingTrace, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievalResultSalesforceLocation(v **types.RetrievalResultSalesforceLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3912,44 +5148,34 @@ func awsRestjson1_deserializeDocumentPreProcessingTrace(v *types.PreProcessingTr return fmt.Errorf("unexpected JSON type %v", value) } - var uv types.PreProcessingTrace -loop: + var sv *types.RetrievalResultSalesforceLocation + if *v == nil { + sv = &types.RetrievalResultSalesforceLocation{} + } else { + sv = *v + } + for key, value := range shape { - if value == nil { - continue - } switch key { - case "modelInvocationInput": - var mv types.ModelInvocationInput - destAddr := &mv - if err := awsRestjson1_deserializeDocumentModelInvocationInput(&destAddr, value); err != nil { - return err - } - mv = *destAddr - uv = &types.PreProcessingTraceMemberModelInvocationInput{Value: mv} - break loop - - case "modelInvocationOutput": - var mv types.PreProcessingModelInvocationOutput - destAddr := &mv - if err := awsRestjson1_deserializeDocumentPreProcessingModelInvocationOutput(&destAddr, value); err != nil { - return err + case "url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) } - mv = *destAddr - uv = &types.PreProcessingTraceMemberModelInvocationOutput{Value: mv} - break loop default: - uv = &types.UnknownUnionMember{Tag: key} - break loop + _, _ = key, value } } - *v = uv + *v = sv return nil } -func awsRestjson1_deserializeDocumentPropertyParameters(v **types.PropertyParameters, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievalResultSharePointLocation(v **types.RetrievalResultSharePointLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3962,18 +5188,22 @@ func awsRestjson1_deserializeDocumentPropertyParameters(v **types.PropertyParame return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PropertyParameters + var sv *types.RetrievalResultSharePointLocation if *v == nil { - sv = &types.PropertyParameters{} + sv = &types.RetrievalResultSharePointLocation{} } else { sv = *v } for key, value := range shape { switch key { - case "properties": - if err := awsRestjson1_deserializeDocumentParameterList(&sv.Properties, value); err != nil { - return err + case "url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) } default: @@ -3985,7 +5215,7 @@ func awsRestjson1_deserializeDocumentPropertyParameters(v **types.PropertyParame return nil } -func awsRestjson1_deserializeDocumentRationale(v **types.Rationale, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievalResultWebLocation(v **types.RetrievalResultWebLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3998,31 +5228,22 @@ func awsRestjson1_deserializeDocumentRationale(v **types.Rationale, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Rationale + var sv *types.RetrievalResultWebLocation if *v == nil { - sv = &types.Rationale{} + sv = &types.RetrievalResultWebLocation{} } else { sv = *v } for key, value := range shape { switch key { - case "text": + case "url": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RationaleString to be of type string, got %T instead", value) - } - sv.Text = ptr.String(jtv) - } - - case "traceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.TraceId = ptr.String(jtv) + sv.Url = ptr.String(jtv) } default: @@ -4034,7 +5255,7 @@ func awsRestjson1_deserializeDocumentRationale(v **types.Rationale, value interf return nil } -func awsRestjson1_deserializeDocumentRepromptResponse(v **types.RepromptResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievedReference(v **types.RetrievedReference, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4047,31 +5268,28 @@ func awsRestjson1_deserializeDocumentRepromptResponse(v **types.RepromptResponse return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RepromptResponse + var sv *types.RetrievedReference if *v == nil { - sv = &types.RepromptResponse{} + sv = &types.RetrievedReference{} } else { sv = *v } for key, value := range shape { switch key { - case "source": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Source to be of type string, got %T instead", value) - } - sv.Source = types.Source(jtv) + case "content": + if err := awsRestjson1_deserializeDocumentRetrievalResultContent(&sv.Content, value); err != nil { + return err } - case "text": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Text = ptr.String(jtv) + case "location": + if err := awsRestjson1_deserializeDocumentRetrievalResultLocation(&sv.Location, value); err != nil { + return err + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentRetrievalResultMetadata(&sv.Metadata, value); err != nil { + return err } default: @@ -4083,7 +5301,7 @@ func awsRestjson1_deserializeDocumentRepromptResponse(v **types.RepromptResponse return nil } -func awsRestjson1_deserializeDocumentRequestBody(v **types.RequestBody, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievedReferences(v *[]types.RetrievedReference, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4091,35 +5309,33 @@ func awsRestjson1_deserializeDocumentRequestBody(v **types.RequestBody, value in return nil } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RequestBody - if *v == nil { - sv = &types.RequestBody{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "content": - if err := awsRestjson1_deserializeDocumentContentMap(&sv.Content, value); err != nil { - return err - } + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - default: - _, _ = key, value + var cv []types.RetrievedReference + if *v == nil { + cv = []types.RetrievedReference{} + } else { + cv = *v + } + for _, value := range shape { + var col types.RetrievedReference + destAddr := &col + if err := awsRestjson1_deserializeDocumentRetrievedReference(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { +func awsRestjson1_deserializeDocumentReturnControlPayload(v **types.ReturnControlPayload, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4132,22 +5348,27 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceNotFoundException + var sv *types.ReturnControlPayload if *v == nil { - sv = &types.ResourceNotFoundException{} + sv = &types.ReturnControlPayload{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "invocationId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.InvocationId = ptr.String(jtv) + } + + case "invocationInputs": + if err := awsRestjson1_deserializeDocumentInvocationInputs(&sv.InvocationInputs, value); err != nil { + return err } default: @@ -4159,7 +5380,7 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } -func awsRestjson1_deserializeDocumentRetrievalResultContent(v **types.RetrievalResultContent, value interface{}) error { +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4172,22 +5393,22 @@ func awsRestjson1_deserializeDocumentRetrievalResultContent(v **types.RetrievalR return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RetrievalResultContent + var sv *types.ServiceQuotaExceededException if *v == nil { - sv = &types.RetrievalResultContent{} + sv = &types.ServiceQuotaExceededException{} } else { sv = *v } for key, value := range shape { switch key { - case "text": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) } - sv.Text = ptr.String(jtv) + sv.Message = ptr.String(jtv) } default: @@ -4199,7 +5420,7 @@ func awsRestjson1_deserializeDocumentRetrievalResultContent(v **types.RetrievalR return nil } -func awsRestjson1_deserializeDocumentRetrievalResultLocation(v **types.RetrievalResultLocation, value interface{}) error { +func awsRestjson1_deserializeDocumentSpan(v **types.Span, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4212,27 +5433,39 @@ func awsRestjson1_deserializeDocumentRetrievalResultLocation(v **types.Retrieval return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RetrievalResultLocation + var sv *types.Span if *v == nil { - sv = &types.RetrievalResultLocation{} + sv = &types.Span{} } else { sv = *v } for key, value := range shape { switch key { - case "s3Location": - if err := awsRestjson1_deserializeDocumentRetrievalResultS3Location(&sv.S3Location, value); err != nil { - return err + case "end": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.End = ptr.Int32(int32(i64)) } - case "type": + case "start": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected RetrievalResultLocationType to be of type string, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.Type = types.RetrievalResultLocationType(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Start = ptr.Int32(int32(i64)) } default: @@ -4244,7 +5477,7 @@ func awsRestjson1_deserializeDocumentRetrievalResultLocation(v **types.Retrieval return nil } -func awsRestjson1_deserializeDocumentRetrievalResultMetadata(v *map[string]document.Interface, value interface{}) error { +func awsRestjson1_deserializeDocumentStopSequences(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4252,41 +5485,35 @@ func awsRestjson1_deserializeDocumentRetrievalResultMetadata(v *map[string]docum return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]document.Interface + var cv []string if *v == nil { - mv = map[string]document.Interface{} + cv = []string{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal document.Interface - mapVar := parsedVal - if err := awsRestjson1_deserializeDocumentRetrievalResultMetadataValue(&mapVar, value); err != nil { - return err + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv } - parsedVal = mapVar - mv[key] = parsedVal - - } - *v = mv - return nil -} + cv = append(cv, col) -func awsRestjson1_deserializeDocumentRetrievalResultMetadataValue(v *document.Interface, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) } - *v = internaldocument.NewDocumentUnmarshaler(value) + *v = cv return nil } -func awsRestjson1_deserializeDocumentRetrievalResultS3Location(v **types.RetrievalResultS3Location, value interface{}) error { +func awsRestjson1_deserializeDocumentTextResponsePart(v **types.TextResponsePart, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4299,22 +5526,27 @@ func awsRestjson1_deserializeDocumentRetrievalResultS3Location(v **types.Retriev return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RetrievalResultS3Location + var sv *types.TextResponsePart if *v == nil { - sv = &types.RetrievalResultS3Location{} + sv = &types.TextResponsePart{} } else { sv = *v } for key, value := range shape { switch key { - case "uri": + case "span": + if err := awsRestjson1_deserializeDocumentSpan(&sv.Span, value); err != nil { + return err + } + + case "text": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Uri = ptr.String(jtv) + sv.Text = ptr.String(jtv) } default: @@ -4326,7 +5558,7 @@ func awsRestjson1_deserializeDocumentRetrievalResultS3Location(v **types.Retriev return nil } -func awsRestjson1_deserializeDocumentRetrievedReference(v **types.RetrievedReference, value interface{}) error { +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4339,28 +5571,22 @@ func awsRestjson1_deserializeDocumentRetrievedReference(v **types.RetrievedRefer return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RetrievedReference + var sv *types.ThrottlingException if *v == nil { - sv = &types.RetrievedReference{} + sv = &types.ThrottlingException{} } else { sv = *v } for key, value := range shape { switch key { - case "content": - if err := awsRestjson1_deserializeDocumentRetrievalResultContent(&sv.Content, value); err != nil { - return err - } - - case "location": - if err := awsRestjson1_deserializeDocumentRetrievalResultLocation(&sv.Location, value); err != nil { - return err - } - - case "metadata": - if err := awsRestjson1_deserializeDocumentRetrievalResultMetadata(&sv.Metadata, value); err != nil { - return err + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } default: @@ -4372,7 +5598,7 @@ func awsRestjson1_deserializeDocumentRetrievedReference(v **types.RetrievedRefer return nil } -func awsRestjson1_deserializeDocumentRetrievedReferences(v *[]types.RetrievedReference, value interface{}) error { +func awsRestjson1_deserializeDocumentTrace(v *types.Trace, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4380,78 +5606,73 @@ func awsRestjson1_deserializeDocumentRetrievedReferences(v *[]types.RetrievedRef return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.RetrievedReference - if *v == nil { - cv = []types.RetrievedReference{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RetrievedReference - destAddr := &col - if err := awsRestjson1_deserializeDocumentRetrievedReference(&destAddr, value); err != nil { - return err + var uv types.Trace +loop: + for key, value := range shape { + if value == nil { + continue } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentReturnControlPayload(v **types.ReturnControlPayload, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + switch key { + case "failureTrace": + var mv types.FailureTrace + destAddr := &mv + if err := awsRestjson1_deserializeDocumentFailureTrace(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.TraceMemberFailureTrace{Value: mv} + break loop - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "guardrailTrace": + var mv types.GuardrailTrace + destAddr := &mv + if err := awsRestjson1_deserializeDocumentGuardrailTrace(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.TraceMemberGuardrailTrace{Value: mv} + break loop - var sv *types.ReturnControlPayload - if *v == nil { - sv = &types.ReturnControlPayload{} - } else { - sv = *v - } + case "orchestrationTrace": + var mv types.OrchestrationTrace + if err := awsRestjson1_deserializeDocumentOrchestrationTrace(&mv, value); err != nil { + return err + } + uv = &types.TraceMemberOrchestrationTrace{Value: mv} + break loop - for key, value := range shape { - switch key { - case "invocationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.InvocationId = ptr.String(jtv) + case "postProcessingTrace": + var mv types.PostProcessingTrace + if err := awsRestjson1_deserializeDocumentPostProcessingTrace(&mv, value); err != nil { + return err } + uv = &types.TraceMemberPostProcessingTrace{Value: mv} + break loop - case "invocationInputs": - if err := awsRestjson1_deserializeDocumentInvocationInputs(&sv.InvocationInputs, value); err != nil { + case "preProcessingTrace": + var mv types.PreProcessingTrace + if err := awsRestjson1_deserializeDocumentPreProcessingTrace(&mv, value); err != nil { return err } + uv = &types.TraceMemberPreProcessingTrace{Value: mv} + break loop default: - _, _ = key, value + uv = &types.UnknownUnionMember{Tag: key} + break loop } } - *v = sv + *v = uv return nil } -func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { +func awsRestjson1_deserializeDocumentTracePart(v **types.TracePart, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4464,22 +5685,54 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ServiceQuotaExceededException + var sv *types.TracePart if *v == nil { - sv = &types.ServiceQuotaExceededException{} + sv = &types.TracePart{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "agentAliasId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + return fmt.Errorf("expected AgentAliasId to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.AgentAliasId = ptr.String(jtv) + } + + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentId to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) + } + + case "agentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentVersion to be of type string, got %T instead", value) + } + sv.AgentVersion = ptr.String(jtv) + } + + case "sessionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SessionId to be of type string, got %T instead", value) + } + sv.SessionId = ptr.String(jtv) + } + + case "trace": + if err := awsRestjson1_deserializeDocumentTrace(&sv.Trace, value); err != nil { + return err } default: @@ -4491,7 +5744,7 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } -func awsRestjson1_deserializeDocumentSpan(v **types.Span, value interface{}) error { +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4504,39 +5757,22 @@ func awsRestjson1_deserializeDocumentSpan(v **types.Span, value interface{}) err return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Span + var sv *types.ValidationException if *v == nil { - sv = &types.Span{} + sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { - case "end": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.End = ptr.Int32(int32(i64)) - } - - case "start": + case "message": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) } - sv.Start = ptr.Int32(int32(i64)) + sv.Message = ptr.String(jtv) } default: @@ -4548,88 +5784,186 @@ func awsRestjson1_deserializeDocumentSpan(v **types.Span, value interface{}) err return nil } -func awsRestjson1_deserializeDocumentStopSequences(v *[]string, value interface{}) error { +func awsRestjson1_deserializeEventStreamFlowResponseStream(v *types.FlowResponseStream, msg *eventstream.Message) error { if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) + return fmt.Errorf("unexpected serialization of nil %T", v) } - if value == nil { - return nil + + eventType := msg.Headers.Get(eventstreamapi.EventTypeHeader) + if eventType == nil { + return fmt.Errorf("%s event header not present", eventstreamapi.EventTypeHeader) } - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) + switch { + case strings.EqualFold("flowCompletionEvent", eventType.String()): + vv := &types.FlowResponseStreamMemberFlowCompletionEvent{} + if err := awsRestjson1_deserializeEventMessageFlowCompletionEvent(&vv.Value, msg); err != nil { + return err + } + *v = vv + return nil + + case strings.EqualFold("flowOutputEvent", eventType.String()): + vv := &types.FlowResponseStreamMemberFlowOutputEvent{} + if err := awsRestjson1_deserializeEventMessageFlowOutputEvent(&vv.Value, msg); err != nil { + return err + } + *v = vv + return nil + + default: + buffer := bytes.NewBuffer(nil) + eventstream.NewEncoder().Encode(buffer, *msg) + *v = &types.UnknownUnionMember{ + Tag: eventType.String(), + Value: buffer.Bytes(), + } + return nil + } +} - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v +func awsRestjson1_deserializeEventStreamExceptionFlowResponseStream(msg *eventstream.Message) error { + exceptionType := msg.Headers.Get(eventstreamapi.ExceptionTypeHeader) + if exceptionType == nil { + return fmt.Errorf("%s event header not present", eventstreamapi.ExceptionTypeHeader) } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - col = jtv + switch { + case strings.EqualFold("accessDeniedException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionAccessDeniedException(msg) + + case strings.EqualFold("badGatewayException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionBadGatewayException(msg) + + case strings.EqualFold("conflictException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionConflictException(msg) + + case strings.EqualFold("dependencyFailedException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionDependencyFailedException(msg) + + case strings.EqualFold("internalServerException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionInternalServerException(msg) + + case strings.EqualFold("resourceNotFoundException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionResourceNotFoundException(msg) + + case strings.EqualFold("serviceQuotaExceededException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionServiceQuotaExceededException(msg) + + case strings.EqualFold("throttlingException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionThrottlingException(msg) + + case strings.EqualFold("validationException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionValidationException(msg) + + default: + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + return err + } + errorCode := "UnknownError" + errorMessage := errorCode + if ev := exceptionType.String(); len(ev) > 0 { + errorCode = ev + } else if ev := code; len(ev) > 0 { + errorCode = ev + } + if ev := message; len(ev) > 0 { + errorMessage = ev + } + return &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - cv = append(cv, col) } - *v = cv - return nil } -func awsRestjson1_deserializeDocumentTextResponsePart(v **types.TextResponsePart, value interface{}) error { +func awsRestjson1_deserializeEventMessageFlowOutputEvent(v *types.FlowOutputEvent, msg *eventstream.Message) error { if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil + return fmt.Errorf("unexpected serialization of nil %T", v) } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) - var sv *types.TextResponsePart - if *v == nil { - sv = &types.TextResponsePart{} - } else { - sv = *v + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err } - for key, value := range shape { - switch key { - case "span": - if err := awsRestjson1_deserializeDocumentSpan(&sv.Span, value); err != nil { - return err + if err := awsRestjson1_deserializeDocumentFlowOutputEvent(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } + return err + } - case "text": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Text = ptr.String(jtv) - } + } + return nil +} - default: - _, _ = key, value +func awsRestjson1_deserializeEventMessageFlowCompletionEvent(v *types.FlowCompletionEvent, msg *eventstream.Message) error { + if v == nil { + return fmt.Errorf("unexpected serialization of nil %T", v) + } + + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + if err := awsRestjson1_deserializeDocumentFlowCompletionEvent(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err } + } - *v = sv return nil } -func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { +func awsRestjson1_deserializeDocumentFlowCompletionEvent(v **types.FlowCompletionEvent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4642,22 +5976,22 @@ func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingExc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ThrottlingException + var sv *types.FlowCompletionEvent if *v == nil { - sv = &types.ThrottlingException{} + sv = &types.FlowCompletionEvent{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "completionReason": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + return fmt.Errorf("expected FlowCompletionReason to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.CompletionReason = types.FlowCompletionReason(jtv) } default: @@ -4669,7 +6003,7 @@ func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingExc return nil } -func awsRestjson1_deserializeDocumentTrace(v *types.Trace, value interface{}) error { +func awsRestjson1_deserializeDocumentFlowOutputContent(v *types.FlowOutputContent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4682,55 +6016,19 @@ func awsRestjson1_deserializeDocumentTrace(v *types.Trace, value interface{}) er return fmt.Errorf("unexpected JSON type %v", value) } - var uv types.Trace + var uv types.FlowOutputContent loop: for key, value := range shape { if value == nil { continue } switch key { - case "failureTrace": - var mv types.FailureTrace - destAddr := &mv - if err := awsRestjson1_deserializeDocumentFailureTrace(&destAddr, value); err != nil { - return err - } - mv = *destAddr - uv = &types.TraceMemberFailureTrace{Value: mv} - break loop - - case "guardrailTrace": - var mv types.GuardrailTrace - destAddr := &mv - if err := awsRestjson1_deserializeDocumentGuardrailTrace(&destAddr, value); err != nil { - return err - } - mv = *destAddr - uv = &types.TraceMemberGuardrailTrace{Value: mv} - break loop - - case "orchestrationTrace": - var mv types.OrchestrationTrace - if err := awsRestjson1_deserializeDocumentOrchestrationTrace(&mv, value); err != nil { - return err - } - uv = &types.TraceMemberOrchestrationTrace{Value: mv} - break loop - - case "postProcessingTrace": - var mv types.PostProcessingTrace - if err := awsRestjson1_deserializeDocumentPostProcessingTrace(&mv, value); err != nil { - return err - } - uv = &types.TraceMemberPostProcessingTrace{Value: mv} - break loop - - case "preProcessingTrace": - var mv types.PreProcessingTrace - if err := awsRestjson1_deserializeDocumentPreProcessingTrace(&mv, value); err != nil { + case "document": + var mv document.Interface + if err := awsRestjson1_deserializeDocumentDocument(&mv, value); err != nil { return err } - uv = &types.TraceMemberPreProcessingTrace{Value: mv} + uv = &types.FlowOutputContentMemberDocument{Value: mv} break loop default: @@ -4743,7 +6041,7 @@ loop: return nil } -func awsRestjson1_deserializeDocumentTracePart(v **types.TracePart, value interface{}) error { +func awsRestjson1_deserializeDocumentFlowOutputEvent(v **types.FlowOutputEvent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4756,54 +6054,36 @@ func awsRestjson1_deserializeDocumentTracePart(v **types.TracePart, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.TracePart + var sv *types.FlowOutputEvent if *v == nil { - sv = &types.TracePart{} + sv = &types.FlowOutputEvent{} } else { sv = *v } for key, value := range shape { switch key { - case "agentAliasId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AgentAliasId to be of type string, got %T instead", value) - } - sv.AgentAliasId = ptr.String(jtv) - } - - case "agentId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AgentId to be of type string, got %T instead", value) - } - sv.AgentId = ptr.String(jtv) + case "content": + if err := awsRestjson1_deserializeDocumentFlowOutputContent(&sv.Content, value); err != nil { + return err } - case "agentVersion": + case "nodeName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AgentVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected NodeName to be of type string, got %T instead", value) } - sv.AgentVersion = ptr.String(jtv) + sv.NodeName = ptr.String(jtv) } - case "sessionId": + case "nodeType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SessionId to be of type string, got %T instead", value) + return fmt.Errorf("expected NodeType to be of type string, got %T instead", value) } - sv.SessionId = ptr.String(jtv) - } - - case "trace": - if err := awsRestjson1_deserializeDocumentTrace(&sv.Trace, value); err != nil { - return err + sv.NodeType = types.NodeType(jtv) } default: @@ -4815,43 +6095,11 @@ func awsRestjson1_deserializeDocumentTracePart(v **types.TracePart, value interf return nil } -func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { +func awsRestjson1_deserializeDocumentDocument(v *document.Interface, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ValidationException - if *v == nil { - sv = &types.ValidationException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv + *v = internaldocument.NewDocumentUnmarshaler(value) return nil } @@ -5293,6 +6541,162 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseRetrievalResults(v *[]types.Kn return nil } +func awsRestjson1_deserializeDocumentMemories(v *[]types.Memory, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Memory + if *v == nil { + cv = []types.Memory{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Memory + if err := awsRestjson1_deserializeDocumentMemory(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentMemory(v *types.Memory, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.Memory +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "sessionSummary": + var mv types.MemorySessionSummary + destAddr := &mv + if err := awsRestjson1_deserializeDocumentMemorySessionSummary(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.MemoryMemberSessionSummary{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentMemorySessionSummary(v **types.MemorySessionSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MemorySessionSummary + if *v == nil { + sv = &types.MemorySessionSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "memoryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MemoryId to be of type string, got %T instead", value) + } + sv.MemoryId = ptr.String(jtv) + } + + case "sessionExpiryTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.SessionExpiryTime = ptr.Time(t) + } + + case "sessionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SessionId to be of type string, got %T instead", value) + } + sv.SessionId = ptr.String(jtv) + } + + case "sessionStartTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTimestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.SessionStartTime = ptr.Time(t) + } + + case "summaryText": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SummaryText to be of type string, got %T instead", value) + } + sv.SummaryText = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentRetrieveAndGenerateOutput(v **types.RetrieveAndGenerateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/bedrockagentruntime/eventstream.go b/service/bedrockagentruntime/eventstream.go index 5086a2334e2..8da2718f9af 100644 --- a/service/bedrockagentruntime/eventstream.go +++ b/service/bedrockagentruntime/eventstream.go @@ -18,6 +18,16 @@ import ( "sync" ) +// FlowResponseStreamReader provides the interface for reading events from a +// stream. +// +// The writer's Close method must allow multiple concurrent calls. +type FlowResponseStreamReader interface { + Events() <-chan types.FlowResponseStream + Close() error + Err() error +} + // ResponseStreamReader provides the interface for reading events from a stream. // // The writer's Close method must allow multiple concurrent calls. @@ -155,6 +165,134 @@ func (r *responseStreamReader) Closed() <-chan struct{} { return r.done } +type flowResponseStreamReader struct { + stream chan types.FlowResponseStream + decoder *eventstream.Decoder + eventStream io.ReadCloser + err *smithysync.OnceErr + payloadBuf []byte + done chan struct{} + closeOnce sync.Once +} + +func newFlowResponseStreamReader(readCloser io.ReadCloser, decoder *eventstream.Decoder) *flowResponseStreamReader { + w := &flowResponseStreamReader{ + stream: make(chan types.FlowResponseStream), + decoder: decoder, + eventStream: readCloser, + err: smithysync.NewOnceErr(), + done: make(chan struct{}), + payloadBuf: make([]byte, 10*1024), + } + + go w.readEventStream() + + return w +} + +func (r *flowResponseStreamReader) Events() <-chan types.FlowResponseStream { + return r.stream +} + +func (r *flowResponseStreamReader) readEventStream() { + defer r.Close() + defer close(r.stream) + + for { + r.payloadBuf = r.payloadBuf[0:0] + decodedMessage, err := r.decoder.Decode(r.eventStream, r.payloadBuf) + if err != nil { + if err == io.EOF { + return + } + select { + case <-r.done: + return + default: + r.err.SetError(err) + return + } + } + + event, err := r.deserializeEventMessage(&decodedMessage) + if err != nil { + r.err.SetError(err) + return + } + + select { + case r.stream <- event: + case <-r.done: + return + } + + } +} + +func (r *flowResponseStreamReader) deserializeEventMessage(msg *eventstream.Message) (types.FlowResponseStream, error) { + messageType := msg.Headers.Get(eventstreamapi.MessageTypeHeader) + if messageType == nil { + return nil, fmt.Errorf("%s event header not present", eventstreamapi.MessageTypeHeader) + } + + switch messageType.String() { + case eventstreamapi.EventMessageType: + var v types.FlowResponseStream + if err := awsRestjson1_deserializeEventStreamFlowResponseStream(&v, msg); err != nil { + return nil, err + } + return v, nil + + case eventstreamapi.ExceptionMessageType: + return nil, awsRestjson1_deserializeEventStreamExceptionFlowResponseStream(msg) + + case eventstreamapi.ErrorMessageType: + errorCode := "UnknownError" + errorMessage := errorCode + if header := msg.Headers.Get(eventstreamapi.ErrorCodeHeader); header != nil { + errorCode = header.String() + } + if header := msg.Headers.Get(eventstreamapi.ErrorMessageHeader); header != nil { + errorMessage = header.String() + } + return nil, &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + + default: + mc := msg.Clone() + return nil, &UnknownEventMessageError{ + Type: messageType.String(), + Message: &mc, + } + + } +} + +func (r *flowResponseStreamReader) ErrorSet() <-chan struct{} { + return r.err.ErrorSet() +} + +func (r *flowResponseStreamReader) Close() error { + r.closeOnce.Do(r.safeClose) + return r.Err() +} + +func (r *flowResponseStreamReader) safeClose() { + close(r.done) + r.eventStream.Close() + +} + +func (r *flowResponseStreamReader) Err() error { + return r.err.Err() +} + +func (r *flowResponseStreamReader) Closed() <-chan struct{} { + return r.done +} + type awsRestjson1_deserializeOpEventStreamInvokeAgent struct { LogEventStreamWrites bool LogEventStreamReads bool @@ -243,6 +381,94 @@ func addEventStreamInvokeAgentMiddleware(stack *middleware.Stack, options Option } +type awsRestjson1_deserializeOpEventStreamInvokeFlow struct { + LogEventStreamWrites bool + LogEventStreamReads bool +} + +func (*awsRestjson1_deserializeOpEventStreamInvokeFlow) ID() string { + return "OperationEventStreamDeserializer" +} + +func (m *awsRestjson1_deserializeOpEventStreamInvokeFlow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + defer func() { + if err == nil { + return + } + m.closeResponseBody(out) + }() + + logger := middleware.GetLogger(ctx) + + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type: %T", in.Request) + } + _ = request + + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + deserializeOutput, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type: %T", out.RawResponse) + } + _ = deserializeOutput + + output, ok := out.Result.(*InvokeFlowOutput) + if out.Result != nil && !ok { + return out, metadata, fmt.Errorf("unexpected output result type: %T", out.Result) + } else if out.Result == nil { + output = &InvokeFlowOutput{} + out.Result = output + } + + eventReader := newFlowResponseStreamReader( + deserializeOutput.Body, + eventstream.NewDecoder(func(options *eventstream.DecoderOptions) { + options.Logger = logger + options.LogMessages = m.LogEventStreamReads + + }), + ) + defer func() { + if err == nil { + return + } + _ = eventReader.Close() + }() + + output.eventStream = NewInvokeFlowEventStream(func(stream *InvokeFlowEventStream) { + stream.Reader = eventReader + }) + + go output.eventStream.waitStreamClose() + + return out, metadata, nil +} + +func (*awsRestjson1_deserializeOpEventStreamInvokeFlow) closeResponseBody(out middleware.DeserializeOutput) { + if resp, ok := out.RawResponse.(*smithyhttp.Response); ok && resp != nil && resp.Body != nil { + _, _ = io.Copy(ioutil.Discard, resp.Body) + _ = resp.Body.Close() + } +} + +func addEventStreamInvokeFlowMiddleware(stack *middleware.Stack, options Options) error { + if err := stack.Deserialize.Insert(&awsRestjson1_deserializeOpEventStreamInvokeFlow{ + LogEventStreamWrites: options.ClientLogMode.IsRequestEventMessage(), + LogEventStreamReads: options.ClientLogMode.IsResponseEventMessage(), + }, "OperationDeserializer", middleware.Before); err != nil { + return err + } + return nil + +} + // UnknownEventMessageError provides an error when a message is received from the stream, // but the reader is unable to determine what kind of message it is. type UnknownEventMessageError struct { @@ -261,6 +487,10 @@ func setSafeEventStreamClientLogMode(o *Options, operation string) { toggleEventStreamClientLogMode(o, false, true) return + case "InvokeFlow": + toggleEventStreamClientLogMode(o, false, true) + return + default: return diff --git a/service/bedrockagentruntime/generated.json b/service/bedrockagentruntime/generated.json index 502694e6670..25281b57a5b 100644 --- a/service/bedrockagentruntime/generated.json +++ b/service/bedrockagentruntime/generated.json @@ -9,7 +9,10 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_DeleteAgentMemory.go", + "api_op_GetAgentMemory.go", "api_op_InvokeAgent.go", + "api_op_InvokeFlow.go", "api_op_Retrieve.go", "api_op_RetrieveAndGenerate.go", "auth.go", diff --git a/service/bedrockagentruntime/serializers.go b/service/bedrockagentruntime/serializers.go index bdc929a034f..b58ab3a08e7 100644 --- a/service/bedrockagentruntime/serializers.go +++ b/service/bedrockagentruntime/serializers.go @@ -17,6 +17,174 @@ import ( "math" ) +type awsRestjson1_serializeOpDeleteAgentMemory struct { +} + +func (*awsRestjson1_serializeOpDeleteAgentMemory) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAgentMemory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAgentMemoryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentAliases/{agentAliasId}/memories") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteAgentMemoryInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteAgentMemoryInput(v *DeleteAgentMemoryInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AgentAliasId == nil || len(*v.AgentAliasId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentAliasId must not be empty")} + } + if v.AgentAliasId != nil { + if err := encoder.SetURI("agentAliasId").String(*v.AgentAliasId); err != nil { + return err + } + } + + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + } + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + return err + } + } + + if v.MemoryId != nil { + encoder.SetQuery("memoryId").String(*v.MemoryId) + } + + return nil +} + +type awsRestjson1_serializeOpGetAgentMemory struct { +} + +func (*awsRestjson1_serializeOpGetAgentMemory) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetAgentMemory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetAgentMemoryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/agents/{agentId}/agentAliases/{agentAliasId}/memories") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetAgentMemoryInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetAgentMemoryInput(v *GetAgentMemoryInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AgentAliasId == nil || len(*v.AgentAliasId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentAliasId must not be empty")} + } + if v.AgentAliasId != nil { + if err := encoder.SetURI("agentAliasId").String(*v.AgentAliasId); err != nil { + return err + } + } + + if v.AgentId == nil || len(*v.AgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member agentId must not be empty")} + } + if v.AgentId != nil { + if err := encoder.SetURI("agentId").String(*v.AgentId); err != nil { + return err + } + } + + if v.MaxItems != nil { + encoder.SetQuery("maxItems").Integer(*v.MaxItems) + } + + if v.MemoryId != nil { + encoder.SetQuery("memoryId").String(*v.MemoryId) + } + + if len(v.MemoryType) > 0 { + encoder.SetQuery("memoryType").String(string(v.MemoryType)) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpInvokeAgent struct { } @@ -130,6 +298,11 @@ func awsRestjson1_serializeOpDocumentInvokeAgentInput(v *InvokeAgentInput, value ok.String(*v.InputText) } + if v.MemoryId != nil { + ok := object.Key("memoryId") + ok.String(*v.MemoryId) + } + if v.SessionState != nil { ok := object.Key("sessionState") if err := awsRestjson1_serializeDocumentSessionState(v.SessionState, ok); err != nil { @@ -140,6 +313,105 @@ func awsRestjson1_serializeOpDocumentInvokeAgentInput(v *InvokeAgentInput, value return nil } +type awsRestjson1_serializeOpInvokeFlow struct { +} + +func (*awsRestjson1_serializeOpInvokeFlow) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpInvokeFlow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*InvokeFlowInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsInvokeFlowInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentInvokeFlowInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsInvokeFlowInput(v *InvokeFlowInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FlowAliasIdentifier == nil || len(*v.FlowAliasIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowAliasIdentifier must not be empty")} + } + if v.FlowAliasIdentifier != nil { + if err := encoder.SetURI("flowAliasIdentifier").String(*v.FlowAliasIdentifier); err != nil { + return err + } + } + + if v.FlowIdentifier == nil || len(*v.FlowIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member flowIdentifier must not be empty")} + } + if v.FlowIdentifier != nil { + if err := encoder.SetURI("flowIdentifier").String(*v.FlowIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentInvokeFlowInput(v *InvokeFlowInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Inputs != nil { + ok := object.Key("inputs") + if err := awsRestjson1_serializeDocumentFlowInputs(v.Inputs, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpRetrieve struct { } @@ -430,6 +702,23 @@ func awsRestjson1_serializeDocumentByteContentDoc(v *types.ByteContentDoc, value return nil } +func awsRestjson1_serializeDocumentByteContentFile(v *types.ByteContentFile, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Data != nil { + ok := object.Key("data") + ok.Base64EncodeBytes(v.Data) + } + + if v.MediaType != nil { + ok := object.Key("mediaType") + ok.String(*v.MediaType) + } + + return nil +} + func awsRestjson1_serializeDocumentContentBody(v *types.ContentBody, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -542,6 +831,32 @@ func awsRestjson1_serializeDocumentExternalSourcesRetrieveAndGenerateConfigurati return nil } +func awsRestjson1_serializeDocumentFileSource(v *types.FileSource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ByteContent != nil { + ok := object.Key("byteContent") + if err := awsRestjson1_serializeDocumentByteContentFile(v.ByteContent, ok); err != nil { + return err + } + } + + if v.S3Location != nil { + ok := object.Key("s3Location") + if err := awsRestjson1_serializeDocumentS3ObjectFile(v.S3Location, ok); err != nil { + return err + } + } + + if len(v.SourceType) > 0 { + ok := object.Key("sourceType") + ok.String(string(v.SourceType)) + } + + return nil +} + func awsRestjson1_serializeDocumentFilterAttribute(v *types.FilterAttribute, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -576,6 +891,61 @@ func awsRestjson1_serializeDocumentFilterValue(v document.Interface, value smith return nil } +func awsRestjson1_serializeDocumentFlowInput(v *types.FlowInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Content != nil { + ok := object.Key("content") + if err := awsRestjson1_serializeDocumentFlowInputContent(v.Content, ok); err != nil { + return err + } + } + + if v.NodeName != nil { + ok := object.Key("nodeName") + ok.String(*v.NodeName) + } + + if v.NodeOutputName != nil { + ok := object.Key("nodeOutputName") + ok.String(*v.NodeOutputName) + } + + return nil +} + +func awsRestjson1_serializeDocumentFlowInputContent(v types.FlowInputContent, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.FlowInputContentMemberDocument: + av := object.Key("document") + if err := awsRestjson1_serializeDocumentDocument(uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentFlowInputs(v []types.FlowInput, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFlowInput(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentFunctionResult(v *types.FunctionResult, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -671,6 +1041,43 @@ func awsRestjson1_serializeDocumentInferenceConfig(v *types.InferenceConfig, val return nil } +func awsRestjson1_serializeDocumentInputFile(v *types.InputFile, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Source != nil { + ok := object.Key("source") + if err := awsRestjson1_serializeDocumentFileSource(v.Source, ok); err != nil { + return err + } + } + + if len(v.UseCase) > 0 { + ok := object.Key("useCase") + ok.String(string(v.UseCase)) + } + + return nil +} + +func awsRestjson1_serializeDocumentInputFiles(v []types.InputFile, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentInputFile(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentInvocationResultMember(v types.InvocationResultMember, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -695,6 +1102,38 @@ func awsRestjson1_serializeDocumentInvocationResultMember(v types.InvocationResu return nil } +func awsRestjson1_serializeDocumentKnowledgeBaseConfiguration(v *types.KnowledgeBaseConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KnowledgeBaseId != nil { + ok := object.Key("knowledgeBaseId") + ok.String(*v.KnowledgeBaseId) + } + + if v.RetrievalConfiguration != nil { + ok := object.Key("retrievalConfiguration") + if err := awsRestjson1_serializeDocumentKnowledgeBaseRetrievalConfiguration(v.RetrievalConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentKnowledgeBaseConfigurations(v []types.KnowledgeBaseConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentKnowledgeBaseConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentKnowledgeBaseQuery(v *types.KnowledgeBaseQuery, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -742,6 +1181,13 @@ func awsRestjson1_serializeDocumentKnowledgeBaseRetrieveAndGenerateConfiguration ok.String(*v.ModelArn) } + if v.OrchestrationConfiguration != nil { + ok := object.Key("orchestrationConfiguration") + if err := awsRestjson1_serializeDocumentOrchestrationConfiguration(v.OrchestrationConfiguration, ok); err != nil { + return err + } + } + if v.RetrievalConfiguration != nil { ok := object.Key("retrievalConfiguration") if err := awsRestjson1_serializeDocumentKnowledgeBaseRetrievalConfiguration(v.RetrievalConfiguration, ok); err != nil { @@ -776,6 +1222,20 @@ func awsRestjson1_serializeDocumentKnowledgeBaseVectorSearchConfiguration(v *typ return nil } +func awsRestjson1_serializeDocumentOrchestrationConfiguration(v *types.OrchestrationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.QueryTransformationConfiguration != nil { + ok := object.Key("queryTransformationConfiguration") + if err := awsRestjson1_serializeDocumentQueryTransformationConfiguration(v.QueryTransformationConfiguration, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentPromptSessionAttributesMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -799,6 +1259,18 @@ func awsRestjson1_serializeDocumentPromptTemplate(v *types.PromptTemplate, value return nil } +func awsRestjson1_serializeDocumentQueryTransformationConfiguration(v *types.QueryTransformationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + func awsRestjson1_serializeDocumentRAGStopSequences(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1008,6 +1480,18 @@ func awsRestjson1_serializeDocumentS3ObjectDoc(v *types.S3ObjectDoc, value smith return nil } +func awsRestjson1_serializeDocumentS3ObjectFile(v *types.S3ObjectFile, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Uri != nil { + ok := object.Key("uri") + ok.String(*v.Uri) + } + + return nil +} + func awsRestjson1_serializeDocumentSessionAttributesMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1023,11 +1507,25 @@ func awsRestjson1_serializeDocumentSessionState(v *types.SessionState, value smi object := value.Object() defer object.Close() + if v.Files != nil { + ok := object.Key("files") + if err := awsRestjson1_serializeDocumentInputFiles(v.Files, ok); err != nil { + return err + } + } + if v.InvocationId != nil { ok := object.Key("invocationId") ok.String(*v.InvocationId) } + if v.KnowledgeBaseConfigurations != nil { + ok := object.Key("knowledgeBaseConfigurations") + if err := awsRestjson1_serializeDocumentKnowledgeBaseConfigurations(v.KnowledgeBaseConfigurations, ok); err != nil { + return err + } + } + if v.PromptSessionAttributes != nil { ok := object.Key("promptSessionAttributes") if err := awsRestjson1_serializeDocumentPromptSessionAttributesMap(v.PromptSessionAttributes, ok); err != nil { @@ -1106,3 +1604,18 @@ func awsRestjson1_serializeDocumentTextInferenceConfig(v *types.TextInferenceCon return nil } + +func awsRestjson1_serializeDocumentDocument(v document.Interface, value smithyjson.Value) error { + if v == nil { + return nil + } + if !internaldocument.IsInterface(v) { + return fmt.Errorf("%T is not a compatible document type", v) + } + db, err := v.MarshalSmithyDocument() + if err != nil { + return err + } + value.Write(db) + return nil +} diff --git a/service/bedrockagentruntime/snapshot/api_op_DeleteAgentMemory.go.snap b/service/bedrockagentruntime/snapshot/api_op_DeleteAgentMemory.go.snap new file mode 100644 index 00000000000..acc8c1cc7f1 --- /dev/null +++ b/service/bedrockagentruntime/snapshot/api_op_DeleteAgentMemory.go.snap @@ -0,0 +1,36 @@ +DeleteAgentMemory + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagentruntime/snapshot/api_op_GetAgentMemory.go.snap b/service/bedrockagentruntime/snapshot/api_op_GetAgentMemory.go.snap new file mode 100644 index 00000000000..3b82b705782 --- /dev/null +++ b/service/bedrockagentruntime/snapshot/api_op_GetAgentMemory.go.snap @@ -0,0 +1,36 @@ +GetAgentMemory + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagentruntime/snapshot/api_op_InvokeFlow.go.snap b/service/bedrockagentruntime/snapshot/api_op_InvokeFlow.go.snap new file mode 100644 index 00000000000..4b45c2e824f --- /dev/null +++ b/service/bedrockagentruntime/snapshot/api_op_InvokeFlow.go.snap @@ -0,0 +1,35 @@ +InvokeFlow + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + OperationEventStreamDeserializer + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockagentruntime/snapshot_test.go b/service/bedrockagentruntime/snapshot_test.go index 622b571e837..5b6e9bbdd9d 100644 --- a/service/bedrockagentruntime/snapshot_test.go +++ b/service/bedrockagentruntime/snapshot_test.go @@ -62,6 +62,30 @@ func testSnapshot(stack *middleware.Stack, operation string) error { } return snapshotOK{} } +func TestCheckSnapshot_DeleteAgentMemory(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteAgentMemory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteAgentMemory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetAgentMemory(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetAgentMemory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetAgentMemory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_InvokeAgent(t *testing.T) { svc := New(Options{}) _, err := svc.InvokeAgent(context.Background(), nil, func(o *Options) { @@ -74,6 +98,18 @@ func TestCheckSnapshot_InvokeAgent(t *testing.T) { } } +func TestCheckSnapshot_InvokeFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.InvokeFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "InvokeFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_Retrieve(t *testing.T) { svc := New(Options{}) _, err := svc.Retrieve(context.Background(), nil, func(o *Options) { @@ -97,6 +133,30 @@ func TestCheckSnapshot_RetrieveAndGenerate(t *testing.T) { t.Fatal(err) } } +func TestUpdateSnapshot_DeleteAgentMemory(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteAgentMemory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteAgentMemory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetAgentMemory(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetAgentMemory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetAgentMemory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_InvokeAgent(t *testing.T) { svc := New(Options{}) _, err := svc.InvokeAgent(context.Background(), nil, func(o *Options) { @@ -109,6 +169,18 @@ func TestUpdateSnapshot_InvokeAgent(t *testing.T) { } } +func TestUpdateSnapshot_InvokeFlow(t *testing.T) { + svc := New(Options{}) + _, err := svc.InvokeFlow(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "InvokeFlow") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_Retrieve(t *testing.T) { svc := New(Options{}) _, err := svc.Retrieve(context.Background(), nil, func(o *Options) { diff --git a/service/bedrockagentruntime/types/enums.go b/service/bedrockagentruntime/types/enums.go index ea2ce461161..46342905de7 100644 --- a/service/bedrockagentruntime/types/enums.go +++ b/service/bedrockagentruntime/types/enums.go @@ -21,6 +21,25 @@ func (CreationMode) Values() []CreationMode { } } +type ExecutionType string + +// Enum values for ExecutionType +const ( + ExecutionTypeLambda ExecutionType = "LAMBDA" + ExecutionTypeReturnControl ExecutionType = "RETURN_CONTROL" +) + +// Values returns all known values for ExecutionType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ExecutionType) Values() []ExecutionType { + return []ExecutionType{ + "LAMBDA", + "RETURN_CONTROL", + } +} + type ExternalSourceType string // Enum values for ExternalSourceType @@ -40,6 +59,61 @@ func (ExternalSourceType) Values() []ExternalSourceType { } } +type FileSourceType string + +// Enum values for FileSourceType +const ( + FileSourceTypeS3 FileSourceType = "S3" + FileSourceTypeByteContent FileSourceType = "BYTE_CONTENT" +) + +// Values returns all known values for FileSourceType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FileSourceType) Values() []FileSourceType { + return []FileSourceType{ + "S3", + "BYTE_CONTENT", + } +} + +type FileUseCase string + +// Enum values for FileUseCase +const ( + FileUseCaseCodeInterpreter FileUseCase = "CODE_INTERPRETER" + FileUseCaseChat FileUseCase = "CHAT" +) + +// Values returns all known values for FileUseCase. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FileUseCase) Values() []FileUseCase { + return []FileUseCase{ + "CODE_INTERPRETER", + "CHAT", + } +} + +type FlowCompletionReason string + +// Enum values for FlowCompletionReason +const ( + FlowCompletionReasonSuccess FlowCompletionReason = "SUCCESS" +) + +// Values returns all known values for FlowCompletionReason. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FlowCompletionReason) Values() []FlowCompletionReason { + return []FlowCompletionReason{ + "SUCCESS", + } +} + type GuadrailAction string // Enum values for GuadrailAction @@ -316,9 +390,10 @@ type InvocationType string // Enum values for InvocationType const ( - InvocationTypeActionGroup InvocationType = "ACTION_GROUP" - InvocationTypeKnowledgeBase InvocationType = "KNOWLEDGE_BASE" - InvocationTypeFinish InvocationType = "FINISH" + InvocationTypeActionGroup InvocationType = "ACTION_GROUP" + InvocationTypeKnowledgeBase InvocationType = "KNOWLEDGE_BASE" + InvocationTypeFinish InvocationType = "FINISH" + InvocationTypeActionGroupCodeInterpreter InvocationType = "ACTION_GROUP_CODE_INTERPRETER" ) // Values returns all known values for InvocationType. Note that this can be @@ -330,6 +405,53 @@ func (InvocationType) Values() []InvocationType { "ACTION_GROUP", "KNOWLEDGE_BASE", "FINISH", + "ACTION_GROUP_CODE_INTERPRETER", + } +} + +type MemoryType string + +// Enum values for MemoryType +const ( + MemoryTypeSessionSummary MemoryType = "SESSION_SUMMARY" +) + +// Values returns all known values for MemoryType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (MemoryType) Values() []MemoryType { + return []MemoryType{ + "SESSION_SUMMARY", + } +} + +type NodeType string + +// Enum values for NodeType +const ( + NodeTypeFlowInputNode NodeType = "FlowInputNode" + NodeTypeFlowOutputNode NodeType = "FlowOutputNode" + NodeTypeLambdaFunctionNode NodeType = "LambdaFunctionNode" + NodeTypeKnowledgeBaseNode NodeType = "KnowledgeBaseNode" + NodeTypePromptNode NodeType = "PromptNode" + NodeTypeConditionNode NodeType = "ConditionNode" + NodeTypeLexNode NodeType = "LexNode" +) + +// Values returns all known values for NodeType. Note that this can be expanded in +// the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (NodeType) Values() []NodeType { + return []NodeType{ + "FlowInputNode", + "FlowOutputNode", + "LambdaFunctionNode", + "KnowledgeBaseNode", + "PromptNode", + "ConditionNode", + "LexNode", } } @@ -356,6 +478,23 @@ func (PromptType) Values() []PromptType { } } +type QueryTransformationType string + +// Enum values for QueryTransformationType +const ( + QueryTransformationTypeQueryDecomposition QueryTransformationType = "QUERY_DECOMPOSITION" +) + +// Values returns all known values for QueryTransformationType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (QueryTransformationType) Values() []QueryTransformationType { + return []QueryTransformationType{ + "QUERY_DECOMPOSITION", + } +} + type ResponseState string // Enum values for ResponseState @@ -379,7 +518,11 @@ type RetrievalResultLocationType string // Enum values for RetrievalResultLocationType const ( - RetrievalResultLocationTypeS3 RetrievalResultLocationType = "S3" + RetrievalResultLocationTypeS3 RetrievalResultLocationType = "S3" + RetrievalResultLocationTypeWeb RetrievalResultLocationType = "WEB" + RetrievalResultLocationTypeConfluence RetrievalResultLocationType = "CONFLUENCE" + RetrievalResultLocationTypeSalesforce RetrievalResultLocationType = "SALESFORCE" + RetrievalResultLocationTypeSharepoint RetrievalResultLocationType = "SHAREPOINT" ) // Values returns all known values for RetrievalResultLocationType. Note that this @@ -389,6 +532,10 @@ const ( func (RetrievalResultLocationType) Values() []RetrievalResultLocationType { return []RetrievalResultLocationType{ "S3", + "WEB", + "CONFLUENCE", + "SALESFORCE", + "SHAREPOINT", } } diff --git a/service/bedrockagentruntime/types/types.go b/service/bedrockagentruntime/types/types.go index 73ab59e2c68..68f7bcfc2c6 100644 --- a/service/bedrockagentruntime/types/types.go +++ b/service/bedrockagentruntime/types/types.go @@ -5,6 +5,7 @@ package types import ( "github.com/aws/aws-sdk-go-v2/service/bedrockagentruntime/document" smithydocument "github.com/aws/smithy-go/document" + "time" ) // Contains information about the action group being invoked. For more information @@ -20,9 +21,18 @@ type ActionGroupInvocationInput struct { // The path to the API to call, based off the action group. ApiPath *string + // How fulfillment of the action is handled. For more information, see [Handling fulfillment of the action]. + // + // [Handling fulfillment of the action]: https://docs.aws.amazon.com/bedrock/latest/userguide/action-handle.html + ExecutionType ExecutionType + // The function in the action group to call. Function *string + // The unique identifier of the invocation. Only returned if the executionType is + // RETURN_CONTROL . + InvocationId *string + // The parameters in the Lambda input event. Parameters []Parameter @@ -183,6 +193,23 @@ type ByteContentDoc struct { noSmithyDocumentSerde } +// The property contains the file to chat with, along with its attributes. +type ByteContentFile struct { + + // The byte value of the file to attach, encoded as Base-64 string. The maximum + // size of all files that is attached is 10MB. You can attach a maximum of 5 files. + // + // This member is required. + Data []byte + + // The MIME type of data contained in the file used for chat. + // + // This member is required. + MediaType *string + + noSmithyDocumentSerde +} + // An object containing a segment of the generated response that is based on a // source in the knowledge base, alongside information about the source. // @@ -207,6 +234,37 @@ type Citation struct { noSmithyDocumentSerde } +// Contains information about the code interpreter being invoked. +type CodeInterpreterInvocationInput struct { + + // The code for the code interpreter to use. + Code *string + + // Files that are uploaded for code interpreter to use. + Files []string + + noSmithyDocumentSerde +} + +// Contains the JSON-formatted string returned by the API invoked by the code +// interpreter. +type CodeInterpreterInvocationOutput struct { + + // Contains the error returned from code execution. + ExecutionError *string + + // Contains the successful output returned from code execution + ExecutionOutput *string + + // Indicates if the execution of the code timed out. + ExecutionTimeout *bool + + // Contains output files, if generated by code execution. + Files []string + + noSmithyDocumentSerde +} + // Contains the body of the API response. // // This data type is used in the following API operations: @@ -295,6 +353,33 @@ type FailureTrace struct { noSmithyDocumentSerde } +// Contains intermediate response for code interpreter if any files have been +// generated. +type FilePart struct { + + // Files containing intermediate response for the user. + Files []OutputFile + + noSmithyDocumentSerde +} + +// The source file of the content contained in the wrapper object. +type FileSource struct { + + // The source type of the files to attach. + // + // This member is required. + SourceType FileSourceType + + // The data and the text of the attached files. + ByteContent *ByteContentFile + + // The s3 location of the files to attach. + S3Location *S3ObjectFile + + noSmithyDocumentSerde +} + // Specifies the name that the metadata attribute must match and the value to // which to compare the value of the metadata attribute. For more information, see [Query configurations] // . @@ -329,6 +414,159 @@ type FinalResponse struct { noSmithyDocumentSerde } +// Contains information about why a flow completed. +// +// This data type is used in the following API operations: +// +// [InvokeFlow response] +// +// [InvokeFlow response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_ResponseSyntax +type FlowCompletionEvent struct { + + // The reason that the flow completed. + // + // This member is required. + CompletionReason FlowCompletionReason + + noSmithyDocumentSerde +} + +// Contains information about an input into the flow and what to do with it. +// +// This data type is used in the following API operations: +// +// [InvokeFlow request] +// +// [InvokeFlow request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_RequestSyntax +type FlowInput struct { + + // Contains information about an input into the flow. + // + // This member is required. + Content FlowInputContent + + // A name for the input of the flow input node. + // + // This member is required. + NodeName *string + + // A name for the output of the flow input node. + // + // This member is required. + NodeOutputName *string + + noSmithyDocumentSerde +} + +// Contains information about an input into the flow. +// +// This data type is used in the following API operations: +// +// [InvokeFlow request] +// +// The following types satisfy this interface: +// +// FlowInputContentMemberDocument +// +// [InvokeFlow request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_RequestSyntax +type FlowInputContent interface { + isFlowInputContent() +} + +// The input for the flow input node. +type FlowInputContentMemberDocument struct { + Value document.Interface + + noSmithyDocumentSerde +} + +func (*FlowInputContentMemberDocument) isFlowInputContent() {} + +// Contains information about the output node. +// +// This data type is used in the following API operations: +// +// [InvokeFlow request] +// +// The following types satisfy this interface: +// +// FlowOutputContentMemberDocument +// +// [InvokeFlow request]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_RequestSyntax +type FlowOutputContent interface { + isFlowOutputContent() +} + +// A name for the output of the flow. +type FlowOutputContentMemberDocument struct { + Value document.Interface + + noSmithyDocumentSerde +} + +func (*FlowOutputContentMemberDocument) isFlowOutputContent() {} + +// Contains information about an output from flow invoction. +// +// This data type is used in the following API operations: +// +// [InvokeFlow response] +// +// [InvokeFlow response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_ResponseSyntax +type FlowOutputEvent struct { + + // The output of the node. + // + // This member is required. + Content FlowOutputContent + + // The name of the node to which input was provided. + // + // This member is required. + NodeName *string + + // The type of node to which input was provided. + // + // This member is required. + NodeType NodeType + + noSmithyDocumentSerde +} + +// The output of the flow. +// +// This data type is used in the following API operations: +// +// [InvokeFlow response] +// +// The following types satisfy this interface: +// +// FlowResponseStreamMemberFlowCompletionEvent +// FlowResponseStreamMemberFlowOutputEvent +// +// [InvokeFlow response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_ResponseSyntax +type FlowResponseStream interface { + isFlowResponseStream() +} + +// Contains information about why the flow completed. +type FlowResponseStreamMemberFlowCompletionEvent struct { + Value FlowCompletionEvent + + noSmithyDocumentSerde +} + +func (*FlowResponseStreamMemberFlowCompletionEvent) isFlowResponseStream() {} + +// Contains information about an output from flow invocation. +type FlowResponseStreamMemberFlowOutputEvent struct { + Value FlowOutputEvent + + noSmithyDocumentSerde +} + +func (*FlowResponseStreamMemberFlowOutputEvent) isFlowResponseStream() {} + // Contains information about the function that the agent predicts should be // called. // @@ -696,6 +934,27 @@ type InferenceConfiguration struct { noSmithyDocumentSerde } +// Contains details of the source files. +type InputFile struct { + + // The name of the source file. + // + // This member is required. + Name *string + + // Specifies where the files are located. + // + // This member is required. + Source *FileSource + + // Specifies how the source files will be used by the code interpreter. + // + // This member is required. + UseCase FileUseCase + + noSmithyDocumentSerde +} + // Contains information pertaining to the action group or knowledge base that is // being invoked. type InvocationInput struct { @@ -703,6 +962,9 @@ type InvocationInput struct { // Contains information about the action group to be invoked. ActionGroupInvocationInput *ActionGroupInvocationInput + // Contains information about the code interpreter to be invoked. + CodeInterpreterInvocationInput *CodeInterpreterInvocationInput + // Specifies whether the agent is invoking an action group or a knowledge base. InvocationType InvocationType @@ -788,6 +1050,28 @@ type InvocationResultMemberMemberFunctionResult struct { func (*InvocationResultMemberMemberFunctionResult) isInvocationResultMember() {} +// Configurations to apply to a knowledge base attached to the agent during query. +// For more information, see [Knowledge base retrieval configurations]. +// +// [Knowledge base retrieval configurations]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html#session-state-kb +type KnowledgeBaseConfiguration struct { + + // The unique identifier for a knowledge base attached to the agent. + // + // This member is required. + KnowledgeBaseId *string + + // The configurations to apply to the knowledge base during query. For more + // information, see [Query configurations]. + // + // [Query configurations]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html + // + // This member is required. + RetrievalConfiguration *KnowledgeBaseRetrievalConfiguration + + noSmithyDocumentSerde +} + // Contains details about the knowledge base to look up and the query to be made. type KnowledgeBaseLookupInput struct { @@ -827,8 +1111,7 @@ type KnowledgeBaseQuery struct { noSmithyDocumentSerde } -// Contains configurations for the knowledge base query and retrieval process. For -// more information, see [Query configurations]. +// Contains configurations for knowledge base query. For more information, see [Query configurations]. // // This data type is used in the following API operations: // @@ -909,10 +1192,14 @@ type KnowledgeBaseRetrieveAndGenerateConfiguration struct { // This member is required. ModelArn *string - // Contains configurations for response generation based on the knowwledge base + // Contains configurations for response generation based on the knowledge base // query results. GenerationConfiguration *GenerationConfiguration + // Settings for how the model processes the prompt prior to retrieval and + // generation. + OrchestrationConfiguration *OrchestrationConfiguration + // Contains configurations for how to retrieve and return the knowledge base query. RetrievalConfiguration *KnowledgeBaseRetrievalConfiguration @@ -957,6 +1244,45 @@ type KnowledgeBaseVectorSearchConfiguration struct { noSmithyDocumentSerde } +// Contains sessions summaries. +// +// The following types satisfy this interface: +// +// MemoryMemberSessionSummary +type Memory interface { + isMemory() +} + +// Contains summary of a session. +type MemoryMemberSessionSummary struct { + Value MemorySessionSummary + + noSmithyDocumentSerde +} + +func (*MemoryMemberSessionSummary) isMemory() {} + +// Contains details of a session summary. +type MemorySessionSummary struct { + + // The unique identifier of the memory where the session summary is stored. + MemoryId *string + + // The time when the memory duration for the session is set to end. + SessionExpiryTime *time.Time + + // The identifier for this session. + SessionId *string + + // The start time for this session. + SessionStartTime *time.Time + + // The summarized text for this session. + SummaryText *string + + noSmithyDocumentSerde +} + // The input for the pre-processing step. // // - The type matches the agent step. @@ -1013,6 +1339,10 @@ type Observation struct { // group. ActionGroupInvocationOutput *ActionGroupInvocationOutput + // Contains the JSON-formatted string returned by the API invoked by the code + // interpreter. + CodeInterpreterInvocationOutput *CodeInterpreterInvocationOutput + // Contains details about the response to the user. FinalResponse *FinalResponse @@ -1042,6 +1372,19 @@ type Observation struct { noSmithyDocumentSerde } +// Settings for how the model processes the prompt prior to retrieval and +// generation. +type OrchestrationConfiguration struct { + + // To split up the prompt and retrieve multiple sources, set the transformation + // type to QUERY_DECOMPOSITION . + // + // This member is required. + QueryTransformationConfiguration *QueryTransformationConfiguration + + noSmithyDocumentSerde +} + // Details about the orchestration step, in which the agent determines the order // in which actions are executed and which knowledge bases are retrieved. // @@ -1103,6 +1446,21 @@ type OrchestrationTraceMemberRationale struct { func (*OrchestrationTraceMemberRationale) isOrchestrationTrace() {} +// Contains details of the response from code interpreter. +type OutputFile struct { + + // The byte count of files that contains response from code interpreter. + Bytes []byte + + // The name of the file containing response from code interpreter. + Name *string + + // The type of file that contains response from the code interpreter. + Type *string + + noSmithyDocumentSerde +} + // A parameter for the API request or function. type Parameter struct { @@ -1296,6 +1654,18 @@ type PropertyParameters struct { noSmithyDocumentSerde } +// To split up the prompt and retrieve multiple sources, set the transformation +// type to QUERY_DECOMPOSITION . +type QueryTransformationConfiguration struct { + + // The type of transformation to apply to the prompt. + // + // This member is required. + Type QueryTransformationType + + noSmithyDocumentSerde +} + // Contains the reasoning, based on the input, that the agent uses to justify // carrying out an action group or getting information from a knowledge base. type Rationale struct { @@ -1336,6 +1706,7 @@ type RequestBody struct { // The following types satisfy this interface: // // ResponseStreamMemberChunk +// ResponseStreamMemberFiles // ResponseStreamMemberReturnControl // ResponseStreamMemberTrace type ResponseStream interface { @@ -1351,6 +1722,16 @@ type ResponseStreamMemberChunk struct { func (*ResponseStreamMemberChunk) isResponseStream() {} +// Contains intermediate response for code interpreter if any files have been +// generated. +type ResponseStreamMemberFiles struct { + Value FilePart + + noSmithyDocumentSerde +} + +func (*ResponseStreamMemberFiles) isResponseStream() {} + // Contains the parameters and information that the agent elicited from the // customer to carry out an action. This information is returned to the system and // can be used in your own setup for fulfilling the action. @@ -1614,6 +1995,15 @@ type RetrievalFilterMemberStringContains struct { func (*RetrievalFilterMemberStringContains) isRetrievalFilter() {} +// The Confluence data source location. +type RetrievalResultConfluenceLocation struct { + + // The Confluence host URL for the data source location. + Url *string + + noSmithyDocumentSerde +} + // Contains the cited text from the data source. // // This data type is used in the following API operations: @@ -1640,7 +2030,7 @@ type RetrievalResultContent struct { noSmithyDocumentSerde } -// Contains information about the location of the data source. +// Contains information about the data source location. // // This data type is used in the following API operations: // @@ -1658,18 +2048,30 @@ type RetrievalResultContent struct { // [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type RetrievalResultLocation struct { - // The type of the location of the data source. + // The type of data source location. // // This member is required. Type RetrievalResultLocationType - // Contains the S3 location of the data source. + // The Confluence data source location. + ConfluenceLocation *RetrievalResultConfluenceLocation + + // The S3 data source location. S3Location *RetrievalResultS3Location + // The Salesforce data source location. + SalesforceLocation *RetrievalResultSalesforceLocation + + // The SharePoint data source location. + SharePointLocation *RetrievalResultSharePointLocation + + // The web URL/URLs data source location. + WebLocation *RetrievalResultWebLocation + noSmithyDocumentSerde } -// Contains the S3 location of the data source. +// The S3 data source location. // // This data type is used in the following API operations: // @@ -1687,12 +2089,39 @@ type RetrievalResultLocation struct { // [InvokeAgent response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax type RetrievalResultS3Location struct { - // The S3 URI of the data source. + // The S3 URI for the data source location. Uri *string noSmithyDocumentSerde } +// The Salesforce data source location. +type RetrievalResultSalesforceLocation struct { + + // The Salesforce host URL for the data source location. + Url *string + + noSmithyDocumentSerde +} + +// The SharePoint data source location. +type RetrievalResultSharePointLocation struct { + + // The SharePoint site URL for the data source location. + Url *string + + noSmithyDocumentSerde +} + +// The web URL/URLs data source location. +type RetrievalResultWebLocation struct { + + // The web URL/URLs for the data source location. + Url *string + + noSmithyDocumentSerde +} + // Contains details about the resource being queried. // // This data type is used in the following API operations: @@ -1833,6 +2262,17 @@ type S3ObjectDoc struct { noSmithyDocumentSerde } +// Contains details of the s3 object where the source file is located. +type S3ObjectFile struct { + + // The uri of the s3 object. + // + // This member is required. + Uri *string + + noSmithyDocumentSerde +} + // Contains parameters that specify various attributes that persist across a // session or prompt. You can define session state attributes as key-value pairs // when writing a [Lambda function]for an action group or pass them when making an [InvokeAgent] request. Use @@ -1844,6 +2284,9 @@ type S3ObjectDoc struct { // [Lambda function]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html type SessionState struct { + // Contains information about the files used by code interpreter. + Files []InputFile + // The identifier of the invocation of an action. This value must match the // invocationId returned in the InvokeAgent response for the action whose results // are provided in the returnControlInvocationResults field. For more information, @@ -1853,6 +2296,10 @@ type SessionState struct { // [Control session context]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html InvocationId *string + // An array of configurations, each of which applies to a knowledge base attached + // to the agent. + KnowledgeBaseConfigurations []KnowledgeBaseConfiguration + // Contains attributes that persist across a prompt and the values of those // attributes. These attributes replace the $prompt_session_attributes$ // placeholder variable in the orchestration prompt template. For more information, @@ -2072,8 +2519,12 @@ type UnknownUnionMember struct { noSmithyDocumentSerde } +func (*UnknownUnionMember) isFlowInputContent() {} +func (*UnknownUnionMember) isFlowOutputContent() {} +func (*UnknownUnionMember) isFlowResponseStream() {} func (*UnknownUnionMember) isInvocationInputMember() {} func (*UnknownUnionMember) isInvocationResultMember() {} +func (*UnknownUnionMember) isMemory() {} func (*UnknownUnionMember) isOrchestrationTrace() {} func (*UnknownUnionMember) isPostProcessingTrace() {} func (*UnknownUnionMember) isPreProcessingTrace() {} diff --git a/service/bedrockagentruntime/types/types_exported_test.go b/service/bedrockagentruntime/types/types_exported_test.go index a0af19d7dd6..1bbf1c7a501 100644 --- a/service/bedrockagentruntime/types/types_exported_test.go +++ b/service/bedrockagentruntime/types/types_exported_test.go @@ -4,9 +4,68 @@ package types_test import ( "fmt" + "github.com/aws/aws-sdk-go-v2/service/bedrockagentruntime/document" "github.com/aws/aws-sdk-go-v2/service/bedrockagentruntime/types" ) +func ExampleFlowInputContent_outputUsage() { + var union types.FlowInputContent + // type switches can be used to check the union value + switch v := union.(type) { + case *types.FlowInputContentMemberDocument: + _ = v.Value // Value is document.Interface + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ document.Interface + +func ExampleFlowOutputContent_outputUsage() { + var union types.FlowOutputContent + // type switches can be used to check the union value + switch v := union.(type) { + case *types.FlowOutputContentMemberDocument: + _ = v.Value // Value is document.Interface + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ document.Interface + +func ExampleFlowResponseStream_outputUsage() { + var union types.FlowResponseStream + // type switches can be used to check the union value + switch v := union.(type) { + case *types.FlowResponseStreamMemberFlowCompletionEvent: + _ = v.Value // Value is types.FlowCompletionEvent + + case *types.FlowResponseStreamMemberFlowOutputEvent: + _ = v.Value // Value is types.FlowOutputEvent + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.FlowOutputEvent +var _ *types.FlowCompletionEvent + func ExampleInvocationInputMember_outputUsage() { var union types.InvocationInputMember // type switches can be used to check the union value @@ -51,6 +110,24 @@ func ExampleInvocationResultMember_outputUsage() { var _ *types.ApiResult var _ *types.FunctionResult +func ExampleMemory_outputUsage() { + var union types.Memory + // type switches can be used to check the union value + switch v := union.(type) { + case *types.MemoryMemberSessionSummary: + _ = v.Value // Value is types.MemorySessionSummary + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.MemorySessionSummary + func ExampleOrchestrationTrace_outputUsage() { var union types.OrchestrationTrace // type switches can be used to check the union value @@ -132,6 +209,9 @@ func ExampleResponseStream_outputUsage() { case *types.ResponseStreamMemberChunk: _ = v.Value // Value is types.PayloadPart + case *types.ResponseStreamMemberFiles: + _ = v.Value // Value is types.FilePart + case *types.ResponseStreamMemberReturnControl: _ = v.Value // Value is types.ReturnControlPayload @@ -150,6 +230,7 @@ func ExampleResponseStream_outputUsage() { var _ *types.ReturnControlPayload var _ *types.PayloadPart var _ *types.TracePart +var _ *types.FilePart func ExampleRetrievalFilter_outputUsage() { var union types.RetrievalFilter diff --git a/service/bedrockagentruntime/validators.go b/service/bedrockagentruntime/validators.go index a999c4c9a40..503cde406d3 100644 --- a/service/bedrockagentruntime/validators.go +++ b/service/bedrockagentruntime/validators.go @@ -10,6 +10,46 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpDeleteAgentMemory struct { +} + +func (*validateOpDeleteAgentMemory) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAgentMemory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAgentMemoryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAgentMemoryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAgentMemory struct { +} + +func (*validateOpGetAgentMemory) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAgentMemory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAgentMemoryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAgentMemoryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpInvokeAgent struct { } @@ -30,6 +70,26 @@ func (m *validateOpInvokeAgent) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpInvokeFlow struct { +} + +func (*validateOpInvokeFlow) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpInvokeFlow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*InvokeFlowInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpInvokeFlowInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpRetrieveAndGenerate struct { } @@ -70,10 +130,22 @@ func (m *validateOpRetrieve) HandleInitialize(ctx context.Context, in middleware return next.HandleInitialize(ctx, in) } +func addOpDeleteAgentMemoryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAgentMemory{}, middleware.After) +} + +func addOpGetAgentMemoryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAgentMemory{}, middleware.After) +} + func addOpInvokeAgentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpInvokeAgent{}, middleware.After) } +func addOpInvokeFlowValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpInvokeFlow{}, middleware.After) +} + func addOpRetrieveAndGenerateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRetrieveAndGenerate{}, middleware.After) } @@ -118,6 +190,24 @@ func validateByteContentDoc(v *types.ByteContentDoc) error { } } +func validateByteContentFile(v *types.ByteContentFile) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ByteContentFile"} + if v.MediaType == nil { + invalidParams.Add(smithy.NewErrParamRequired("MediaType")) + } + if v.Data == nil { + invalidParams.Add(smithy.NewErrParamRequired("Data")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateExternalSource(v *types.ExternalSource) error { if v == nil { return nil @@ -204,6 +294,31 @@ func validateExternalSourcesRetrieveAndGenerateConfiguration(v *types.ExternalSo } } +func validateFileSource(v *types.FileSource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FileSource"} + if len(v.SourceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SourceType")) + } + if v.S3Location != nil { + if err := validateS3ObjectFile(v.S3Location); err != nil { + invalidParams.AddNested("S3Location", err.(smithy.InvalidParamsError)) + } + } + if v.ByteContent != nil { + if err := validateByteContentFile(v.ByteContent); err != nil { + invalidParams.AddNested("ByteContent", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateFilterAttribute(v *types.FilterAttribute) error { if v == nil { return nil @@ -222,6 +337,44 @@ func validateFilterAttribute(v *types.FilterAttribute) error { } } +func validateFlowInput(v *types.FlowInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowInput"} + if v.NodeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NodeName")) + } + if v.NodeOutputName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NodeOutputName")) + } + if v.Content == nil { + invalidParams.Add(smithy.NewErrParamRequired("Content")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlowInputs(v []types.FlowInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlowInputs"} + for i := range v { + if err := validateFlowInput(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateFunctionResult(v *types.FunctionResult) error { if v == nil { return nil @@ -272,6 +425,48 @@ func validateGuardrailConfiguration(v *types.GuardrailConfiguration) error { } } +func validateInputFile(v *types.InputFile) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "InputFile"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } else if v.Source != nil { + if err := validateFileSource(v.Source); err != nil { + invalidParams.AddNested("Source", err.(smithy.InvalidParamsError)) + } + } + if len(v.UseCase) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("UseCase")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateInputFiles(v []types.InputFile) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "InputFiles"} + for i := range v { + if err := validateInputFile(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateInvocationResultMember(v types.InvocationResultMember) error { if v == nil { return nil @@ -296,6 +491,45 @@ func validateInvocationResultMember(v types.InvocationResultMember) error { } } +func validateKnowledgeBaseConfiguration(v *types.KnowledgeBaseConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KnowledgeBaseConfiguration"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if v.RetrievalConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("RetrievalConfiguration")) + } else if v.RetrievalConfiguration != nil { + if err := validateKnowledgeBaseRetrievalConfiguration(v.RetrievalConfiguration); err != nil { + invalidParams.AddNested("RetrievalConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateKnowledgeBaseConfigurations(v []types.KnowledgeBaseConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KnowledgeBaseConfigurations"} + for i := range v { + if err := validateKnowledgeBaseConfiguration(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateKnowledgeBaseQuery(v *types.KnowledgeBaseQuery) error { if v == nil { return nil @@ -351,6 +585,11 @@ func validateKnowledgeBaseRetrieveAndGenerateConfiguration(v *types.KnowledgeBas invalidParams.AddNested("GenerationConfiguration", err.(smithy.InvalidParamsError)) } } + if v.OrchestrationConfiguration != nil { + if err := validateOrchestrationConfiguration(v.OrchestrationConfiguration); err != nil { + invalidParams.AddNested("OrchestrationConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -375,6 +614,40 @@ func validateKnowledgeBaseVectorSearchConfiguration(v *types.KnowledgeBaseVector } } +func validateOrchestrationConfiguration(v *types.OrchestrationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OrchestrationConfiguration"} + if v.QueryTransformationConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryTransformationConfiguration")) + } else if v.QueryTransformationConfiguration != nil { + if err := validateQueryTransformationConfiguration(v.QueryTransformationConfiguration); err != nil { + invalidParams.AddNested("QueryTransformationConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQueryTransformationConfiguration(v *types.QueryTransformationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QueryTransformationConfiguration"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRetrievalFilter(v types.RetrievalFilter) error { if v == nil { return nil @@ -558,6 +831,21 @@ func validateS3ObjectDoc(v *types.S3ObjectDoc) error { } } +func validateS3ObjectFile(v *types.S3ObjectFile) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "S3ObjectFile"} + if v.Uri == nil { + invalidParams.Add(smithy.NewErrParamRequired("Uri")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSessionState(v *types.SessionState) error { if v == nil { return nil @@ -568,6 +856,58 @@ func validateSessionState(v *types.SessionState) error { invalidParams.AddNested("ReturnControlInvocationResults", err.(smithy.InvalidParamsError)) } } + if v.Files != nil { + if err := validateInputFiles(v.Files); err != nil { + invalidParams.AddNested("Files", err.(smithy.InvalidParamsError)) + } + } + if v.KnowledgeBaseConfigurations != nil { + if err := validateKnowledgeBaseConfigurations(v.KnowledgeBaseConfigurations); err != nil { + invalidParams.AddNested("KnowledgeBaseConfigurations", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAgentMemoryInput(v *DeleteAgentMemoryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAgentMemoryInput"} + if v.AgentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AgentId")) + } + if v.AgentAliasId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AgentAliasId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAgentMemoryInput(v *GetAgentMemoryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAgentMemoryInput"} + if v.AgentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AgentId")) + } + if v.AgentAliasId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AgentAliasId")) + } + if len(v.MemoryType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("MemoryType")) + } + if v.MemoryId == nil { + invalidParams.Add(smithy.NewErrParamRequired("MemoryId")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -601,6 +941,31 @@ func validateOpInvokeAgentInput(v *InvokeAgentInput) error { } } +func validateOpInvokeFlowInput(v *InvokeFlowInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "InvokeFlowInput"} + if v.FlowIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowIdentifier")) + } + if v.FlowAliasIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlowAliasIdentifier")) + } + if v.Inputs == nil { + invalidParams.Add(smithy.NewErrParamRequired("Inputs")) + } else if v.Inputs != nil { + if err := validateFlowInputs(v.Inputs); err != nil { + invalidParams.AddNested("Inputs", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpRetrieveAndGenerateInput(v *RetrieveAndGenerateInput) error { if v == nil { return nil diff --git a/service/bedrockruntime/api_op_ApplyGuardrail.go b/service/bedrockruntime/api_op_ApplyGuardrail.go new file mode 100644 index 00000000000..885d7955546 --- /dev/null +++ b/service/bedrockruntime/api_op_ApplyGuardrail.go @@ -0,0 +1,174 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockruntime + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The action to apply a guardrail. +func (c *Client) ApplyGuardrail(ctx context.Context, params *ApplyGuardrailInput, optFns ...func(*Options)) (*ApplyGuardrailOutput, error) { + if params == nil { + params = &ApplyGuardrailInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ApplyGuardrail", params, optFns, c.addOperationApplyGuardrailMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ApplyGuardrailOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ApplyGuardrailInput struct { + + // The content details used in the request to apply the guardrail. + // + // This member is required. + Content []types.GuardrailContentBlock + + // The guardrail identifier used in the request to apply the guardrail. + // + // This member is required. + GuardrailIdentifier *string + + // The guardrail version used in the request to apply the guardrail. + // + // This member is required. + GuardrailVersion *string + + // The source of data used in the request to apply the guardrail. + // + // This member is required. + Source types.GuardrailContentSource + + noSmithyDocumentSerde +} + +type ApplyGuardrailOutput struct { + + // The action taken in the response from the guardrail. + // + // This member is required. + Action types.GuardrailAction + + // The assessment details in the response from the guardrail. + // + // This member is required. + Assessments []types.GuardrailAssessment + + // The output details in the response from the guardrail. + // + // This member is required. + Outputs []types.GuardrailOutputContent + + // The usage details in the response from the guardrail. + // + // This member is required. + Usage *types.GuardrailUsage + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationApplyGuardrailMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpApplyGuardrail{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpApplyGuardrail{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ApplyGuardrail"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpApplyGuardrailValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opApplyGuardrail(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opApplyGuardrail(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ApplyGuardrail", + } +} diff --git a/service/bedrockruntime/deserializers.go b/service/bedrockruntime/deserializers.go index d5e82d7a523..ee9f7cb9abd 100644 --- a/service/bedrockruntime/deserializers.go +++ b/service/bedrockruntime/deserializers.go @@ -21,6 +21,7 @@ import ( smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" + "math" "strings" "time" ) @@ -33,6 +34,187 @@ func deserializeS3Expires(v string) (*time.Time, error) { return &t, nil } +type awsRestjson1_deserializeOpApplyGuardrail struct { +} + +func (*awsRestjson1_deserializeOpApplyGuardrail) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpApplyGuardrail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorApplyGuardrail(response, &metadata) + } + output := &ApplyGuardrailOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentApplyGuardrailOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorApplyGuardrail(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentApplyGuardrailOutput(v **ApplyGuardrailOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ApplyGuardrailOutput + if *v == nil { + sv = &ApplyGuardrailOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuardrailAction to be of type string, got %T instead", value) + } + sv.Action = types.GuardrailAction(jtv) + } + + case "assessments": + if err := awsRestjson1_deserializeDocumentGuardrailAssessmentList(&sv.Assessments, value); err != nil { + return err + } + + case "outputs": + if err := awsRestjson1_deserializeDocumentGuardrailOutputContentList(&sv.Outputs, value); err != nil { + return err + } + + case "usage": + if err := awsRestjson1_deserializeDocumentGuardrailUsage(&sv.Usage, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpConverse struct { } @@ -1909,6 +2091,11 @@ func awsRestjson1_deserializeDocumentGuardrailAssessment(v **types.GuardrailAsse return err } + case "contextualGroundingPolicy": + if err := awsRestjson1_deserializeDocumentGuardrailContextualGroundingPolicyAssessment(&sv.ContextualGroundingPolicy, value); err != nil { + return err + } + case "sensitiveInformationPolicy": if err := awsRestjson1_deserializeDocumentGuardrailSensitiveInformationPolicyAssessment(&sv.SensitiveInformationPolicy, value); err != nil { return err @@ -2164,6 +2351,193 @@ func awsRestjson1_deserializeDocumentGuardrailContentPolicyAssessment(v **types. return nil } +func awsRestjson1_deserializeDocumentGuardrailContextualGroundingFilter(v **types.GuardrailContextualGroundingFilter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GuardrailContextualGroundingFilter + if *v == nil { + sv = &types.GuardrailContextualGroundingFilter{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuardrailContextualGroundingPolicyAction to be of type string, got %T instead", value) + } + sv.Action = types.GuardrailContextualGroundingPolicyAction(jtv) + } + + case "score": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Score = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Score = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "threshold": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Threshold = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Threshold = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuardrailContextualGroundingFilterType to be of type string, got %T instead", value) + } + sv.Type = types.GuardrailContextualGroundingFilterType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGuardrailContextualGroundingFilters(v *[]types.GuardrailContextualGroundingFilter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.GuardrailContextualGroundingFilter + if *v == nil { + cv = []types.GuardrailContextualGroundingFilter{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GuardrailContextualGroundingFilter + destAddr := &col + if err := awsRestjson1_deserializeDocumentGuardrailContextualGroundingFilter(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentGuardrailContextualGroundingPolicyAssessment(v **types.GuardrailContextualGroundingPolicyAssessment, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GuardrailContextualGroundingPolicyAssessment + if *v == nil { + sv = &types.GuardrailContextualGroundingPolicyAssessment{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "filters": + if err := awsRestjson1_deserializeDocumentGuardrailContextualGroundingFilters(&sv.Filters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentGuardrailCustomWord(v **types.GuardrailCustomWord, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3858,6 +4232,42 @@ loop: return nil } +func awsRestjson1_deserializeDocumentGuardrailConverseContentQualifierList(v *[]types.GuardrailConverseContentQualifier, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.GuardrailConverseContentQualifier + if *v == nil { + cv = []types.GuardrailConverseContentQualifier{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GuardrailConverseContentQualifier + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuardrailConverseContentQualifier to be of type string, got %T instead", value) + } + col = types.GuardrailConverseContentQualifier(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentGuardrailConverseTextBlock(v **types.GuardrailConverseTextBlock, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3880,6 +4290,11 @@ func awsRestjson1_deserializeDocumentGuardrailConverseTextBlock(v **types.Guardr for key, value := range shape { switch key { + case "qualifiers": + if err := awsRestjson1_deserializeDocumentGuardrailConverseContentQualifierList(&sv.Qualifiers, value); err != nil { + return err + } + case "text": if value != nil { jtv, ok := value.(string) @@ -3898,6 +4313,189 @@ func awsRestjson1_deserializeDocumentGuardrailConverseTextBlock(v **types.Guardr return nil } +func awsRestjson1_deserializeDocumentGuardrailOutputContent(v **types.GuardrailOutputContent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GuardrailOutputContent + if *v == nil { + sv = &types.GuardrailOutputContent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuardrailOutputText to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGuardrailOutputContentList(v *[]types.GuardrailOutputContent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.GuardrailOutputContent + if *v == nil { + cv = []types.GuardrailOutputContent{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GuardrailOutputContent + destAddr := &col + if err := awsRestjson1_deserializeDocumentGuardrailOutputContent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentGuardrailUsage(v **types.GuardrailUsage, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GuardrailUsage + if *v == nil { + sv = &types.GuardrailUsage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentPolicyUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected GuardrailContentPolicyUnitsProcessed to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ContentPolicyUnits = ptr.Int32(int32(i64)) + } + + case "contextualGroundingPolicyUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected GuardrailContextualGroundingPolicyUnitsProcessed to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ContextualGroundingPolicyUnits = ptr.Int32(int32(i64)) + } + + case "sensitiveInformationPolicyFreeUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected GuardrailSensitiveInformationPolicyFreeUnitsProcessed to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SensitiveInformationPolicyFreeUnits = ptr.Int32(int32(i64)) + } + + case "sensitiveInformationPolicyUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected GuardrailSensitiveInformationPolicyUnitsProcessed to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SensitiveInformationPolicyUnits = ptr.Int32(int32(i64)) + } + + case "topicPolicyUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected GuardrailTopicPolicyUnitsProcessed to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TopicPolicyUnits = ptr.Int32(int32(i64)) + } + + case "wordPolicyUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected GuardrailWordPolicyUnitsProcessed to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.WordPolicyUnits = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentImageBlock(v **types.ImageBlock, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/bedrockruntime/generated.json b/service/bedrockruntime/generated.json index 5ae61388ece..17d74371642 100644 --- a/service/bedrockruntime/generated.json +++ b/service/bedrockruntime/generated.json @@ -9,6 +9,7 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_ApplyGuardrail.go", "api_op_Converse.go", "api_op_ConverseStream.go", "api_op_InvokeModel.go", diff --git a/service/bedrockruntime/serializers.go b/service/bedrockruntime/serializers.go index 5d6f76e0aaa..c5a88116c46 100644 --- a/service/bedrockruntime/serializers.go +++ b/service/bedrockruntime/serializers.go @@ -17,6 +17,110 @@ import ( "math" ) +type awsRestjson1_serializeOpApplyGuardrail struct { +} + +func (*awsRestjson1_serializeOpApplyGuardrail) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpApplyGuardrail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ApplyGuardrailInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsApplyGuardrailInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentApplyGuardrailInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsApplyGuardrailInput(v *ApplyGuardrailInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.GuardrailIdentifier == nil || len(*v.GuardrailIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member guardrailIdentifier must not be empty")} + } + if v.GuardrailIdentifier != nil { + if err := encoder.SetURI("guardrailIdentifier").String(*v.GuardrailIdentifier); err != nil { + return err + } + } + + if v.GuardrailVersion == nil || len(*v.GuardrailVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member guardrailVersion must not be empty")} + } + if v.GuardrailVersion != nil { + if err := encoder.SetURI("guardrailVersion").String(*v.GuardrailVersion); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentApplyGuardrailInput(v *ApplyGuardrailInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Content != nil { + ok := object.Key("content") + if err := awsRestjson1_serializeDocumentGuardrailContentBlockList(v.Content, ok); err != nil { + return err + } + } + + if len(v.Source) > 0 { + ok := object.Key("source") + ok.String(string(v.Source)) + } + + return nil +} + type awsRestjson1_serializeOpConverse struct { } @@ -634,6 +738,51 @@ func awsRestjson1_serializeDocumentGuardrailConfiguration(v *types.GuardrailConf return nil } +func awsRestjson1_serializeDocumentGuardrailContentBlock(v types.GuardrailContentBlock, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.GuardrailContentBlockMemberText: + av := object.Key("text") + if err := awsRestjson1_serializeDocumentGuardrailTextBlock(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentGuardrailContentBlockList(v []types.GuardrailContentBlock, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentGuardrailContentBlock(v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentGuardrailContentQualifierList(v []types.GuardrailContentQualifier, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsRestjson1_serializeDocumentGuardrailConverseContentBlock(v types.GuardrailConverseContentBlock, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -652,10 +801,28 @@ func awsRestjson1_serializeDocumentGuardrailConverseContentBlock(v types.Guardra return nil } +func awsRestjson1_serializeDocumentGuardrailConverseContentQualifierList(v []types.GuardrailConverseContentQualifier, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsRestjson1_serializeDocumentGuardrailConverseTextBlock(v *types.GuardrailConverseTextBlock, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.Qualifiers != nil { + ok := object.Key("qualifiers") + if err := awsRestjson1_serializeDocumentGuardrailConverseContentQualifierList(v.Qualifiers, ok); err != nil { + return err + } + } + if v.Text != nil { ok := object.Key("text") ok.String(*v.Text) @@ -691,6 +858,25 @@ func awsRestjson1_serializeDocumentGuardrailStreamConfiguration(v *types.Guardra return nil } +func awsRestjson1_serializeDocumentGuardrailTextBlock(v *types.GuardrailTextBlock, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Qualifiers != nil { + ok := object.Key("qualifiers") + if err := awsRestjson1_serializeDocumentGuardrailContentQualifierList(v.Qualifiers, ok); err != nil { + return err + } + } + + if v.Text != nil { + ok := object.Key("text") + ok.String(*v.Text) + } + + return nil +} + func awsRestjson1_serializeDocumentImageBlock(v *types.ImageBlock, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/bedrockruntime/snapshot/api_op_ApplyGuardrail.go.snap b/service/bedrockruntime/snapshot/api_op_ApplyGuardrail.go.snap new file mode 100644 index 00000000000..645e88146ef --- /dev/null +++ b/service/bedrockruntime/snapshot/api_op_ApplyGuardrail.go.snap @@ -0,0 +1,36 @@ +ApplyGuardrail + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrockruntime/snapshot_test.go b/service/bedrockruntime/snapshot_test.go index ee135612085..a773b3fb692 100644 --- a/service/bedrockruntime/snapshot_test.go +++ b/service/bedrockruntime/snapshot_test.go @@ -62,6 +62,18 @@ func testSnapshot(stack *middleware.Stack, operation string) error { } return snapshotOK{} } +func TestCheckSnapshot_ApplyGuardrail(t *testing.T) { + svc := New(Options{}) + _, err := svc.ApplyGuardrail(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ApplyGuardrail") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_Converse(t *testing.T) { svc := New(Options{}) _, err := svc.Converse(context.Background(), nil, func(o *Options) { @@ -109,6 +121,18 @@ func TestCheckSnapshot_InvokeModelWithResponseStream(t *testing.T) { t.Fatal(err) } } +func TestUpdateSnapshot_ApplyGuardrail(t *testing.T) { + svc := New(Options{}) + _, err := svc.ApplyGuardrail(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ApplyGuardrail") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_Converse(t *testing.T) { svc := New(Options{}) _, err := svc.Converse(context.Background(), nil, func(o *Options) { diff --git a/service/bedrockruntime/types/enums.go b/service/bedrockruntime/types/enums.go index f7501fa0767..9aa3798b53a 100644 --- a/service/bedrockruntime/types/enums.go +++ b/service/bedrockruntime/types/enums.go @@ -54,6 +54,25 @@ func (DocumentFormat) Values() []DocumentFormat { } } +type GuardrailAction string + +// Enum values for GuardrailAction +const ( + GuardrailActionNone GuardrailAction = "NONE" + GuardrailActionGuardrailIntervened GuardrailAction = "GUARDRAIL_INTERVENED" +) + +// Values returns all known values for GuardrailAction. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (GuardrailAction) Values() []GuardrailAction { + return []GuardrailAction{ + "NONE", + "GUARDRAIL_INTERVENED", + } +} + type GuardrailContentFilterConfidence string // Enum values for GuardrailContentFilterConfidence @@ -123,6 +142,108 @@ func (GuardrailContentPolicyAction) Values() []GuardrailContentPolicyAction { } } +type GuardrailContentQualifier string + +// Enum values for GuardrailContentQualifier +const ( + GuardrailContentQualifierGroundingSource GuardrailContentQualifier = "grounding_source" + GuardrailContentQualifierQuery GuardrailContentQualifier = "query" + GuardrailContentQualifierGuardContent GuardrailContentQualifier = "guard_content" +) + +// Values returns all known values for GuardrailContentQualifier. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (GuardrailContentQualifier) Values() []GuardrailContentQualifier { + return []GuardrailContentQualifier{ + "grounding_source", + "query", + "guard_content", + } +} + +type GuardrailContentSource string + +// Enum values for GuardrailContentSource +const ( + GuardrailContentSourceInput GuardrailContentSource = "INPUT" + GuardrailContentSourceOutput GuardrailContentSource = "OUTPUT" +) + +// Values returns all known values for GuardrailContentSource. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (GuardrailContentSource) Values() []GuardrailContentSource { + return []GuardrailContentSource{ + "INPUT", + "OUTPUT", + } +} + +type GuardrailContextualGroundingFilterType string + +// Enum values for GuardrailContextualGroundingFilterType +const ( + GuardrailContextualGroundingFilterTypeGrounding GuardrailContextualGroundingFilterType = "GROUNDING" + GuardrailContextualGroundingFilterTypeRelevance GuardrailContextualGroundingFilterType = "RELEVANCE" +) + +// Values returns all known values for GuardrailContextualGroundingFilterType. +// Note that this can be expanded in the future, and so it is only as up to date as +// the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (GuardrailContextualGroundingFilterType) Values() []GuardrailContextualGroundingFilterType { + return []GuardrailContextualGroundingFilterType{ + "GROUNDING", + "RELEVANCE", + } +} + +type GuardrailContextualGroundingPolicyAction string + +// Enum values for GuardrailContextualGroundingPolicyAction +const ( + GuardrailContextualGroundingPolicyActionBlocked GuardrailContextualGroundingPolicyAction = "BLOCKED" + GuardrailContextualGroundingPolicyActionNone GuardrailContextualGroundingPolicyAction = "NONE" +) + +// Values returns all known values for GuardrailContextualGroundingPolicyAction. +// Note that this can be expanded in the future, and so it is only as up to date as +// the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (GuardrailContextualGroundingPolicyAction) Values() []GuardrailContextualGroundingPolicyAction { + return []GuardrailContextualGroundingPolicyAction{ + "BLOCKED", + "NONE", + } +} + +type GuardrailConverseContentQualifier string + +// Enum values for GuardrailConverseContentQualifier +const ( + GuardrailConverseContentQualifierGroundingSource GuardrailConverseContentQualifier = "grounding_source" + GuardrailConverseContentQualifierQuery GuardrailConverseContentQualifier = "query" + GuardrailConverseContentQualifierGuardContent GuardrailConverseContentQualifier = "guard_content" +) + +// Values returns all known values for GuardrailConverseContentQualifier. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (GuardrailConverseContentQualifier) Values() []GuardrailConverseContentQualifier { + return []GuardrailConverseContentQualifier{ + "grounding_source", + "query", + "guard_content", + } +} + type GuardrailManagedWordType string // Enum values for GuardrailManagedWordType diff --git a/service/bedrockruntime/types/types.go b/service/bedrockruntime/types/types.go index ee47914f934..42c713f4fd4 100644 --- a/service/bedrockruntime/types/types.go +++ b/service/bedrockruntime/types/types.go @@ -20,7 +20,7 @@ type AutoToolChoice struct { } // A block of content for a message that you pass to, or receive from, a model -// with the Converse API (Converse and ConverseStream). +// with the [Converse]or [ConverseStream] API operations. // // The following types satisfy this interface: // @@ -30,6 +30,9 @@ type AutoToolChoice struct { // ContentBlockMemberText // ContentBlockMemberToolResult // ContentBlockMemberToolUse +// +// [Converse]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html +// [ConverseStream]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html type ContentBlock interface { isContentBlock() } @@ -230,8 +233,10 @@ type ConverseStreamMetadataEvent struct { // This member is required. Usage *TokenUsage - // The trace object in the response from ConverseStream that contains information about the + // The trace object in the response from [ConverseStream] that contains information about the // guardrail behavior. + // + // [ConverseStream]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html Trace *ConverseStreamTrace noSmithyDocumentSerde @@ -316,7 +321,9 @@ type ConverseStreamOutputMemberMetadata struct { func (*ConverseStreamOutputMemberMetadata) isConverseStreamOutput() {} -// The trace object in a response from ConverseStream. Currently, you can only trace guardrails. +// The trace object in a response from [ConverseStream]. Currently, you can only trace guardrails. +// +// [ConverseStream]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html type ConverseStreamTrace struct { // The guardrail trace object. @@ -325,7 +332,9 @@ type ConverseStreamTrace struct { noSmithyDocumentSerde } -// The trace object in a response from Converse. Currently, you can only trace guardrails. +// The trace object in a response from [Converse]. Currently, you can only trace guardrails. +// +// [Converse]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html type ConverseTrace struct { // The guardrail trace object. @@ -334,11 +343,7 @@ type ConverseTrace struct { noSmithyDocumentSerde } -// A document to include in a message when sending a [Converse] or [ConverseStream] request. You can include -// up to 5 documents in a request. The maximum document size is 50 MB. -// -// [Converse]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html -// [ConverseStream]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html +// A document to include in a message. type DocumentBlock struct { // The format of a document, or its extension. @@ -346,7 +351,21 @@ type DocumentBlock struct { // This member is required. Format DocumentFormat - // A name for the document. + // A name for the document. The name can only contain the following characters: + // + // - Alphanumeric characters + // + // - Whitespace characters (no more than one in a row) + // + // - Hyphens + // + // - Parentheses + // + // - Square brackets + // + // This field is vulnerable to prompt injections, because the model might + // inadvertently interpret it as instructions. Therefore, we recommend that you + // specify a neutral name. // // This member is required. Name *string @@ -359,21 +378,17 @@ type DocumentBlock struct { noSmithyDocumentSerde } -// Contains the content of the document included in a message when sending a [Converse] or [ConverseStream] -// request or in the response. +// Contains the content of a document. // // The following types satisfy this interface: // // DocumentSourceMemberBytes -// -// [Converse]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html -// [ConverseStream]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html type DocumentSource interface { isDocumentSource() } -// A base64-encoded string of a UTF-8 encoded file, that is the document to -// include in the message. +// The raw bytes for the document. If you use an Amazon Web Services SDK, you +// don't need to encode the bytes in base64. type DocumentSourceMemberBytes struct { Value []byte @@ -389,6 +404,9 @@ type GuardrailAssessment struct { // The content policy. ContentPolicy *GuardrailContentPolicyAssessment + // The contextual grounding policy used for the guardrail assessment. + ContextualGroundingPolicy *GuardrailContextualGroundingPolicyAssessment + // The sensitive information policy. SensitiveInformationPolicy *GuardrailSensitiveInformationPolicyAssessment @@ -401,7 +419,9 @@ type GuardrailAssessment struct { noSmithyDocumentSerde } -// Configuration information for a guardrail that you use with the Converse action. +// Configuration information for a guardrail that you use with the [Converse] operation. +// +// [Converse]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html type GuardrailConfiguration struct { // The identifier for the guardrail. @@ -420,6 +440,24 @@ type GuardrailConfiguration struct { noSmithyDocumentSerde } +// The content block to be evaluated by the guardrail. +// +// The following types satisfy this interface: +// +// GuardrailContentBlockMemberText +type GuardrailContentBlock interface { + isGuardrailContentBlock() +} + +// Text within content block to be evaluated by the guardrail. +type GuardrailContentBlockMemberText struct { + Value GuardrailTextBlock + + noSmithyDocumentSerde +} + +func (*GuardrailContentBlockMemberText) isGuardrailContentBlock() {} + // The content filter for a guardrail. type GuardrailContentFilter struct { @@ -452,11 +490,50 @@ type GuardrailContentPolicyAssessment struct { noSmithyDocumentSerde } -// A content block for selective guarding with the Converse API (Converse and ConverseStream). +// The details for the guardrails contextual grounding filter. +type GuardrailContextualGroundingFilter struct { + + // The action performed by the guardrails contextual grounding filter. + // + // This member is required. + Action GuardrailContextualGroundingPolicyAction + + // The score generated by contextual grounding filter. + // + // This member is required. + Score *float64 + + // The threshold used by contextual grounding filter to determine whether the + // content is grounded or not. + // + // This member is required. + Threshold *float64 + + // The contextual grounding filter type. + // + // This member is required. + Type GuardrailContextualGroundingFilterType + + noSmithyDocumentSerde +} + +// The policy assessment details for the guardrails contextual grounding filter. +type GuardrailContextualGroundingPolicyAssessment struct { + + // The filter details for the guardrails contextual grounding filter. + Filters []GuardrailContextualGroundingFilter + + noSmithyDocumentSerde +} + +// A content block for selective guarding with the [Converse] or [ConverseStream] API operations. // // The following types satisfy this interface: // // GuardrailConverseContentBlockMemberText +// +// [Converse]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html +// [ConverseStream]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html type GuardrailConverseContentBlock interface { isGuardrailConverseContentBlock() } @@ -479,6 +556,9 @@ type GuardrailConverseTextBlock struct { // This member is required. Text *string + // The qualifier details for the guardrails contextual grounding filter. + Qualifiers []GuardrailConverseContentQualifier + noSmithyDocumentSerde } @@ -519,6 +599,15 @@ type GuardrailManagedWord struct { noSmithyDocumentSerde } +// The output content produced by the guardrail. +type GuardrailOutputContent struct { + + // The specific text for the output content produced by the guardrail. + Text *string + + noSmithyDocumentSerde +} + // A Personally Identifiable Information (PII) entity configured in a guardrail. type GuardrailPiiEntityFilter struct { @@ -601,6 +690,20 @@ type GuardrailStreamConfiguration struct { noSmithyDocumentSerde } +// The text block to be evaluated by the guardrail. +type GuardrailTextBlock struct { + + // The input text details to be evaluated by the guardrail. + // + // This member is required. + Text *string + + // The qualifiers describing the text block. + Qualifiers []GuardrailContentQualifier + + noSmithyDocumentSerde +} + // Information about a topic guardrail. type GuardrailTopic struct { @@ -649,6 +752,42 @@ type GuardrailTraceAssessment struct { noSmithyDocumentSerde } +// The details on the use of the guardrail. +type GuardrailUsage struct { + + // The content policy units processed by the guardrail. + // + // This member is required. + ContentPolicyUnits *int32 + + // The contextual grounding policy units processed by the guardrail. + // + // This member is required. + ContextualGroundingPolicyUnits *int32 + + // The sensitive information policy free units processed by the guardrail. + // + // This member is required. + SensitiveInformationPolicyFreeUnits *int32 + + // The sensitive information policy units processed by the guardrail. + // + // This member is required. + SensitiveInformationPolicyUnits *int32 + + // The topic policy units processed by the guardrail. + // + // This member is required. + TopicPolicyUnits *int32 + + // The word policy units processed by the guardrail. + // + // This member is required. + WordPolicyUnits *int32 + + noSmithyDocumentSerde +} + // The word policy assessment. type GuardrailWordPolicyAssessment struct { @@ -691,7 +830,7 @@ type ImageSource interface { } // The raw image bytes for the image. If you use an AWS SDK, you don't need to -// base64 encode the image bytes. +// encode the image bytes in base64. type ImageSourceMemberBytes struct { Value []byte @@ -755,7 +894,18 @@ type InferenceConfiguration struct { // [ConverseStream]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html type Message struct { - // The message content. + // The message content. Note the following restrictions: + // + // - You can include up to 20 images. Each image's size, height, and width must + // be no more than 3.75 MB, 8000 px, and 8000 px, respectively. + // + // - You can include up to five documents. Each document's size must be no more + // than 4.5 MB. + // + // - If you include a ContentBlock with a document field in the array, you must + // also include a ContentBlock with a text field. + // + // - You can only include images and documents if the role is user . // // This member is required. Content []ContentBlock @@ -844,11 +994,13 @@ type SystemContentBlock interface { isSystemContentBlock() } -// A content block to assess with the guardrail. Use with the Converse API (Converse and ConverseStream -// ). +// A content block to assess with the guardrail. Use with the [Converse] or [ConverseStream] API operations. // // For more information, see Use a guardrail with the Converse API in the Amazon // Bedrock User Guide. +// +// [Converse]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html +// [ConverseStream]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html type SystemContentBlockMemberGuardContent struct { Value GuardrailConverseContentBlock @@ -887,11 +1039,14 @@ type TokenUsage struct { noSmithyDocumentSerde } -// Information about a tool that you can use with the Converse API. +// Information about a tool that you can use with the Converse API. For more +// information, see [Tool use (function calling)]in the Amazon Bedrock User Guide. // // The following types satisfy this interface: // // ToolMemberToolSpec +// +// [Tool use (function calling)]: https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html type Tool interface { isTool() } @@ -947,10 +1102,13 @@ type ToolChoiceMemberTool struct { func (*ToolChoiceMemberTool) isToolChoice() {} -// Configuration information for the tools that you pass to a model. +// Configuration information for the tools that you pass to a model. For more +// information, see [Tool use (function calling)]in the Amazon Bedrock User Guide. // // This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere // Command R+, and Mistral Large models. +// +// [Tool use (function calling)]: https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html type ToolConfiguration struct { // An array of tools that you want to pass to a model. @@ -1142,6 +1300,7 @@ func (*UnknownUnionMember) isContentBlockStart() {} func (*UnknownUnionMember) isConverseOutput() {} func (*UnknownUnionMember) isConverseStreamOutput() {} func (*UnknownUnionMember) isDocumentSource() {} +func (*UnknownUnionMember) isGuardrailContentBlock() {} func (*UnknownUnionMember) isGuardrailConverseContentBlock() {} func (*UnknownUnionMember) isImageSource() {} func (*UnknownUnionMember) isResponseStream() {} diff --git a/service/bedrockruntime/types/types_exported_test.go b/service/bedrockruntime/types/types_exported_test.go index 496085dc419..33df35cbad8 100644 --- a/service/bedrockruntime/types/types_exported_test.go +++ b/service/bedrockruntime/types/types_exported_test.go @@ -160,6 +160,24 @@ func ExampleDocumentSource_outputUsage() { var _ []byte +func ExampleGuardrailContentBlock_outputUsage() { + var union types.GuardrailContentBlock + // type switches can be used to check the union value + switch v := union.(type) { + case *types.GuardrailContentBlockMemberText: + _ = v.Value // Value is types.GuardrailTextBlock + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.GuardrailTextBlock + func ExampleGuardrailConverseContentBlock_outputUsage() { var union types.GuardrailConverseContentBlock // type switches can be used to check the union value diff --git a/service/bedrockruntime/validators.go b/service/bedrockruntime/validators.go index b666d0c9abc..f8f660038a1 100644 --- a/service/bedrockruntime/validators.go +++ b/service/bedrockruntime/validators.go @@ -10,6 +10,26 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpApplyGuardrail struct { +} + +func (*validateOpApplyGuardrail) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpApplyGuardrail) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ApplyGuardrailInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpApplyGuardrailInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpConverse struct { } @@ -90,6 +110,10 @@ func (m *validateOpInvokeModelWithResponseStream) HandleInitialize(ctx context.C return next.HandleInitialize(ctx, in) } +func addOpApplyGuardrailValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpApplyGuardrail{}, middleware.After) +} + func addOpConverseValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpConverse{}, middleware.After) } @@ -201,6 +225,42 @@ func validateGuardrailConfiguration(v *types.GuardrailConfiguration) error { } } +func validateGuardrailContentBlock(v types.GuardrailContentBlock) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GuardrailContentBlock"} + switch uv := v.(type) { + case *types.GuardrailContentBlockMemberText: + if err := validateGuardrailTextBlock(&uv.Value); err != nil { + invalidParams.AddNested("[text]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateGuardrailContentBlockList(v []types.GuardrailContentBlock) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GuardrailContentBlockList"} + for i := range v { + if err := validateGuardrailContentBlock(v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateGuardrailConverseContentBlock(v types.GuardrailConverseContentBlock) error { if v == nil { return nil @@ -253,6 +313,21 @@ func validateGuardrailStreamConfiguration(v *types.GuardrailStreamConfiguration) } } +func validateGuardrailTextBlock(v *types.GuardrailTextBlock) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GuardrailTextBlock"} + if v.Text == nil { + invalidParams.Add(smithy.NewErrParamRequired("Text")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateImageBlock(v *types.ImageBlock) error { if v == nil { return nil @@ -542,6 +617,34 @@ func validateToolUseBlock(v *types.ToolUseBlock) error { } } +func validateOpApplyGuardrailInput(v *ApplyGuardrailInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ApplyGuardrailInput"} + if v.GuardrailIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("GuardrailIdentifier")) + } + if v.GuardrailVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("GuardrailVersion")) + } + if len(v.Source) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.Content == nil { + invalidParams.Add(smithy.NewErrParamRequired("Content")) + } else if v.Content != nil { + if err := validateGuardrailContentBlockList(v.Content); err != nil { + invalidParams.AddNested("Content", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpConverseInput(v *ConverseInput) error { if v == nil { return nil diff --git a/service/cloud9/internal/endpoints/endpoints.go b/service/cloud9/internal/endpoints/endpoints.go index 09e19c0d8bd..5f857159d2a 100644 --- a/service/cloud9/internal/endpoints/endpoints.go +++ b/service/cloud9/internal/endpoints/endpoints.go @@ -202,6 +202,18 @@ var defaultPartitions = endpoints.Partitions{ Region: "ca-central-1", Variant: endpoints.DualStackVariant, }: {}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloud9-fips.ca-central-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloud9-fips.ca-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, @@ -244,6 +256,51 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-west-3", Variant: endpoints.DualStackVariant, }: {}, + endpoints.EndpointKey{ + Region: "fips-ca-central-1", + }: endpoints.Endpoint{ + Hostname: "cloud9-fips.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-east-1", + }: endpoints.Endpoint{ + Hostname: "cloud9-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-east-2", + }: endpoints.Endpoint{ + Hostname: "cloud9-fips.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-west-1", + }: endpoints.Endpoint{ + Hostname: "cloud9-fips.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-west-2", + }: endpoints.Endpoint{ + Hostname: "cloud9-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "il-central-1", }: endpoints.Endpoint{}, @@ -272,6 +329,18 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-east-1", Variant: endpoints.DualStackVariant, }: {}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloud9-fips.us-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloud9-fips.us-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, @@ -279,6 +348,18 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-east-2", Variant: endpoints.DualStackVariant, }: {}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloud9-fips.us-east-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloud9-fips.us-east-2.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, @@ -286,6 +367,18 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-west-1", Variant: endpoints.DualStackVariant, }: {}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloud9-fips.us-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloud9-fips.us-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, @@ -293,6 +386,18 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-west-2", Variant: endpoints.DualStackVariant, }: {}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloud9-fips.us-west-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloud9-fips.us-west-2.api.aws", + }, }, }, { diff --git a/service/cloudcontrol/internal/endpoints/endpoints.go b/service/cloudcontrol/internal/endpoints/endpoints.go index c67f2f46a4c..a9419805c4f 100644 --- a/service/cloudcontrol/internal/endpoints/endpoints.go +++ b/service/cloudcontrol/internal/endpoints/endpoints.go @@ -142,36 +142,102 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "af-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.af-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ap-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ap-northeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ap-northeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ap-northeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ap-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-south-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ap-south-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ap-southeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ap-southeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ap-southeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ap-southeast-4.api.aws", + }, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, @@ -181,6 +247,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "cloudcontrolapi-fips.ca-central-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi-fips.ca-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ca-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "ca-west-1", }: endpoints.Endpoint{}, @@ -190,30 +268,90 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "cloudcontrolapi-fips.ca-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi-fips.ca-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.ca-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.eu-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-central-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.eu-central-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.eu-north-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.eu-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-south-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.eu-south-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.eu-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.eu-west-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.eu-west-3.api.aws", + }, endpoints.EndpointKey{ Region: "fips-ca-central-1", }: endpoints.Endpoint{ @@ -271,15 +409,39 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "il-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.il-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.me-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.me-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.sa-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, @@ -289,6 +451,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "cloudcontrolapi-fips.us-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi-fips.us-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.us-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, @@ -298,6 +472,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "cloudcontrolapi-fips.us-east-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi-fips.us-east-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.us-east-2.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, @@ -307,6 +493,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "cloudcontrolapi-fips.us-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi-fips.us-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.us-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, @@ -316,6 +514,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "cloudcontrolapi-fips.us-west-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi-fips.us-west-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.us-west-2.api.aws", + }, }, }, { @@ -356,9 +566,21 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "cn-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-north-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.cn-north-1.api.amazonwebservices.com.cn", + }, endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.cn-northwest-1.api.amazonwebservices.com.cn", + }, }, }, { @@ -520,6 +742,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "cloudcontrolapi-fips.us-gov-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi-fips.us-gov-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.us-gov-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, @@ -529,6 +763,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "cloudcontrolapi-fips.us-gov-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi-fips.us-gov-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudcontrolapi.us-gov-west-1.api.aws", + }, }, }, } diff --git a/service/ec2/api_op_CreateIpamPool.go b/service/ec2/api_op_CreateIpamPool.go index 87f993f1280..74ddb8fea57 100644 --- a/service/ec2/api_op_CreateIpamPool.go +++ b/service/ec2/api_op_CreateIpamPool.go @@ -104,15 +104,15 @@ type CreateIpamPoolInput struct { // UnauthorizedOperation . DryRun *bool - // In IPAM, the locale is the Amazon Web Services Region where you want to make an - // IPAM pool available for allocations. Only resources in the same Region as the - // locale of the pool can get IP address allocations from the pool. You can only - // allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale - // with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot - // modify it. If you do not choose a locale, resources in Regions others than the - // IPAM's home region cannot use CIDRs from this pool. + // In IPAM, the locale is the Amazon Web Services Region or, for IPAM IPv4 pools + // in the public scope, the network border group for an Amazon Web Services Local + // Zone where you want to make an IPAM pool available for allocations ([supported Local Zones] ). If you + // do not choose a locale, resources in Regions others than the IPAM's home region + // cannot use CIDRs from this pool. // // Possible values: Any Amazon Web Services Region, such as us-east-1. + // + // [supported Local Zones]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail Locale *string // The IP address source for pools in the public scope. Only used for provisioning diff --git a/service/ec2/api_op_CreatePublicIpv4Pool.go b/service/ec2/api_op_CreatePublicIpv4Pool.go index 18dc1987e14..e2681e8bd71 100644 --- a/service/ec2/api_op_CreatePublicIpv4Pool.go +++ b/service/ec2/api_op_CreatePublicIpv4Pool.go @@ -40,6 +40,14 @@ type CreatePublicIpv4PoolInput struct { // UnauthorizedOperation . DryRun *bool + // The Availability Zone (AZ) or Local Zone (LZ) network border group that the + // resource that the IP address is assigned to is in. Defaults to an AZ network + // border group. For more information on available Local Zones, see [Local Zone availability]in the Amazon + // EC2 User Guide. + // + // [Local Zone availability]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail + NetworkBorderGroup *string + // The key/value combination of a tag assigned to the resource. Use the tag key in // the filter name and the tag value as the filter value. For example, to find all // resources that have a tag with the key Owner and the value TeamA , specify diff --git a/service/ec2/api_op_DeletePublicIpv4Pool.go b/service/ec2/api_op_DeletePublicIpv4Pool.go index 1aaf34be7ab..dab8b5db43c 100644 --- a/service/ec2/api_op_DeletePublicIpv4Pool.go +++ b/service/ec2/api_op_DeletePublicIpv4Pool.go @@ -42,6 +42,14 @@ type DeletePublicIpv4PoolInput struct { // UnauthorizedOperation . DryRun *bool + // The Availability Zone (AZ) or Local Zone (LZ) network border group that the + // resource that the IP address is assigned to is in. Defaults to an AZ network + // border group. For more information on available Local Zones, see [Local Zone availability]in the Amazon + // EC2 User Guide. + // + // [Local Zone availability]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail + NetworkBorderGroup *string + noSmithyDocumentSerde } diff --git a/service/ec2/api_op_ProvisionPublicIpv4PoolCidr.go b/service/ec2/api_op_ProvisionPublicIpv4PoolCidr.go index c8dc09efe34..a100021fb86 100644 --- a/service/ec2/api_op_ProvisionPublicIpv4PoolCidr.go +++ b/service/ec2/api_op_ProvisionPublicIpv4PoolCidr.go @@ -55,6 +55,14 @@ type ProvisionPublicIpv4PoolCidrInput struct { // UnauthorizedOperation . DryRun *bool + // The Availability Zone (AZ) or Local Zone (LZ) network border group that the + // resource that the IP address is assigned to is in. Defaults to an AZ network + // border group. For more information on available Local Zones, see [Local Zone availability]in the Amazon + // EC2 User Guide. + // + // [Local Zone availability]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail + NetworkBorderGroup *string + noSmithyDocumentSerde } diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index 07f1e7f421e..6214ce086bc 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -89772,6 +89772,19 @@ func awsEc2query_deserializeDocumentIpamDiscoveredResourceCidr(v **types.IpamDis originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("availabilityZoneId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZoneId = ptr.String(xtv) + } + case strings.EqualFold("ipamResourceDiscoveryId", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -89802,6 +89815,19 @@ func awsEc2query_deserializeDocumentIpamDiscoveredResourceCidr(v **types.IpamDis sv.IpUsage = ptr.Float64(f64) } + case strings.EqualFold("networkInterfaceAttachmentStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NetworkInterfaceAttachmentStatus = types.IpamNetworkInterfaceAttachmentStatus(xtv) + } + case strings.EqualFold("resourceCidr", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -91416,6 +91442,19 @@ func awsEc2query_deserializeDocumentIpamResourceCidr(v **types.IpamResourceCidr, originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("availabilityZoneId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZoneId = ptr.String(xtv) + } + case strings.EqualFold("complianceStatus", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index 113204f4800..f6f83d444cf 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -53224,6 +53224,11 @@ func awsEc2query_serializeOpDocumentCreatePublicIpv4PoolInput(v *CreatePublicIpv objectKey.Boolean(*v.DryRun) } + if v.NetworkBorderGroup != nil { + objectKey := object.Key("NetworkBorderGroup") + objectKey.String(*v.NetworkBorderGroup) + } + if v.TagSpecifications != nil { objectKey := object.FlatKey("TagSpecification") if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { @@ -55748,6 +55753,11 @@ func awsEc2query_serializeOpDocumentDeletePublicIpv4PoolInput(v *DeletePublicIpv objectKey.Boolean(*v.DryRun) } + if v.NetworkBorderGroup != nil { + objectKey := object.Key("NetworkBorderGroup") + objectKey.String(*v.NetworkBorderGroup) + } + if v.PoolId != nil { objectKey := object.Key("PoolId") objectKey.String(*v.PoolId) @@ -67550,6 +67560,11 @@ func awsEc2query_serializeOpDocumentProvisionPublicIpv4PoolCidrInput(v *Provisio objectKey.Integer(*v.NetmaskLength) } + if v.NetworkBorderGroup != nil { + objectKey := object.Key("NetworkBorderGroup") + objectKey.String(*v.NetworkBorderGroup) + } + if v.PoolId != nil { objectKey := object.Key("PoolId") objectKey.String(*v.PoolId) diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index e13e4194d5a..da9c4ea8e6c 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -4983,6 +4983,26 @@ func (IpamManagementState) Values() []IpamManagementState { } } +type IpamNetworkInterfaceAttachmentStatus string + +// Enum values for IpamNetworkInterfaceAttachmentStatus +const ( + IpamNetworkInterfaceAttachmentStatusAvailable IpamNetworkInterfaceAttachmentStatus = "available" + IpamNetworkInterfaceAttachmentStatusInUse IpamNetworkInterfaceAttachmentStatus = "in-use" +) + +// Values returns all known values for IpamNetworkInterfaceAttachmentStatus. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (IpamNetworkInterfaceAttachmentStatus) Values() []IpamNetworkInterfaceAttachmentStatus { + return []IpamNetworkInterfaceAttachmentStatus{ + "available", + "in-use", + } +} + type IpamOverlapStatus string // Enum values for IpamOverlapStatus diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 9b0beb354c4..70d9e0e89b0 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -8399,8 +8399,12 @@ type IpamDiscoveredPublicAddress struct { // The resource discovery ID. IpamResourceDiscoveryId *string - // The network border group that the resource that the IP address is assigned to - // is in. + // The Availability Zone (AZ) or Local Zone (LZ) network border group that the + // resource that the IP address is assigned to is in. Defaults to an AZ network + // border group. For more information on available Local Zones, see [Local Zone availability]in the Amazon + // EC2 User Guide. + // + // [Local Zone availability]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail NetworkBorderGroup *string // The description of the network interface that IP address is assigned to. @@ -8444,6 +8448,9 @@ type IpamDiscoveredPublicAddress struct { // the resource. type IpamDiscoveredResourceCidr struct { + // The Availability Zone ID. + AvailabilityZoneId *string + // The percentage of IP address space in use. To convert the decimal to a // percentage, multiply the decimal by 100. Note the following: // @@ -8463,6 +8470,9 @@ type IpamDiscoveredResourceCidr struct { // The resource discovery ID. IpamResourceDiscoveryId *string + // For elastic IP addresses, this is the status of an attached network interface. + NetworkInterfaceAttachmentStatus IpamNetworkInterfaceAttachmentStatus + // The resource CIDR. ResourceCidr *string @@ -8615,13 +8625,13 @@ type IpamPool struct { IpamScopeType IpamScopeType // The locale of the IPAM pool. In IPAM, the locale is the Amazon Web Services - // Region where you want to make an IPAM pool available for allocations. Only - // resources in the same Region as the locale of the pool can get IP address - // allocations from the pool. You can only allocate a CIDR for a VPC, for example, - // from an IPAM pool that shares a locale with the VPC’s Region. Note that once you - // choose a Locale for a pool, you cannot modify it. If you choose an Amazon Web - // Services Region for locale that has not been configured as an operating Region - // for the IPAM, you'll get an error. + // Region or, for IPAM IPv4 pools in the public scope, the network border group for + // an Amazon Web Services Local Zone where you want to make an IPAM pool available + // for allocations ([supported Local Zones] ). If you choose an Amazon Web Services Region for locale that + // has not been configured as an operating Region for the IPAM, you'll get an + // error. + // + // [supported Local Zones]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail Locale *string // The Amazon Web Services account ID of the owner of the IPAM pool. @@ -8811,6 +8821,9 @@ type IpamPublicAddressTags struct { // The CIDR for an IPAM resource. type IpamResourceCidr struct { + // The Availability Zone ID. + AvailabilityZoneId *string + // The compliance status of the IPAM resource. For more information on compliance // statuses, see [Monitor CIDR usage by resource]in the Amazon VPC IPAM User Guide. // diff --git a/service/glue/deserializers.go b/service/glue/deserializers.go index fc328ed6520..73e669cf820 100644 --- a/service/glue/deserializers.go +++ b/service/glue/deserializers.go @@ -31997,6 +31997,98 @@ func awsAwsjson11_deserializeDocumentConditionCheckFailureException(v **types.Co return nil } +func awsAwsjson11_deserializeDocumentConditionExpression(v **types.ConditionExpression, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConditionExpression + if *v == nil { + sv = &types.ConditionExpression{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Condition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DatabrewCondition to be of type string, got %T instead", value) + } + sv.Condition = ptr.String(jtv) + } + + case "TargetColumn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetColumn to be of type string, got %T instead", value) + } + sv.TargetColumn = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DatabrewConditionValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentConditionExpressionList(v *[]types.ConditionExpression, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ConditionExpression + if *v == nil { + cv = []types.ConditionExpression{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ConditionExpression + destAddr := &col + if err := awsAwsjson11_deserializeDocumentConditionExpression(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentConditionList(v *[]types.Condition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -45855,6 +45947,42 @@ func awsAwsjson11_deserializeDocumentOtherMetadataValueListItem(v **types.OtherM return nil } +func awsAwsjson11_deserializeDocumentParameterMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParameterValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsAwsjson11_deserializeDocumentParametersMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -47003,6 +47131,56 @@ func awsAwsjson11_deserializeDocumentRecipe(v **types.Recipe, value interface{}) return err } + case "RecipeSteps": + if err := awsAwsjson11_deserializeDocumentRecipeSteps(&sv.RecipeSteps, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRecipeAction(v **types.RecipeAction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RecipeAction + if *v == nil { + sv = &types.RecipeAction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Operation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Operation to be of type string, got %T instead", value) + } + sv.Operation = ptr.String(jtv) + } + + case "Parameters": + if err := awsAwsjson11_deserializeDocumentParameterMap(&sv.Parameters, value); err != nil { + return err + } + default: _, _ = key, value @@ -47061,6 +47239,81 @@ func awsAwsjson11_deserializeDocumentRecipeReference(v **types.RecipeReference, return nil } +func awsAwsjson11_deserializeDocumentRecipeStep(v **types.RecipeStep, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RecipeStep + if *v == nil { + sv = &types.RecipeStep{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Action": + if err := awsAwsjson11_deserializeDocumentRecipeAction(&sv.Action, value); err != nil { + return err + } + + case "ConditionExpressions": + if err := awsAwsjson11_deserializeDocumentConditionExpressionList(&sv.ConditionExpressions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRecipeSteps(v *[]types.RecipeStep, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.RecipeStep + if *v == nil { + cv = []types.RecipeStep{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecipeStep + destAddr := &col + if err := awsAwsjson11_deserializeDocumentRecipeStep(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentRecrawlPolicy(v **types.RecrawlPolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/glue/serializers.go b/service/glue/serializers.go index f88eedd70e9..228edecf863 100644 --- a/service/glue/serializers.go +++ b/service/glue/serializers.go @@ -13895,6 +13895,41 @@ func awsAwsjson11_serializeDocumentCondition(v *types.Condition, value smithyjso return nil } +func awsAwsjson11_serializeDocumentConditionExpression(v *types.ConditionExpression, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Condition != nil { + ok := object.Key("Condition") + ok.String(*v.Condition) + } + + if v.TargetColumn != nil { + ok := object.Key("TargetColumn") + ok.String(*v.TargetColumn) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson11_serializeDocumentConditionExpressionList(v []types.ConditionExpression, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentConditionExpression(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentConditionList(v []types.Condition, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -17669,6 +17704,17 @@ func awsAwsjson11_serializeDocumentOrderList(v []types.Order, value smithyjson.V return nil } +func awsAwsjson11_serializeDocumentParameterMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + func awsAwsjson11_serializeDocumentParametersMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -18126,6 +18172,32 @@ func awsAwsjson11_serializeDocumentRecipe(v *types.Recipe, value smithyjson.Valu } } + if v.RecipeSteps != nil { + ok := object.Key("RecipeSteps") + if err := awsAwsjson11_serializeDocumentRecipeSteps(v.RecipeSteps, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentRecipeAction(v *types.RecipeAction, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Operation != nil { + ok := object.Key("Operation") + ok.String(*v.Operation) + } + + if v.Parameters != nil { + ok := object.Key("Parameters") + if err := awsAwsjson11_serializeDocumentParameterMap(v.Parameters, ok); err != nil { + return err + } + } + return nil } @@ -18146,6 +18218,40 @@ func awsAwsjson11_serializeDocumentRecipeReference(v *types.RecipeReference, val return nil } +func awsAwsjson11_serializeDocumentRecipeStep(v *types.RecipeStep, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("Action") + if err := awsAwsjson11_serializeDocumentRecipeAction(v.Action, ok); err != nil { + return err + } + } + + if v.ConditionExpressions != nil { + ok := object.Key("ConditionExpressions") + if err := awsAwsjson11_serializeDocumentConditionExpressionList(v.ConditionExpressions, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentRecipeSteps(v []types.RecipeStep, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentRecipeStep(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentRecrawlPolicy(v *types.RecrawlPolicy, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/glue/types/types.go b/service/glue/types/types.go index c2762a42759..486b00d62eb 100644 --- a/service/glue/types/types.go +++ b/service/glue/types/types.go @@ -1466,6 +1466,25 @@ type Condition struct { noSmithyDocumentSerde } +// Condition expression defined in the Glue Studio data preparation recipe node. +type ConditionExpression struct { + + // The condition of the condition expression. + // + // This member is required. + Condition *string + + // The target column of the condition expressions. + // + // This member is required. + TargetColumn *string + + // The value of the condition expression. + Value *string + + noSmithyDocumentSerde +} + // Specifies the values that an admin sets for each job or session parameter // configured in a Glue usage profile. type ConfigurationObject struct { @@ -6439,9 +6458,24 @@ type Recipe struct { Name *string // A reference to the DataBrew recipe used by the node. + RecipeReference *RecipeReference + + // Transform steps used in the recipe node. + RecipeSteps []RecipeStep + + noSmithyDocumentSerde +} + +// Actions defined in the Glue Studio data preparation recipe node. +type RecipeAction struct { + + // The operation of the recipe action. // // This member is required. - RecipeReference *RecipeReference + Operation *string + + // The parameters of the recipe action. + Parameters map[string]string noSmithyDocumentSerde } @@ -6462,6 +6496,20 @@ type RecipeReference struct { noSmithyDocumentSerde } +// A recipe step used in a Glue Studio data preparation recipe node. +type RecipeStep struct { + + // The transformation action of the recipe step. + // + // This member is required. + Action *RecipeAction + + // The condition expressions for the recipe step. + ConditionExpressions []ConditionExpression + + noSmithyDocumentSerde +} + // When crawling an Amazon S3 data source after the first crawl is complete, // specifies whether to crawl the entire dataset again or to crawl only folders // that were added since the last crawler run. For more information, see [Incremental Crawls in Glue]in the diff --git a/service/glue/validators.go b/service/glue/validators.go index 31329e61508..bc7ea4851ea 100644 --- a/service/glue/validators.go +++ b/service/glue/validators.go @@ -5435,6 +5435,41 @@ func validateColumnStatisticsData(v *types.ColumnStatisticsData) error { } } +func validateConditionExpression(v *types.ConditionExpression) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConditionExpression"} + if v.Condition == nil { + invalidParams.Add(smithy.NewErrParamRequired("Condition")) + } + if v.TargetColumn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetColumn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateConditionExpressionList(v []types.ConditionExpression) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConditionExpressionList"} + for i := range v { + if err := validateConditionExpression(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateConnectionInput(v *types.ConnectionInput) error { if v == nil { return nil @@ -7052,13 +7087,31 @@ func validateRecipe(v *types.Recipe) error { if v.Inputs == nil { invalidParams.Add(smithy.NewErrParamRequired("Inputs")) } - if v.RecipeReference == nil { - invalidParams.Add(smithy.NewErrParamRequired("RecipeReference")) - } else if v.RecipeReference != nil { + if v.RecipeReference != nil { if err := validateRecipeReference(v.RecipeReference); err != nil { invalidParams.AddNested("RecipeReference", err.(smithy.InvalidParamsError)) } } + if v.RecipeSteps != nil { + if err := validateRecipeSteps(v.RecipeSteps); err != nil { + invalidParams.AddNested("RecipeSteps", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRecipeAction(v *types.RecipeAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RecipeAction"} + if v.Operation == nil { + invalidParams.Add(smithy.NewErrParamRequired("Operation")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -7084,6 +7137,47 @@ func validateRecipeReference(v *types.RecipeReference) error { } } +func validateRecipeStep(v *types.RecipeStep) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RecipeStep"} + if v.Action == nil { + invalidParams.Add(smithy.NewErrParamRequired("Action")) + } else if v.Action != nil { + if err := validateRecipeAction(v.Action); err != nil { + invalidParams.AddNested("Action", err.(smithy.InvalidParamsError)) + } + } + if v.ConditionExpressions != nil { + if err := validateConditionExpressionList(v.ConditionExpressions); err != nil { + invalidParams.AddNested("ConditionExpressions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRecipeSteps(v []types.RecipeStep) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RecipeSteps"} + for i := range v { + if err := validateRecipeStep(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRedshiftSource(v *types.RedshiftSource) error { if v == nil { return nil diff --git a/service/groundstation/types/types.go b/service/groundstation/types/types.go index 66316d5ceb9..c4f8f4f5704 100644 --- a/service/groundstation/types/types.go +++ b/service/groundstation/types/types.go @@ -605,7 +605,16 @@ type EphemerisData interface { isEphemerisData() } -// Ephemeris data in Orbit Ephemeris Message (OEM) format. +// Ephemeris data in Orbit Ephemeris Message (OEM) format. +// +// Position, velocity, and acceleration units must be represented in km , km/s , +// and km/s**2 , respectively, in ephemeris data lines. Covariance matrix line +// units must be represented in km**2 if computed from two positions, km**2/s if +// computed from one position and one velocity, and km**2/s**2 if computed from +// two velocities. Consult section 7.7.2 of The Consultative Committee for Space +// Data Systems (CCSDS) [Recommended Standard for Orbit Data Messages]for more information. +// +// [Recommended Standard for Orbit Data Messages]: https://public.ccsds.org/Pubs/502x0b3e1.pdf type EphemerisDataMemberOem struct { Value OEMEphemeris @@ -851,7 +860,16 @@ type MissionProfileListItem struct { noSmithyDocumentSerde } -// Ephemeris data in Orbit Ephemeris Message (OEM) format. +// Ephemeris data in Orbit Ephemeris Message (OEM) format. +// +// Position, velocity, and acceleration units must be represented in km , km/s , +// and km/s**2 , respectively, in ephemeris data lines. Covariance matrix line +// units must be represented in km**2 if computed from two positions, km**2/s if +// computed from one position and one velocity, and km**2/s**2 if computed from +// two velocities. Consult section 7.7.2 of The Consultative Committee for Space +// Data Systems (CCSDS) [Recommended Standard for Orbit Data Messages]for more information. +// +// [Recommended Standard for Orbit Data Messages]: https://public.ccsds.org/Pubs/502x0b3e1.pdf type OEMEphemeris struct { // The data for an OEM ephemeris, supplied directly in the request rather than diff --git a/service/licensemanagerlinuxsubscriptions/api_op_DeregisterSubscriptionProvider.go b/service/licensemanagerlinuxsubscriptions/api_op_DeregisterSubscriptionProvider.go new file mode 100644 index 00000000000..b10b2090c8f --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/api_op_DeregisterSubscriptionProvider.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanagerlinuxsubscriptions + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Remove a third-party subscription provider from the Bring Your Own License +// (BYOL) subscriptions registered to your account. +func (c *Client) DeregisterSubscriptionProvider(ctx context.Context, params *DeregisterSubscriptionProviderInput, optFns ...func(*Options)) (*DeregisterSubscriptionProviderOutput, error) { + if params == nil { + params = &DeregisterSubscriptionProviderInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeregisterSubscriptionProvider", params, optFns, c.addOperationDeregisterSubscriptionProviderMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeregisterSubscriptionProviderOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeregisterSubscriptionProviderInput struct { + + // The Amazon Resource Name (ARN) of the subscription provider resource to + // deregister. + // + // This member is required. + SubscriptionProviderArn *string + + noSmithyDocumentSerde +} + +type DeregisterSubscriptionProviderOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeregisterSubscriptionProviderMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeregisterSubscriptionProvider{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeregisterSubscriptionProvider{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterSubscriptionProvider"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeregisterSubscriptionProviderValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterSubscriptionProvider(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeregisterSubscriptionProvider(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeregisterSubscriptionProvider", + } +} diff --git a/service/licensemanagerlinuxsubscriptions/api_op_GetRegisteredSubscriptionProvider.go b/service/licensemanagerlinuxsubscriptions/api_op_GetRegisteredSubscriptionProvider.go new file mode 100644 index 00000000000..50ad3e8f5d8 --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/api_op_GetRegisteredSubscriptionProvider.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanagerlinuxsubscriptions + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/licensemanagerlinuxsubscriptions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get details for a Bring Your Own License (BYOL) subscription that's registered +// to your account. +func (c *Client) GetRegisteredSubscriptionProvider(ctx context.Context, params *GetRegisteredSubscriptionProviderInput, optFns ...func(*Options)) (*GetRegisteredSubscriptionProviderOutput, error) { + if params == nil { + params = &GetRegisteredSubscriptionProviderInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRegisteredSubscriptionProvider", params, optFns, c.addOperationGetRegisteredSubscriptionProviderMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRegisteredSubscriptionProviderOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRegisteredSubscriptionProviderInput struct { + + // The Amazon Resource Name (ARN) of the BYOL registration resource to get details + // for. + // + // This member is required. + SubscriptionProviderArn *string + + noSmithyDocumentSerde +} + +type GetRegisteredSubscriptionProviderOutput struct { + + // The timestamp from the last time License Manager retrieved subscription details + // from your registered third-party Linux subscription provider. + LastSuccessfulDataRetrievalTime *string + + // The Amazon Resource Name (ARN) of the third-party access secret stored in + // Secrets Manager for the BYOL registration resource specified in the request. + SecretArn *string + + // The Amazon Resource Name (ARN) for the BYOL registration resource specified in + // the request. + SubscriptionProviderArn *string + + // The subscription provider for the BYOL registration resource specified in the + // request. + SubscriptionProviderSource types.SubscriptionProviderSource + + // The status of the Linux subscription provider access token from the last + // successful subscription data request. + SubscriptionProviderStatus types.SubscriptionProviderStatus + + // The detailed message from your subscription provider token status. + SubscriptionProviderStatusMessage *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRegisteredSubscriptionProviderMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRegisteredSubscriptionProvider{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRegisteredSubscriptionProvider{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetRegisteredSubscriptionProvider"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetRegisteredSubscriptionProviderValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRegisteredSubscriptionProvider(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetRegisteredSubscriptionProvider(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetRegisteredSubscriptionProvider", + } +} diff --git a/service/licensemanagerlinuxsubscriptions/api_op_GetServiceSettings.go b/service/licensemanagerlinuxsubscriptions/api_op_GetServiceSettings.go index 8a71e5c2174..c26482277fa 100644 --- a/service/licensemanagerlinuxsubscriptions/api_op_GetServiceSettings.go +++ b/service/licensemanagerlinuxsubscriptions/api_op_GetServiceSettings.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the Linux subscriptions service settings. +// Lists the Linux subscriptions service settings for your account. func (c *Client) GetServiceSettings(ctx context.Context, params *GetServiceSettingsInput, optFns ...func(*Options)) (*GetServiceSettingsOutput, error) { if params == nil { params = &GetServiceSettingsInput{} diff --git a/service/licensemanagerlinuxsubscriptions/api_op_ListLinuxSubscriptionInstances.go b/service/licensemanagerlinuxsubscriptions/api_op_ListLinuxSubscriptionInstances.go index b0d5867486a..2569ad519bc 100644 --- a/service/licensemanagerlinuxsubscriptions/api_op_ListLinuxSubscriptionInstances.go +++ b/service/licensemanagerlinuxsubscriptions/api_op_ListLinuxSubscriptionInstances.go @@ -32,30 +32,34 @@ func (c *Client) ListLinuxSubscriptionInstances(ctx context.Context, params *Lis // parameters in request increases. type ListLinuxSubscriptionInstancesInput struct { - // An array of structures that you can use to filter the results to those that - // match one or more sets of key-value pairs that you specify. For example, you can - // filter by the name of AmiID with an optional operator to see subscriptions that - // match, partially match, or don't match a certain Amazon Machine Image (AMI) ID. + // An array of structures that you can use to filter the results by your specified + // criteria. For example, you can specify Region in the Name , with the contains + // operator to list all subscriptions that match a partial string in the Value , + // such as us-west . // - // The valid names for this filter are: + // For each filter, you can specify one of the following values for the Name key + // to streamline results: + // + // - AccountID // // - AmiID // + // - DualSubscription + // // - InstanceID // - // - AccountID + // - InstanceType // - // - Status + // - ProductCode // // - Region // - // - UsageOperation - // - // - ProductCode + // - Status // - // - InstanceType + // - UsageOperation // - // The valid Operators for this filter are: + // For each filter, you can use one of the following Operator values to define the + // behavior of the filter: // // - contains // @@ -64,10 +68,11 @@ type ListLinuxSubscriptionInstancesInput struct { // - Notequal Filters []types.Filter - // Maximum number of results to return in a single call. + // The maximum items to return in a request. MaxResults *int32 - // Token for the next set of results. + // A token to specify where to start paginating. This is the nextToken from a + // previously truncated response. NextToken *string noSmithyDocumentSerde @@ -78,7 +83,9 @@ type ListLinuxSubscriptionInstancesOutput struct { // An array that contains instance objects. Instances []types.Instance - // Token for the next set of results. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service hasn't included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // Metadata pertaining to the operation's result. @@ -172,7 +179,7 @@ func (c *Client) addOperationListLinuxSubscriptionInstancesMiddlewares(stack *mi // ListLinuxSubscriptionInstancesPaginatorOptions is the paginator options for // ListLinuxSubscriptionInstances type ListLinuxSubscriptionInstancesPaginatorOptions struct { - // Maximum number of results to return in a single call. + // The maximum items to return in a request. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/licensemanagerlinuxsubscriptions/api_op_ListLinuxSubscriptions.go b/service/licensemanagerlinuxsubscriptions/api_op_ListLinuxSubscriptions.go index 454bfa90fb4..d55d0c4d223 100644 --- a/service/licensemanagerlinuxsubscriptions/api_op_ListLinuxSubscriptions.go +++ b/service/licensemanagerlinuxsubscriptions/api_op_ListLinuxSubscriptions.go @@ -52,10 +52,11 @@ type ListLinuxSubscriptionsInput struct { // - Notequal Filters []types.Filter - // Maximum number of results to return in a single call. + // The maximum items to return in a request. MaxResults *int32 - // Token for the next set of results. + // A token to specify where to start paginating. This is the nextToken from a + // previously truncated response. NextToken *string noSmithyDocumentSerde @@ -63,7 +64,9 @@ type ListLinuxSubscriptionsInput struct { type ListLinuxSubscriptionsOutput struct { - // Token for the next set of results. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service hasn't included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // An array that contains subscription objects. @@ -160,7 +163,7 @@ func (c *Client) addOperationListLinuxSubscriptionsMiddlewares(stack *middleware // ListLinuxSubscriptionsPaginatorOptions is the paginator options for // ListLinuxSubscriptions type ListLinuxSubscriptionsPaginatorOptions struct { - // Maximum number of results to return in a single call. + // The maximum items to return in a request. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/licensemanagerlinuxsubscriptions/api_op_ListRegisteredSubscriptionProviders.go b/service/licensemanagerlinuxsubscriptions/api_op_ListRegisteredSubscriptionProviders.go new file mode 100644 index 00000000000..10b57a6fa72 --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/api_op_ListRegisteredSubscriptionProviders.go @@ -0,0 +1,248 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanagerlinuxsubscriptions + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/licensemanagerlinuxsubscriptions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List Bring Your Own License (BYOL) subscription registration resources for your +// account. +func (c *Client) ListRegisteredSubscriptionProviders(ctx context.Context, params *ListRegisteredSubscriptionProvidersInput, optFns ...func(*Options)) (*ListRegisteredSubscriptionProvidersOutput, error) { + if params == nil { + params = &ListRegisteredSubscriptionProvidersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRegisteredSubscriptionProviders", params, optFns, c.addOperationListRegisteredSubscriptionProvidersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRegisteredSubscriptionProvidersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRegisteredSubscriptionProvidersInput struct { + + // The maximum items to return in a request. + MaxResults *int32 + + // A token to specify where to start paginating. This is the nextToken from a + // previously truncated response. + NextToken *string + + // To filter your results, specify which subscription providers to return in the + // list. + SubscriptionProviderSources []types.SubscriptionProviderSource + + noSmithyDocumentSerde +} + +type ListRegisteredSubscriptionProvidersOutput struct { + + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service hasn't included in this request. Use + // this token with the next request to retrieve additional objects. + NextToken *string + + // The list of BYOL registration resources that fit the criteria you specified in + // the request. + RegisteredSubscriptionProviders []types.RegisteredSubscriptionProvider + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRegisteredSubscriptionProvidersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListRegisteredSubscriptionProviders{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRegisteredSubscriptionProviders{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListRegisteredSubscriptionProviders"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRegisteredSubscriptionProviders(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListRegisteredSubscriptionProvidersPaginatorOptions is the paginator options +// for ListRegisteredSubscriptionProviders +type ListRegisteredSubscriptionProvidersPaginatorOptions struct { + // The maximum items to return in a request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListRegisteredSubscriptionProvidersPaginator is a paginator for +// ListRegisteredSubscriptionProviders +type ListRegisteredSubscriptionProvidersPaginator struct { + options ListRegisteredSubscriptionProvidersPaginatorOptions + client ListRegisteredSubscriptionProvidersAPIClient + params *ListRegisteredSubscriptionProvidersInput + nextToken *string + firstPage bool +} + +// NewListRegisteredSubscriptionProvidersPaginator returns a new +// ListRegisteredSubscriptionProvidersPaginator +func NewListRegisteredSubscriptionProvidersPaginator(client ListRegisteredSubscriptionProvidersAPIClient, params *ListRegisteredSubscriptionProvidersInput, optFns ...func(*ListRegisteredSubscriptionProvidersPaginatorOptions)) *ListRegisteredSubscriptionProvidersPaginator { + if params == nil { + params = &ListRegisteredSubscriptionProvidersInput{} + } + + options := ListRegisteredSubscriptionProvidersPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListRegisteredSubscriptionProvidersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRegisteredSubscriptionProvidersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListRegisteredSubscriptionProviders page. +func (p *ListRegisteredSubscriptionProvidersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRegisteredSubscriptionProvidersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListRegisteredSubscriptionProviders(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListRegisteredSubscriptionProvidersAPIClient is a client that implements the +// ListRegisteredSubscriptionProviders operation. +type ListRegisteredSubscriptionProvidersAPIClient interface { + ListRegisteredSubscriptionProviders(context.Context, *ListRegisteredSubscriptionProvidersInput, ...func(*Options)) (*ListRegisteredSubscriptionProvidersOutput, error) +} + +var _ ListRegisteredSubscriptionProvidersAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListRegisteredSubscriptionProviders(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListRegisteredSubscriptionProviders", + } +} diff --git a/service/licensemanagerlinuxsubscriptions/api_op_ListTagsForResource.go b/service/licensemanagerlinuxsubscriptions/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..9c0285e496d --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/api_op_ListTagsForResource.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanagerlinuxsubscriptions + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List the metadata tags that are assigned to the specified Amazon Web Services +// resource. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource for which to list metadata tags. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // The metadata tags for the requested resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTagsForResource", + } +} diff --git a/service/licensemanagerlinuxsubscriptions/api_op_RegisterSubscriptionProvider.go b/service/licensemanagerlinuxsubscriptions/api_op_RegisterSubscriptionProvider.go new file mode 100644 index 00000000000..b7b160df769 --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/api_op_RegisterSubscriptionProvider.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanagerlinuxsubscriptions + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/licensemanagerlinuxsubscriptions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Register the supported third-party subscription provider for your Bring Your +// Own License (BYOL) subscription. +func (c *Client) RegisterSubscriptionProvider(ctx context.Context, params *RegisterSubscriptionProviderInput, optFns ...func(*Options)) (*RegisterSubscriptionProviderOutput, error) { + if params == nil { + params = &RegisterSubscriptionProviderInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RegisterSubscriptionProvider", params, optFns, c.addOperationRegisterSubscriptionProviderMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RegisterSubscriptionProviderOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RegisterSubscriptionProviderInput struct { + + // The Amazon Resource Name (ARN) of the secret where you've stored your + // subscription provider's access token. For RHEL subscriptions managed through the + // Red Hat Subscription Manager (RHSM), the secret contains your Red Hat Offline + // token. + // + // This member is required. + SecretArn *string + + // The supported Linux subscription provider to register. + // + // This member is required. + SubscriptionProviderSource types.SubscriptionProviderSource + + // The metadata tags to assign to your registered Linux subscription provider + // resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +type RegisterSubscriptionProviderOutput struct { + + // The Amazon Resource Name (ARN) of the Linux subscription provider resource that + // you registered. + SubscriptionProviderArn *string + + // The Linux subscription provider that you registered. + SubscriptionProviderSource types.SubscriptionProviderSource + + // Indicates the status of the registration action for the Linux subscription + // provider that you requested. + SubscriptionProviderStatus types.SubscriptionProviderStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRegisterSubscriptionProviderMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterSubscriptionProvider{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterSubscriptionProvider{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterSubscriptionProvider"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRegisterSubscriptionProviderValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterSubscriptionProvider(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRegisterSubscriptionProvider(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RegisterSubscriptionProvider", + } +} diff --git a/service/licensemanagerlinuxsubscriptions/api_op_TagResource.go b/service/licensemanagerlinuxsubscriptions/api_op_TagResource.go new file mode 100644 index 00000000000..eacf3b8fc83 --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/api_op_TagResource.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanagerlinuxsubscriptions + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Add metadata tags to the specified Amazon Web Services resource. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) of the Amazon Web Services resource to which to + // add the specified metadata tags. + // + // This member is required. + ResourceArn *string + + // The metadata tags to assign to the Amazon Web Services resource. Tags are + // formatted as key value pairs. + // + // This member is required. + Tags map[string]string + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TagResource", + } +} diff --git a/service/licensemanagerlinuxsubscriptions/api_op_UntagResource.go b/service/licensemanagerlinuxsubscriptions/api_op_UntagResource.go new file mode 100644 index 00000000000..3a68279e325 --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/api_op_UntagResource.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanagerlinuxsubscriptions + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Remove one or more metadata tag from the specified Amazon Web Services resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) of the Amazon Web Services resource to remove + // the metadata tags from. + // + // This member is required. + ResourceArn *string + + // A list of metadata tag keys to remove from the requested resource. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UntagResource", + } +} diff --git a/service/licensemanagerlinuxsubscriptions/deserializers.go b/service/licensemanagerlinuxsubscriptions/deserializers.go index 214da031a1b..aa235be7eb1 100644 --- a/service/licensemanagerlinuxsubscriptions/deserializers.go +++ b/service/licensemanagerlinuxsubscriptions/deserializers.go @@ -28,14 +28,14 @@ func deserializeS3Expires(v string) (*time.Time, error) { return &t, nil } -type awsRestjson1_deserializeOpGetServiceSettings struct { +type awsRestjson1_deserializeOpDeregisterSubscriptionProvider struct { } -func (*awsRestjson1_deserializeOpGetServiceSettings) ID() string { +func (*awsRestjson1_deserializeOpDeregisterSubscriptionProvider) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetServiceSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeregisterSubscriptionProvider) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -49,9 +49,101 @@ func (m *awsRestjson1_deserializeOpGetServiceSettings) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetServiceSettings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeregisterSubscriptionProvider(response, &metadata) } - output := &GetServiceSettingsOutput{} + output := &DeregisterSubscriptionProviderOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeregisterSubscriptionProvider(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetRegisteredSubscriptionProvider struct { +} + +func (*awsRestjson1_deserializeOpGetRegisteredSubscriptionProvider) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetRegisteredSubscriptionProvider) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetRegisteredSubscriptionProvider(response, &metadata) + } + output := &GetRegisteredSubscriptionProviderOutput{} out.Result = output var buff [1024]byte @@ -72,7 +164,7 @@ func (m *awsRestjson1_deserializeOpGetServiceSettings) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetRegisteredSubscriptionProviderOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -85,7 +177,7 @@ func (m *awsRestjson1_deserializeOpGetServiceSettings) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetServiceSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetRegisteredSubscriptionProvider(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -129,6 +221,9 @@ func awsRestjson1_deserializeOpErrorGetServiceSettings(response *smithyhttp.Resp case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -145,7 +240,7 @@ func awsRestjson1_deserializeOpErrorGetServiceSettings(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(v **GetServiceSettingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetRegisteredSubscriptionProviderOutput(v **GetRegisteredSubscriptionProviderOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -158,46 +253,67 @@ func awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(v **GetServiceSe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetServiceSettingsOutput + var sv *GetRegisteredSubscriptionProviderOutput if *v == nil { - sv = &GetServiceSettingsOutput{} + sv = &GetRegisteredSubscriptionProviderOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "HomeRegions": - if err := awsRestjson1_deserializeDocumentStringList(&sv.HomeRegions, value); err != nil { - return err + case "LastSuccessfulDataRetrievalTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.LastSuccessfulDataRetrievalTime = ptr.String(jtv) } - case "LinuxSubscriptionsDiscovery": + case "SecretArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LinuxSubscriptionsDiscovery to be of type string, got %T instead", value) + return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) } - sv.LinuxSubscriptionsDiscovery = types.LinuxSubscriptionsDiscovery(jtv) + sv.SecretArn = ptr.String(jtv) } - case "LinuxSubscriptionsDiscoverySettings": - if err := awsRestjson1_deserializeDocumentLinuxSubscriptionsDiscoverySettings(&sv.LinuxSubscriptionsDiscoverySettings, value); err != nil { - return err + case "SubscriptionProviderArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionProviderArn to be of type string, got %T instead", value) + } + sv.SubscriptionProviderArn = ptr.String(jtv) } - case "Status": + case "SubscriptionProviderSource": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Status to be of type string, got %T instead", value) + return fmt.Errorf("expected SubscriptionProviderSource to be of type string, got %T instead", value) } - sv.Status = types.Status(jtv) + sv.SubscriptionProviderSource = types.SubscriptionProviderSource(jtv) } - case "StatusMessage": - if err := awsRestjson1_deserializeDocumentStringMap(&sv.StatusMessage, value); err != nil { - return err + case "SubscriptionProviderStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionProviderStatus to be of type string, got %T instead", value) + } + sv.SubscriptionProviderStatus = types.SubscriptionProviderStatus(jtv) + } + + case "SubscriptionProviderStatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionProviderStatusMessage = ptr.String(jtv) } default: @@ -209,14 +325,14 @@ func awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(v **GetServiceSe return nil } -type awsRestjson1_deserializeOpListLinuxSubscriptionInstances struct { +type awsRestjson1_deserializeOpGetServiceSettings struct { } -func (*awsRestjson1_deserializeOpListLinuxSubscriptionInstances) ID() string { +func (*awsRestjson1_deserializeOpGetServiceSettings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListLinuxSubscriptionInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetServiceSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -230,9 +346,9 @@ func (m *awsRestjson1_deserializeOpListLinuxSubscriptionInstances) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListLinuxSubscriptionInstances(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetServiceSettings(response, &metadata) } - output := &ListLinuxSubscriptionInstancesOutput{} + output := &GetServiceSettingsOutput{} out.Result = output var buff [1024]byte @@ -253,7 +369,7 @@ func (m *awsRestjson1_deserializeOpListLinuxSubscriptionInstances) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListLinuxSubscriptionInstancesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -266,7 +382,7 @@ func (m *awsRestjson1_deserializeOpListLinuxSubscriptionInstances) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorListLinuxSubscriptionInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetServiceSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -326,7 +442,7 @@ func awsRestjson1_deserializeOpErrorListLinuxSubscriptionInstances(response *smi } } -func awsRestjson1_deserializeOpDocumentListLinuxSubscriptionInstancesOutput(v **ListLinuxSubscriptionInstancesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(v **GetServiceSettingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -339,27 +455,46 @@ func awsRestjson1_deserializeOpDocumentListLinuxSubscriptionInstancesOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListLinuxSubscriptionInstancesOutput + var sv *GetServiceSettingsOutput if *v == nil { - sv = &ListLinuxSubscriptionInstancesOutput{} + sv = &GetServiceSettingsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Instances": - if err := awsRestjson1_deserializeDocumentInstanceList(&sv.Instances, value); err != nil { + case "HomeRegions": + if err := awsRestjson1_deserializeDocumentStringList(&sv.HomeRegions, value); err != nil { return err } - case "NextToken": + case "LinuxSubscriptionsDiscovery": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected LinuxSubscriptionsDiscovery to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.LinuxSubscriptionsDiscovery = types.LinuxSubscriptionsDiscovery(jtv) + } + + case "LinuxSubscriptionsDiscoverySettings": + if err := awsRestjson1_deserializeDocumentLinuxSubscriptionsDiscoverySettings(&sv.LinuxSubscriptionsDiscoverySettings, value); err != nil { + return err + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Status to be of type string, got %T instead", value) + } + sv.Status = types.Status(jtv) + } + + case "StatusMessage": + if err := awsRestjson1_deserializeDocumentStringMap(&sv.StatusMessage, value); err != nil { + return err } default: @@ -371,14 +506,14 @@ func awsRestjson1_deserializeOpDocumentListLinuxSubscriptionInstancesOutput(v ** return nil } -type awsRestjson1_deserializeOpListLinuxSubscriptions struct { +type awsRestjson1_deserializeOpListLinuxSubscriptionInstances struct { } -func (*awsRestjson1_deserializeOpListLinuxSubscriptions) ID() string { +func (*awsRestjson1_deserializeOpListLinuxSubscriptionInstances) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListLinuxSubscriptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListLinuxSubscriptionInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -392,9 +527,9 @@ func (m *awsRestjson1_deserializeOpListLinuxSubscriptions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListLinuxSubscriptions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListLinuxSubscriptionInstances(response, &metadata) } - output := &ListLinuxSubscriptionsOutput{} + output := &ListLinuxSubscriptionInstancesOutput{} out.Result = output var buff [1024]byte @@ -415,7 +550,7 @@ func (m *awsRestjson1_deserializeOpListLinuxSubscriptions) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListLinuxSubscriptionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListLinuxSubscriptionInstancesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -428,7 +563,7 @@ func (m *awsRestjson1_deserializeOpListLinuxSubscriptions) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListLinuxSubscriptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListLinuxSubscriptionInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -488,7 +623,7 @@ func awsRestjson1_deserializeOpErrorListLinuxSubscriptions(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListLinuxSubscriptionsOutput(v **ListLinuxSubscriptionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListLinuxSubscriptionInstancesOutput(v **ListLinuxSubscriptionInstancesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -501,15 +636,20 @@ func awsRestjson1_deserializeOpDocumentListLinuxSubscriptionsOutput(v **ListLinu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListLinuxSubscriptionsOutput + var sv *ListLinuxSubscriptionInstancesOutput if *v == nil { - sv = &ListLinuxSubscriptionsOutput{} + sv = &ListLinuxSubscriptionInstancesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "Instances": + if err := awsRestjson1_deserializeDocumentInstanceList(&sv.Instances, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -519,18 +659,840 @@ func awsRestjson1_deserializeOpDocumentListLinuxSubscriptionsOutput(v **ListLinu sv.NextToken = ptr.String(jtv) } - case "Subscriptions": - if err := awsRestjson1_deserializeDocumentSubscriptionList(&sv.Subscriptions, value); err != nil { - return err - } + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListLinuxSubscriptions struct { +} + +func (*awsRestjson1_deserializeOpListLinuxSubscriptions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListLinuxSubscriptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListLinuxSubscriptions(response, &metadata) + } + output := &ListLinuxSubscriptionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListLinuxSubscriptionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListLinuxSubscriptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListLinuxSubscriptionsOutput(v **ListLinuxSubscriptionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListLinuxSubscriptionsOutput + if *v == nil { + sv = &ListLinuxSubscriptionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Subscriptions": + if err := awsRestjson1_deserializeDocumentSubscriptionList(&sv.Subscriptions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListRegisteredSubscriptionProviders struct { +} + +func (*awsRestjson1_deserializeOpListRegisteredSubscriptionProviders) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListRegisteredSubscriptionProviders) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListRegisteredSubscriptionProviders(response, &metadata) + } + output := &ListRegisteredSubscriptionProvidersOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListRegisteredSubscriptionProvidersOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListRegisteredSubscriptionProviders(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListRegisteredSubscriptionProvidersOutput(v **ListRegisteredSubscriptionProvidersOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListRegisteredSubscriptionProvidersOutput + if *v == nil { + sv = &ListRegisteredSubscriptionProvidersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "RegisteredSubscriptionProviders": + if err := awsRestjson1_deserializeDocumentRegisteredSubscriptionProviderList(&sv.RegisteredSubscriptionProviders, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRegisterSubscriptionProvider struct { +} + +func (*awsRestjson1_deserializeOpRegisterSubscriptionProvider) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRegisterSubscriptionProvider) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorRegisterSubscriptionProvider(response, &metadata) + } + output := &RegisterSubscriptionProviderOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentRegisterSubscriptionProviderOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorRegisterSubscriptionProvider(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentRegisterSubscriptionProviderOutput(v **RegisterSubscriptionProviderOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RegisterSubscriptionProviderOutput + if *v == nil { + sv = &RegisterSubscriptionProviderOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SubscriptionProviderArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionProviderArn = ptr.String(jtv) + } + + case "SubscriptionProviderSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionProviderSource to be of type string, got %T instead", value) + } + sv.SubscriptionProviderSource = types.SubscriptionProviderSource(jtv) + } + + case "SubscriptionProviderStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionProviderStatus to be of type string, got %T instead", value) + } + sv.SubscriptionProviderStatus = types.SubscriptionProviderStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - default: - _, _ = key, value + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + } - *v = sv - return nil } type awsRestjson1_deserializeOpUpdateServiceSettings struct { @@ -750,6 +1712,42 @@ func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.R return output } +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ThrottlingException{} var buff [1024]byte @@ -862,6 +1860,15 @@ func awsRestjson1_deserializeDocumentInstance(v **types.Instance, value interfac sv.AmiId = ptr.String(jtv) } + case "DualSubscription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DualSubscription = ptr.String(jtv) + } + case "InstanceID": if value != nil { jtv, ok := value.(string) @@ -889,6 +1896,15 @@ func awsRestjson1_deserializeDocumentInstance(v **types.Instance, value interfac sv.LastUpdatedTime = ptr.String(jtv) } + case "OsVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OsVersion = ptr.String(jtv) + } + case "ProductCode": if err := awsRestjson1_deserializeDocumentProductCodeList(&sv.ProductCode, value); err != nil { return err @@ -903,6 +1919,15 @@ func awsRestjson1_deserializeDocumentInstance(v **types.Instance, value interfac sv.Region = ptr.String(jtv) } + case "RegisteredWithSubscriptionProvider": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RegisteredWithSubscriptionProvider = ptr.String(jtv) + } + case "Status": if value != nil { jtv, ok := value.(string) @@ -921,6 +1946,24 @@ func awsRestjson1_deserializeDocumentInstance(v **types.Instance, value interfac sv.SubscriptionName = ptr.String(jtv) } + case "SubscriptionProviderCreateTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionProviderCreateTime = ptr.String(jtv) + } + + case "SubscriptionProviderUpdateTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionProviderUpdateTime = ptr.String(jtv) + } + case "UsageOperation": if value != nil { jtv, ok := value.(string) @@ -1094,6 +2137,165 @@ func awsRestjson1_deserializeDocumentProductCodeList(v *[]string, value interfac return nil } +func awsRestjson1_deserializeDocumentRegisteredSubscriptionProvider(v **types.RegisteredSubscriptionProvider, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RegisteredSubscriptionProvider + if *v == nil { + sv = &types.RegisteredSubscriptionProvider{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LastSuccessfulDataRetrievalTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.LastSuccessfulDataRetrievalTime = ptr.String(jtv) + } + + case "SecretArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) + } + sv.SecretArn = ptr.String(jtv) + } + + case "SubscriptionProviderArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionProviderArn to be of type string, got %T instead", value) + } + sv.SubscriptionProviderArn = ptr.String(jtv) + } + + case "SubscriptionProviderSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionProviderSource to be of type string, got %T instead", value) + } + sv.SubscriptionProviderSource = types.SubscriptionProviderSource(jtv) + } + + case "SubscriptionProviderStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionProviderStatus to be of type string, got %T instead", value) + } + sv.SubscriptionProviderStatus = types.SubscriptionProviderStatus(jtv) + } + + case "SubscriptionProviderStatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionProviderStatusMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRegisteredSubscriptionProviderList(v *[]types.RegisteredSubscriptionProvider, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.RegisteredSubscriptionProvider + if *v == nil { + cv = []types.RegisteredSubscriptionProvider{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RegisteredSubscriptionProvider + destAddr := &col + if err := awsRestjson1_deserializeDocumentRegisteredSubscriptionProvider(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1262,6 +2464,42 @@ func awsRestjson1_deserializeDocumentSubscriptionList(v *[]types.Subscription, v return nil } +func awsRestjson1_deserializeDocumentTags(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/licensemanagerlinuxsubscriptions/endpoints.go b/service/licensemanagerlinuxsubscriptions/endpoints.go index e20361fcb39..89533b13958 100644 --- a/service/licensemanagerlinuxsubscriptions/endpoints.go +++ b/service/licensemanagerlinuxsubscriptions/endpoints.go @@ -384,7 +384,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://license-manager-linux-subscriptions-fips.") diff --git a/service/licensemanagerlinuxsubscriptions/generated.json b/service/licensemanagerlinuxsubscriptions/generated.json index 9f52acbcd1f..e0e65d337f1 100644 --- a/service/licensemanagerlinuxsubscriptions/generated.json +++ b/service/licensemanagerlinuxsubscriptions/generated.json @@ -8,9 +8,16 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_DeregisterSubscriptionProvider.go", + "api_op_GetRegisteredSubscriptionProvider.go", "api_op_GetServiceSettings.go", "api_op_ListLinuxSubscriptionInstances.go", "api_op_ListLinuxSubscriptions.go", + "api_op_ListRegisteredSubscriptionProviders.go", + "api_op_ListTagsForResource.go", + "api_op_RegisterSubscriptionProvider.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", "api_op_UpdateServiceSettings.go", "auth.go", "deserializers.go", diff --git a/service/licensemanagerlinuxsubscriptions/serializers.go b/service/licensemanagerlinuxsubscriptions/serializers.go index 5eeb4e7e22a..b475f6f678e 100644 --- a/service/licensemanagerlinuxsubscriptions/serializers.go +++ b/service/licensemanagerlinuxsubscriptions/serializers.go @@ -14,6 +14,156 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +type awsRestjson1_serializeOpDeregisterSubscriptionProvider struct { +} + +func (*awsRestjson1_serializeOpDeregisterSubscriptionProvider) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeregisterSubscriptionProvider) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeregisterSubscriptionProviderInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/subscription/DeregisterSubscriptionProvider") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeregisterSubscriptionProviderInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeregisterSubscriptionProviderInput(v *DeregisterSubscriptionProviderInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeregisterSubscriptionProviderInput(v *DeregisterSubscriptionProviderInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SubscriptionProviderArn != nil { + ok := object.Key("SubscriptionProviderArn") + ok.String(*v.SubscriptionProviderArn) + } + + return nil +} + +type awsRestjson1_serializeOpGetRegisteredSubscriptionProvider struct { +} + +func (*awsRestjson1_serializeOpGetRegisteredSubscriptionProvider) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetRegisteredSubscriptionProvider) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetRegisteredSubscriptionProviderInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/subscription/GetRegisteredSubscriptionProvider") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetRegisteredSubscriptionProviderInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetRegisteredSubscriptionProviderInput(v *GetRegisteredSubscriptionProviderInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetRegisteredSubscriptionProviderInput(v *GetRegisteredSubscriptionProviderInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SubscriptionProviderArn != nil { + ok := object.Key("SubscriptionProviderArn") + ok.String(*v.SubscriptionProviderArn) + } + + return nil +} + type awsRestjson1_serializeOpGetServiceSettings struct { } @@ -240,6 +390,406 @@ func awsRestjson1_serializeOpDocumentListLinuxSubscriptionsInput(v *ListLinuxSub return nil } +type awsRestjson1_serializeOpListRegisteredSubscriptionProviders struct { +} + +func (*awsRestjson1_serializeOpListRegisteredSubscriptionProviders) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListRegisteredSubscriptionProviders) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListRegisteredSubscriptionProvidersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/subscription/ListRegisteredSubscriptionProviders") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListRegisteredSubscriptionProvidersInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListRegisteredSubscriptionProvidersInput(v *ListRegisteredSubscriptionProvidersInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListRegisteredSubscriptionProvidersInput(v *ListRegisteredSubscriptionProvidersInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.SubscriptionProviderSources != nil { + ok := object.Key("SubscriptionProviderSources") + if err := awsRestjson1_serializeDocumentSubscriptionProviderSourceList(v.SubscriptionProviderSources, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpRegisterSubscriptionProvider struct { +} + +func (*awsRestjson1_serializeOpRegisterSubscriptionProvider) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRegisterSubscriptionProvider) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RegisterSubscriptionProviderInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/subscription/RegisterSubscriptionProvider") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentRegisterSubscriptionProviderInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsRegisterSubscriptionProviderInput(v *RegisterSubscriptionProviderInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentRegisterSubscriptionProviderInput(v *RegisterSubscriptionProviderInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecretArn != nil { + ok := object.Key("SecretArn") + ok.String(*v.SecretArn) + } + + if len(v.SubscriptionProviderSource) > 0 { + ok := object.Key("SubscriptionProviderSource") + ok.String(string(v.SubscriptionProviderSource)) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateServiceSettings struct { } @@ -393,3 +943,25 @@ func awsRestjson1_serializeDocumentStringList(v []string, value smithyjson.Value } return nil } + +func awsRestjson1_serializeDocumentSubscriptionProviderSourceList(v []types.SubscriptionProviderSource, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentTags(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} diff --git a/service/licensemanagerlinuxsubscriptions/snapshot/api_op_DeregisterSubscriptionProvider.go.snap b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_DeregisterSubscriptionProvider.go.snap new file mode 100644 index 00000000000..10dce82c96c --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_DeregisterSubscriptionProvider.go.snap @@ -0,0 +1,36 @@ +DeregisterSubscriptionProvider + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/licensemanagerlinuxsubscriptions/snapshot/api_op_GetRegisteredSubscriptionProvider.go.snap b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_GetRegisteredSubscriptionProvider.go.snap new file mode 100644 index 00000000000..1fc5e019e02 --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_GetRegisteredSubscriptionProvider.go.snap @@ -0,0 +1,36 @@ +GetRegisteredSubscriptionProvider + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/licensemanagerlinuxsubscriptions/snapshot/api_op_ListRegisteredSubscriptionProviders.go.snap b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_ListRegisteredSubscriptionProviders.go.snap new file mode 100644 index 00000000000..22a338daeb0 --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_ListRegisteredSubscriptionProviders.go.snap @@ -0,0 +1,35 @@ +ListRegisteredSubscriptionProviders + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/licensemanagerlinuxsubscriptions/snapshot/api_op_ListTagsForResource.go.snap b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_ListTagsForResource.go.snap new file mode 100644 index 00000000000..2299517d18e --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_ListTagsForResource.go.snap @@ -0,0 +1,36 @@ +ListTagsForResource + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/licensemanagerlinuxsubscriptions/snapshot/api_op_RegisterSubscriptionProvider.go.snap b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_RegisterSubscriptionProvider.go.snap new file mode 100644 index 00000000000..c6f8c0ad36d --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_RegisterSubscriptionProvider.go.snap @@ -0,0 +1,36 @@ +RegisterSubscriptionProvider + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/licensemanagerlinuxsubscriptions/snapshot/api_op_TagResource.go.snap b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_TagResource.go.snap new file mode 100644 index 00000000000..7f655ed1036 --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_TagResource.go.snap @@ -0,0 +1,36 @@ +TagResource + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/licensemanagerlinuxsubscriptions/snapshot/api_op_UntagResource.go.snap b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_UntagResource.go.snap new file mode 100644 index 00000000000..45a9cb82fde --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/snapshot/api_op_UntagResource.go.snap @@ -0,0 +1,36 @@ +UntagResource + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/licensemanagerlinuxsubscriptions/snapshot_test.go b/service/licensemanagerlinuxsubscriptions/snapshot_test.go index e7d46a4e845..0fa8df789ca 100644 --- a/service/licensemanagerlinuxsubscriptions/snapshot_test.go +++ b/service/licensemanagerlinuxsubscriptions/snapshot_test.go @@ -62,6 +62,30 @@ func testSnapshot(stack *middleware.Stack, operation string) error { } return snapshotOK{} } +func TestCheckSnapshot_DeregisterSubscriptionProvider(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeregisterSubscriptionProvider(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeregisterSubscriptionProvider") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetRegisteredSubscriptionProvider(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetRegisteredSubscriptionProvider(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetRegisteredSubscriptionProvider") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetServiceSettings(t *testing.T) { svc := New(Options{}) _, err := svc.GetServiceSettings(context.Background(), nil, func(o *Options) { @@ -98,6 +122,66 @@ func TestCheckSnapshot_ListLinuxSubscriptions(t *testing.T) { } } +func TestCheckSnapshot_ListRegisteredSubscriptionProviders(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListRegisteredSubscriptionProviders(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListRegisteredSubscriptionProviders") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_RegisterSubscriptionProvider(t *testing.T) { + svc := New(Options{}) + _, err := svc.RegisterSubscriptionProvider(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "RegisterSubscriptionProvider") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateServiceSettings(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateServiceSettings(context.Background(), nil, func(o *Options) { @@ -109,6 +193,30 @@ func TestCheckSnapshot_UpdateServiceSettings(t *testing.T) { t.Fatal(err) } } +func TestUpdateSnapshot_DeregisterSubscriptionProvider(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeregisterSubscriptionProvider(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeregisterSubscriptionProvider") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetRegisteredSubscriptionProvider(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetRegisteredSubscriptionProvider(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetRegisteredSubscriptionProvider") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetServiceSettings(t *testing.T) { svc := New(Options{}) _, err := svc.GetServiceSettings(context.Background(), nil, func(o *Options) { @@ -145,6 +253,66 @@ func TestUpdateSnapshot_ListLinuxSubscriptions(t *testing.T) { } } +func TestUpdateSnapshot_ListRegisteredSubscriptionProviders(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListRegisteredSubscriptionProviders(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListRegisteredSubscriptionProviders") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_RegisterSubscriptionProvider(t *testing.T) { + svc := New(Options{}) + _, err := svc.RegisterSubscriptionProvider(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "RegisterSubscriptionProvider") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateServiceSettings(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateServiceSettings(context.Background(), nil, func(o *Options) { diff --git a/service/licensemanagerlinuxsubscriptions/types/enums.go b/service/licensemanagerlinuxsubscriptions/types/enums.go index 41efc7abd66..6fb1f4bfc1f 100644 --- a/service/licensemanagerlinuxsubscriptions/types/enums.go +++ b/service/licensemanagerlinuxsubscriptions/types/enums.go @@ -94,3 +94,45 @@ func (Status) Values() []Status { "Failed", } } + +type SubscriptionProviderSource string + +// Enum values for SubscriptionProviderSource +const ( + // RedHat subscription provider namespace + SubscriptionProviderSourceRedHat SubscriptionProviderSource = "RedHat" +) + +// Values returns all known values for SubscriptionProviderSource. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (SubscriptionProviderSource) Values() []SubscriptionProviderSource { + return []SubscriptionProviderSource{ + "RedHat", + } +} + +type SubscriptionProviderStatus string + +// Enum values for SubscriptionProviderStatus +const ( + // ACTIVE status + SubscriptionProviderStatusActive SubscriptionProviderStatus = "ACTIVE" + // INVALID status + SubscriptionProviderStatusInvalid SubscriptionProviderStatus = "INVALID" + // PENDING status + SubscriptionProviderStatusPending SubscriptionProviderStatus = "PENDING" +) + +// Values returns all known values for SubscriptionProviderStatus. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (SubscriptionProviderStatus) Values() []SubscriptionProviderStatus { + return []SubscriptionProviderStatus{ + "ACTIVE", + "INVALID", + "PENDING", + } +} diff --git a/service/licensemanagerlinuxsubscriptions/types/errors.go b/service/licensemanagerlinuxsubscriptions/types/errors.go index 5d863aba298..2a212622113 100644 --- a/service/licensemanagerlinuxsubscriptions/types/errors.go +++ b/service/licensemanagerlinuxsubscriptions/types/errors.go @@ -33,6 +33,32 @@ func (e *InternalServerException) ErrorCode() string { } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// Unable to find the requested Amazon Web Services resource. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The request was denied due to request throttling. type ThrottlingException struct { Message *string diff --git a/service/licensemanagerlinuxsubscriptions/types/types.go b/service/licensemanagerlinuxsubscriptions/types/types.go index a75a0a4dd80..5c4ce8d901c 100644 --- a/service/licensemanagerlinuxsubscriptions/types/types.go +++ b/service/licensemanagerlinuxsubscriptions/types/types.go @@ -32,6 +32,10 @@ type Instance struct { // The AMI ID used to launch the instance. AmiId *string + // Indicates that you have two different license subscriptions for the same + // software on your instance. + DualSubscription *string + // The instance ID of the resource. InstanceID *string @@ -41,6 +45,9 @@ type Instance struct { // The time in which the last discovery updated the instance details. LastUpdatedTime *string + // The operating system software version that runs on your instance. + OsVersion *string + // The product code for the instance. For more information, see [Usage operation values] in the License // Manager User Guide . // @@ -50,12 +57,25 @@ type Instance struct { // The Region the instance is running in. Region *string + // Indicates that your instance uses a BYOL license subscription from a + // third-party Linux subscription provider that you've registered with License + // Manager. + RegisteredWithSubscriptionProvider *string + // The status of the instance. Status *string - // The name of the subscription being used by the instance. + // The name of the license subscription that the instance uses. SubscriptionName *string + // The timestamp when you registered the third-party Linux subscription provider + // for the subscription that the instance uses. + SubscriptionProviderCreateTime *string + + // The timestamp from the last time that the instance synced with the registered + // third-party Linux subscription provider. + SubscriptionProviderUpdateTime *string + // The usage operation of the instance. For more information, see For more // information, see [Usage operation values]in the License Manager User Guide. // @@ -82,6 +102,42 @@ type LinuxSubscriptionsDiscoverySettings struct { noSmithyDocumentSerde } +// A third-party provider for operating system (OS) platform software and license +// subscriptions, such as Red Hat. When you register a third-party Linux +// subscription provider, License Manager can get subscription data from the +// registered provider. +type RegisteredSubscriptionProvider struct { + + // The timestamp from the last time that License Manager accessed third-party + // subscription data for your account from your registered Linux subscription + // provider. + LastSuccessfulDataRetrievalTime *string + + // The Amazon Resource Name (ARN) of the Secrets Manager secret that stores your + // registered Linux subscription provider access token. For RHEL account + // subscriptions, this is the offline token. + SecretArn *string + + // The Amazon Resource Name (ARN) of the Linux subscription provider resource that + // you registered. + SubscriptionProviderArn *string + + // A supported third-party Linux subscription provider. License Manager currently + // supports Red Hat subscriptions. + SubscriptionProviderSource SubscriptionProviderSource + + // Indicates the status of your registered Linux subscription provider access + // token from the last time License Manager retrieved subscription data. For RHEL + // account subscriptions, this is the status of the offline token. + SubscriptionProviderStatus SubscriptionProviderStatus + + // A detailed message that's associated with your BYOL subscription provider token + // status. + SubscriptionProviderStatusMessage *string + + noSmithyDocumentSerde +} + // An object which details a discovered Linux subscription. type Subscription struct { diff --git a/service/licensemanagerlinuxsubscriptions/validators.go b/service/licensemanagerlinuxsubscriptions/validators.go index 09d5c3b25e5..0d6fe04e83c 100644 --- a/service/licensemanagerlinuxsubscriptions/validators.go +++ b/service/licensemanagerlinuxsubscriptions/validators.go @@ -10,6 +10,126 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpDeregisterSubscriptionProvider struct { +} + +func (*validateOpDeregisterSubscriptionProvider) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeregisterSubscriptionProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeregisterSubscriptionProviderInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeregisterSubscriptionProviderInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetRegisteredSubscriptionProvider struct { +} + +func (*validateOpGetRegisteredSubscriptionProvider) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetRegisteredSubscriptionProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetRegisteredSubscriptionProviderInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetRegisteredSubscriptionProviderInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRegisterSubscriptionProvider struct { +} + +func (*validateOpRegisterSubscriptionProvider) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRegisterSubscriptionProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RegisterSubscriptionProviderInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRegisterSubscriptionProviderInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateServiceSettings struct { } @@ -30,6 +150,30 @@ func (m *validateOpUpdateServiceSettings) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +func addOpDeregisterSubscriptionProviderValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeregisterSubscriptionProvider{}, middleware.After) +} + +func addOpGetRegisteredSubscriptionProviderValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRegisteredSubscriptionProvider{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpRegisterSubscriptionProviderValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRegisterSubscriptionProvider{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + func addOpUpdateServiceSettingsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateServiceSettings{}, middleware.After) } @@ -52,6 +196,105 @@ func validateLinuxSubscriptionsDiscoverySettings(v *types.LinuxSubscriptionsDisc } } +func validateOpDeregisterSubscriptionProviderInput(v *DeregisterSubscriptionProviderInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeregisterSubscriptionProviderInput"} + if v.SubscriptionProviderArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubscriptionProviderArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetRegisteredSubscriptionProviderInput(v *GetRegisteredSubscriptionProviderInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRegisteredSubscriptionProviderInput"} + if v.SubscriptionProviderArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubscriptionProviderArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRegisterSubscriptionProviderInput(v *RegisterSubscriptionProviderInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegisterSubscriptionProviderInput"} + if len(v.SubscriptionProviderSource) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SubscriptionProviderSource")) + } + if v.SecretArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateServiceSettingsInput(v *UpdateServiceSettingsInput) error { if v == nil { return nil diff --git a/service/mediaconnect/api_op_UpdateFlowOutput.go b/service/mediaconnect/api_op_UpdateFlowOutput.go index 30087e002d3..1512a4f5f55 100644 --- a/service/mediaconnect/api_op_UpdateFlowOutput.go +++ b/service/mediaconnect/api_op_UpdateFlowOutput.go @@ -72,6 +72,11 @@ type UpdateFlowOutputInput struct { // receiver’s minimum latency. MinLatency *int32 + // An indication of whether the output should transmit data or not. If you don't + // specify the outputStatus field in your request, MediaConnect leaves the value + // unchanged. + OutputStatus types.OutputStatus + // The port to use when content is distributed to this output. Port *int32 diff --git a/service/mediaconnect/deserializers.go b/service/mediaconnect/deserializers.go index 05e50aa23f3..1ad6f6b59da 100644 --- a/service/mediaconnect/deserializers.go +++ b/service/mediaconnect/deserializers.go @@ -12907,6 +12907,15 @@ func awsRestjson1_deserializeDocumentOutput(v **types.Output, value interface{}) sv.OutputArn = ptr.String(jtv) } + case "outputStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OutputStatus to be of type string, got %T instead", value) + } + sv.OutputStatus = types.OutputStatus(jtv) + } + case "port": if value != nil { jtv, ok := value.(json.Number) diff --git a/service/mediaconnect/serializers.go b/service/mediaconnect/serializers.go index c1363c4b5e2..a975dc050dd 100644 --- a/service/mediaconnect/serializers.go +++ b/service/mediaconnect/serializers.go @@ -3986,6 +3986,11 @@ func awsRestjson1_serializeOpDocumentUpdateFlowOutputInput(v *UpdateFlowOutputIn ok.Integer(*v.MinLatency) } + if len(v.OutputStatus) > 0 { + ok := object.Key("outputStatus") + ok.String(string(v.OutputStatus)) + } + if v.Port != nil { ok := object.Key("port") ok.Integer(*v.Port) @@ -4753,6 +4758,11 @@ func awsRestjson1_serializeDocumentAddOutputRequest(v *types.AddOutputRequest, v ok.String(*v.Name) } + if len(v.OutputStatus) > 0 { + ok := object.Key("outputStatus") + ok.String(string(v.OutputStatus)) + } + if v.Port != nil { ok := object.Key("port") ok.Integer(*v.Port) diff --git a/service/mediaconnect/types/enums.go b/service/mediaconnect/types/enums.go index 64a38e9756b..a5354e2084e 100644 --- a/service/mediaconnect/types/enums.go +++ b/service/mediaconnect/types/enums.go @@ -391,6 +391,25 @@ func (NetworkInterfaceType) Values() []NetworkInterfaceType { } } +type OutputStatus string + +// Enum values for OutputStatus +const ( + OutputStatusEnabled OutputStatus = "ENABLED" + OutputStatusDisabled OutputStatus = "DISABLED" +) + +// Values returns all known values for OutputStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (OutputStatus) Values() []OutputStatus { + return []OutputStatus{ + "ENABLED", + "DISABLED", + } +} + type PriceUnits string // Enum values for PriceUnits diff --git a/service/mediaconnect/types/types.go b/service/mediaconnect/types/types.go index c8acfd7d04d..a6da1ab1160 100644 --- a/service/mediaconnect/types/types.go +++ b/service/mediaconnect/types/types.go @@ -239,6 +239,11 @@ type AddOutputRequest struct { // The name of the output. This value must be unique within the current flow. Name *string + // An indication of whether the new output should be enabled or disabled as soon + // as it is created. If you don't specify the outputStatus field in your request, + // MediaConnect sets it to ENABLED. + OutputStatus OutputStatus + // The port to use when content is distributed to this output. Port *int32 @@ -1480,6 +1485,9 @@ type Output struct { // The configuration for each media stream that is associated with the output. MediaStreamOutputConfigurations []MediaStreamOutputConfiguration + // An indication of whether the output is transmitting data or not. + OutputStatus OutputStatus + // The port to use when content is distributed to this output. Port *int32 diff --git a/service/textract/internal/endpoints/endpoints.go b/service/textract/internal/endpoints/endpoints.go index 49c01a08b06..b6189e8c4b6 100644 --- a/service/textract/internal/endpoints/endpoints.go +++ b/service/textract/internal/endpoints/endpoints.go @@ -142,15 +142,39 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.ap-northeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.ap-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.ap-southeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.ap-southeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, @@ -160,18 +184,54 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "textract-fips.ca-central-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "textract-fips.ca-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.ca-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.eu-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.eu-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.eu-west-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.eu-west-3.api.aws", + }, endpoints.EndpointKey{ Region: "fips-ca-central-1", }: endpoints.Endpoint{ @@ -226,6 +286,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "textract-fips.us-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "textract-fips.us-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.us-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, @@ -235,6 +307,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "textract-fips.us-east-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "textract-fips.us-east-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.us-east-2.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, @@ -244,6 +328,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "textract-fips.us-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "textract-fips.us-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.us-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, @@ -253,6 +349,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "textract-fips.us-west-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "textract-fips.us-west-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.us-west-2.api.aws", + }, }, }, { @@ -441,6 +549,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "textract-fips.us-gov-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "textract-fips.us-gov-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.us-gov-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, @@ -450,6 +570,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "textract-fips.us-gov-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "textract-fips.us-gov-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "textract.us-gov-west-1.api.aws", + }, }, }, }