diff --git a/.changelog/01b59fc75ef84a63a9b963590d79e2b0.json b/.changelog/01b59fc75ef84a63a9b963590d79e2b0.json new file mode 100644 index 00000000000..a987f5f240e --- /dev/null +++ b/.changelog/01b59fc75ef84a63a9b963590d79e2b0.json @@ -0,0 +1,8 @@ +{ + "id": "01b59fc7-5ef8-4a63-a9b9-63590d79e2b0", + "type": "feature", + "description": "Add support for using the template from a previous job during job creation and listing parameter definitions for a job.", + "modules": [ + "service/deadline" + ] +} \ No newline at end of file diff --git a/.changelog/0ce3cbfb7dbd4eeeab53feb1879a417a.json b/.changelog/0ce3cbfb7dbd4eeeab53feb1879a417a.json new file mode 100644 index 00000000000..ab5094cb3ab --- /dev/null +++ b/.changelog/0ce3cbfb7dbd4eeeab53feb1879a417a.json @@ -0,0 +1,8 @@ +{ + "id": "0ce3cbfb-7dbd-4eee-ab53-feb1879a417a", + "type": "documentation", + "description": "Documentation-only update for AWS Marketplace Reporting API.", + "modules": [ + "service/marketplacereporting" + ] +} \ No newline at end of file diff --git a/.changelog/7fbf930104774b91a7b8b1c09886f13a.json b/.changelog/7fbf930104774b91a7b8b1c09886f13a.json new file mode 100644 index 00000000000..659b07c9e43 --- /dev/null +++ b/.changelog/7fbf930104774b91a7b8b1c09886f13a.json @@ -0,0 +1,8 @@ +{ + "id": "7fbf9301-0477-4b91-a7b8-b1c09886f13a", + "type": "feature", + "description": "Add validation pattern to S3KeyPrefix on the EnableLogging API", + "modules": [ + "service/redshift" + ] +} \ No newline at end of file diff --git a/.changelog/f98a907df33a4bca859b00951e803653.json b/.changelog/f98a907df33a4bca859b00951e803653.json new file mode 100644 index 00000000000..a2e10c2947d --- /dev/null +++ b/.changelog/f98a907df33a4bca859b00951e803653.json @@ -0,0 +1,8 @@ +{ + "id": "f98a907d-f33a-4bca-859b-00951e803653", + "type": "feature", + "description": "This release adds support for the following capabilities: Configuration of the Gen AI system via AIAgent and AIPrompts. Integration support for Bedrock Knowledge Base.", + "modules": [ + "service/qconnect" + ] +} \ No newline at end of file diff --git a/feature/dynamodbstreams/attributevalue/go_module_metadata.go b/feature/dynamodbstreams/attributevalue/go_module_metadata.go index bc75c136f1a..2117a28b1fd 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.14.28" +const goModuleVersion = "1.15.10" diff --git a/service/deadline/api_op_CreateJob.go b/service/deadline/api_op_CreateJob.go index 9b12fcecac9..1adf9b89669 100644 --- a/service/deadline/api_op_CreateJob.go +++ b/service/deadline/api_op_CreateJob.go @@ -49,16 +49,6 @@ type CreateJobInput struct { // This member is required. QueueId *string - // The job template to use for this job. - // - // This member is required. - Template *string - - // The file type for the job template. - // - // This member is required. - TemplateType types.JobTemplateType - // The attachments for the job. Attach files required for the job to run to a // render job. Attachments *types.Attachments @@ -76,6 +66,9 @@ type CreateJobInput struct { // The parameters for the job. Parameters map[string]types.JobParameter + // The job ID for the source job. + SourceJobId *string + // The storage profile ID for the storage profile to connect to the job. StorageProfileId *string @@ -83,6 +76,12 @@ type CreateJobInput struct { // SUSPENDED status will not run until manually requeued. TargetTaskRunStatus types.CreateJobTargetTaskRunStatus + // The job template to use for this job. + Template *string + + // The file type for the job template. + TemplateType types.JobTemplateType + noSmithyDocumentSerde } diff --git a/service/deadline/api_op_GetJob.go b/service/deadline/api_op_GetJob.go index 0cb2bd33f74..50753717913 100644 --- a/service/deadline/api_op_GetJob.go +++ b/service/deadline/api_op_GetJob.go @@ -111,6 +111,9 @@ type GetJobOutput struct { // The parameters for the job. Parameters map[string]types.JobParameter + // The job ID for the source job. + SourceJobId *string + // The date and time the resource started running. StartedAt *time.Time diff --git a/service/deadline/api_op_ListJobParameterDefinitions.go b/service/deadline/api_op_ListJobParameterDefinitions.go new file mode 100644 index 00000000000..c0b8587f7b4 --- /dev/null +++ b/service/deadline/api_op_ListJobParameterDefinitions.go @@ -0,0 +1,311 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package deadline + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/deadline/document" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists parameter definitions of a job. +func (c *Client) ListJobParameterDefinitions(ctx context.Context, params *ListJobParameterDefinitionsInput, optFns ...func(*Options)) (*ListJobParameterDefinitionsOutput, error) { + if params == nil { + params = &ListJobParameterDefinitionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListJobParameterDefinitions", params, optFns, c.addOperationListJobParameterDefinitionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListJobParameterDefinitionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListJobParameterDefinitionsInput struct { + + // The farm ID of the job to list. + // + // This member is required. + FarmId *string + + // The job ID to include on the list. + // + // This member is required. + JobId *string + + // The queue ID to include on the list. + // + // This member is required. + QueueId *string + + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + MaxResults *int32 + + // The token for the next set of results, or null to start from the beginning. + NextToken *string + + noSmithyDocumentSerde +} + +type ListJobParameterDefinitionsOutput struct { + + // Lists parameter definitions of a job. + // + // This member is required. + JobParameterDefinitions []document.Interface + + // If Deadline Cloud returns nextToken , then there are more results available. The + // value of nextToken is a unique pagination token for each page. To retrieve the + // next page, call the operation again using the returned token. Keep all other + // arguments unchanged. If no results remain, then nextToken is set to null . Each + // pagination token expires after 24 hours. If you provide a token that isn't + // valid, then you receive an HTTP 400 ValidationException error. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListJobParameterDefinitionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListJobParameterDefinitions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListJobParameterDefinitions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListJobParameterDefinitions"); 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 = addSpanRetryLoop(stack, options); 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 = addEndpointPrefix_opListJobParameterDefinitionsMiddleware(stack); err != nil { + return err + } + if err = addOpListJobParameterDefinitionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListJobParameterDefinitions(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListJobParameterDefinitionsPaginatorOptions is the paginator options for +// ListJobParameterDefinitions +type ListJobParameterDefinitionsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// ListJobParameterDefinitionsPaginator is a paginator for +// ListJobParameterDefinitions +type ListJobParameterDefinitionsPaginator struct { + options ListJobParameterDefinitionsPaginatorOptions + client ListJobParameterDefinitionsAPIClient + params *ListJobParameterDefinitionsInput + nextToken *string + firstPage bool +} + +// NewListJobParameterDefinitionsPaginator returns a new +// ListJobParameterDefinitionsPaginator +func NewListJobParameterDefinitionsPaginator(client ListJobParameterDefinitionsAPIClient, params *ListJobParameterDefinitionsInput, optFns ...func(*ListJobParameterDefinitionsPaginatorOptions)) *ListJobParameterDefinitionsPaginator { + if params == nil { + params = &ListJobParameterDefinitionsInput{} + } + + options := ListJobParameterDefinitionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListJobParameterDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobParameterDefinitionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListJobParameterDefinitions page. +func (p *ListJobParameterDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobParameterDefinitionsOutput, 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.ListJobParameterDefinitions(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 +} + +type endpointPrefix_opListJobParameterDefinitionsMiddleware struct { +} + +func (*endpointPrefix_opListJobParameterDefinitionsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListJobParameterDefinitionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "management." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListJobParameterDefinitionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListJobParameterDefinitionsMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListJobParameterDefinitionsAPIClient is a client that implements the +// ListJobParameterDefinitions operation. +type ListJobParameterDefinitionsAPIClient interface { + ListJobParameterDefinitions(context.Context, *ListJobParameterDefinitionsInput, ...func(*Options)) (*ListJobParameterDefinitionsOutput, error) +} + +var _ ListJobParameterDefinitionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListJobParameterDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListJobParameterDefinitions", + } +} diff --git a/service/deadline/deserializers.go b/service/deadline/deserializers.go index cd7a4940406..a1070754164 100644 --- a/service/deadline/deserializers.go +++ b/service/deadline/deserializers.go @@ -6091,6 +6091,15 @@ func awsRestjson1_deserializeOpDocumentGetJobOutput(v **GetJobOutput, value inte sv.Priority = ptr.Int32(int32(i64)) } + case "sourceJobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobId to be of type string, got %T instead", value) + } + sv.SourceJobId = ptr.String(jtv) + } + case "startedAt": if value != nil { jtv, ok := value.(string) @@ -10637,6 +10646,179 @@ func awsRestjson1_deserializeOpDocumentListJobMembersOutput(v **ListJobMembersOu return nil } +type awsRestjson1_deserializeOpListJobParameterDefinitions struct { +} + +func (*awsRestjson1_deserializeOpListJobParameterDefinitions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListJobParameterDefinitions) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorListJobParameterDefinitions(response, &metadata) + } + output := &ListJobParameterDefinitionsOutput{} + 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_deserializeOpDocumentListJobParameterDefinitionsOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListJobParameterDefinitions(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("InternalServerErrorException", errorCode): + return awsRestjson1_deserializeErrorInternalServerErrorException(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_deserializeOpDocumentListJobParameterDefinitionsOutput(v **ListJobParameterDefinitionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListJobParameterDefinitionsOutput + if *v == nil { + sv = &ListJobParameterDefinitionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "jobParameterDefinitions": + if err := awsRestjson1_deserializeDocumentJobParameterDefinitions(&sv.JobParameterDefinitions, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListJobs struct { } @@ -20949,6 +21131,46 @@ loop: return nil } +func awsRestjson1_deserializeDocumentJobParameterDefinition(v *document.Interface, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + *v = internaldocument.NewDocumentUnmarshaler(value) + return nil +} + +func awsRestjson1_deserializeDocumentJobParameterDefinitions(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.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []document.Interface + if *v == nil { + cv = []document.Interface{} + } else { + cv = *v + } + + for _, value := range shape { + var col document.Interface + if err := awsRestjson1_deserializeDocumentJobParameterDefinition(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentJobParameters(v *map[string]types.JobParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21213,6 +21435,15 @@ func awsRestjson1_deserializeDocumentJobSearchSummary(v **types.JobSearchSummary sv.QueueId = ptr.String(jtv) } + case "sourceJobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobId to be of type string, got %T instead", value) + } + sv.SourceJobId = ptr.String(jtv) + } + case "startedAt": if value != nil { jtv, ok := value.(string) @@ -21424,6 +21655,15 @@ func awsRestjson1_deserializeDocumentJobSummary(v **types.JobSummary, value inte sv.Priority = ptr.Int32(int32(i64)) } + case "sourceJobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobId to be of type string, got %T instead", value) + } + sv.SourceJobId = ptr.String(jtv) + } + case "startedAt": if value != nil { jtv, ok := value.(string) diff --git a/service/deadline/generated.json b/service/deadline/generated.json index 45147988224..7de34136b8f 100644 --- a/service/deadline/generated.json +++ b/service/deadline/generated.json @@ -70,6 +70,7 @@ "api_op_ListFleetMembers.go", "api_op_ListFleets.go", "api_op_ListJobMembers.go", + "api_op_ListJobParameterDefinitions.go", "api_op_ListJobs.go", "api_op_ListLicenseEndpoints.go", "api_op_ListMeteredProducts.go", diff --git a/service/deadline/serializers.go b/service/deadline/serializers.go index 8a5b330e463..a9d43e1123a 100644 --- a/service/deadline/serializers.go +++ b/service/deadline/serializers.go @@ -1667,6 +1667,11 @@ func awsRestjson1_serializeOpDocumentCreateJobInput(v *CreateJobInput, value smi ok.Integer(*v.Priority) } + if v.SourceJobId != nil { + ok := object.Key("sourceJobId") + ok.String(*v.SourceJobId) + } + if v.StorageProfileId != nil { ok := object.Key("storageProfileId") ok.String(*v.StorageProfileId) @@ -5778,6 +5783,103 @@ func awsRestjson1_serializeOpHttpBindingsListJobMembersInput(v *ListJobMembersIn return nil } +type awsRestjson1_serializeOpListJobParameterDefinitions struct { +} + +func (*awsRestjson1_serializeOpListJobParameterDefinitions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListJobParameterDefinitions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListJobParameterDefinitionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2023-10-12/farms/{farmId}/queues/{queueId}/jobs/{jobId}/parameter-definitions") + 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_serializeOpHttpBindingsListJobParameterDefinitionsInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListJobParameterDefinitionsInput(v *ListJobParameterDefinitionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FarmId == nil || len(*v.FarmId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member farmId must not be empty")} + } + if v.FarmId != nil { + if err := encoder.SetURI("farmId").String(*v.FarmId); err != nil { + return err + } + } + + if v.JobId == nil || len(*v.JobId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member jobId must not be empty")} + } + if v.JobId != nil { + if err := encoder.SetURI("jobId").String(*v.JobId); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.QueueId == nil || len(*v.QueueId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member queueId must not be empty")} + } + if v.QueueId != nil { + if err := encoder.SetURI("queueId").String(*v.QueueId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListJobs struct { } diff --git a/service/deadline/snapshot/api_op_ListJobParameterDefinitions.go.snap b/service/deadline/snapshot/api_op_ListJobParameterDefinitions.go.snap new file mode 100644 index 00000000000..4b2495ead6c --- /dev/null +++ b/service/deadline/snapshot/api_op_ListJobParameterDefinitions.go.snap @@ -0,0 +1,42 @@ +ListJobParameterDefinitions + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + EndpointHostPrefix + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/deadline/snapshot_test.go b/service/deadline/snapshot_test.go index b3988d53ce9..58acc6c0215 100644 --- a/service/deadline/snapshot_test.go +++ b/service/deadline/snapshot_test.go @@ -794,6 +794,18 @@ func TestCheckSnapshot_ListJobMembers(t *testing.T) { } } +func TestCheckSnapshot_ListJobParameterDefinitions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListJobParameterDefinitions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListJobParameterDefinitions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListJobs(t *testing.T) { svc := New(Options{}) _, err := svc.ListJobs(context.Background(), nil, func(o *Options) { @@ -2017,6 +2029,18 @@ func TestUpdateSnapshot_ListJobMembers(t *testing.T) { } } +func TestUpdateSnapshot_ListJobParameterDefinitions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListJobParameterDefinitions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListJobParameterDefinitions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListJobs(t *testing.T) { svc := New(Options{}) _, err := svc.ListJobs(context.Background(), nil, func(o *Options) { diff --git a/service/deadline/types/types.go b/service/deadline/types/types.go index 555d68b3b0d..c93a29ab642 100644 --- a/service/deadline/types/types.go +++ b/service/deadline/types/types.go @@ -1364,6 +1364,9 @@ type JobSearchSummary struct { // The queue ID. QueueId *string + // The job ID for the source job. + SourceJobId *string + // The date and time the resource started running. StartedAt *time.Time @@ -1447,6 +1450,9 @@ type JobSummary struct { // The maximum number of retries for a job. MaxRetriesPerTask *int32 + // The job ID for the source job. + SourceJobId *string + // The date and time the resource started running. StartedAt *time.Time diff --git a/service/deadline/validators.go b/service/deadline/validators.go index e676dfcaefc..319192d168b 100644 --- a/service/deadline/validators.go +++ b/service/deadline/validators.go @@ -1190,6 +1190,26 @@ func (m *validateOpListJobMembers) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpListJobParameterDefinitions struct { +} + +func (*validateOpListJobParameterDefinitions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListJobParameterDefinitions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListJobParameterDefinitionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListJobParameterDefinitionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListJobs struct { } @@ -2206,6 +2226,10 @@ func addOpListJobMembersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListJobMembers{}, middleware.After) } +func addOpListJobParameterDefinitionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListJobParameterDefinitions{}, middleware.After) +} + func addOpListJobsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListJobs{}, middleware.After) } @@ -3805,12 +3829,6 @@ func validateOpCreateJobInput(v *CreateJobInput) error { if v.QueueId == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueId")) } - if v.Template == nil { - invalidParams.Add(smithy.NewErrParamRequired("Template")) - } - if len(v.TemplateType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("TemplateType")) - } if v.Priority == nil { invalidParams.Add(smithy.NewErrParamRequired("Priority")) } @@ -4696,6 +4714,27 @@ func validateOpListJobMembersInput(v *ListJobMembersInput) error { } } +func validateOpListJobParameterDefinitionsInput(v *ListJobParameterDefinitionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListJobParameterDefinitionsInput"} + if v.FarmId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FarmId")) + } + if v.JobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("JobId")) + } + if v.QueueId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueueId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListJobsInput(v *ListJobsInput) error { if v == nil { return nil diff --git a/service/internal/integrationtest/go.mod b/service/internal/integrationtest/go.mod index 19d7219799a..3452a0ac855 100644 --- a/service/internal/integrationtest/go.mod +++ b/service/internal/integrationtest/go.mod @@ -10,7 +10,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/applicationdiscoveryservice v1.28.0 github.com/aws/aws-sdk-go-v2/service/appstream v1.41.0 github.com/aws/aws-sdk-go-v2/service/athena v1.47.0 - github.com/aws/aws-sdk-go-v2/service/autoscaling v1.45.0 github.com/aws/aws-sdk-go-v2/service/batch v1.46.0 github.com/aws/aws-sdk-go-v2/service/cloudformation v1.55.0 github.com/aws/aws-sdk-go-v2/service/cloudfront v1.40.0 diff --git a/service/marketplacereporting/api_op_GetBuyerDashboard.go b/service/marketplacereporting/api_op_GetBuyerDashboard.go index f37fe30348b..c95e2d9ca44 100644 --- a/service/marketplacereporting/api_op_GetBuyerDashboard.go +++ b/service/marketplacereporting/api_op_GetBuyerDashboard.go @@ -13,6 +13,10 @@ import ( // Generates an embedding URL for an Amazon QuickSight dashboard for an anonymous // user. // +// This API is available only to Amazon Web Services Organization management +// accounts or delegated administrators registered for the procurement insights ( +// procurement-insights.marketplace.amazonaws.com ) feature. +// // The following rules apply to a generated URL: // // - It contains a temporary bearer token, valid for 5 minutes after it is diff --git a/service/marketplacereporting/doc.go b/service/marketplacereporting/doc.go index 1d8802d22dc..ad27b7181aa 100644 --- a/service/marketplacereporting/doc.go +++ b/service/marketplacereporting/doc.go @@ -3,50 +3,60 @@ // Package marketplacereporting provides the API client, operations, and parameter // types for AWS Marketplace Reporting Service. // -// The AWS Marketplace GetBuyerDashboard API enables you to get a procurement -// insights dashboard programmatically. The API gets the agreement and cost -// analysis dashboards with data for all of the Amazon Web Services accounts in -// your Amazon Web Services organization. +// The Amazon Web Services Marketplace GetBuyerDashboard API enables you to get a +// procurement insights dashboard programmatically. The API gets the agreement and +// cost analysis dashboards with data for all of the Amazon Web Services accounts +// in your Amazon Web Services Organization. // -// To use the API, you must complete the following prerequisites: +// To use the Amazon Web Services Marketplace Reporting API, you must complete the +// following prerequisites: // -// - Enable all features for your organization. For more information, see [Enabling all features for an organization with Amazon Web Services Organizations], in -// the Amazon Web Services Organizations User Guide. +// - Enable all features for your organization. For more information, see [Enabling all features for an organization with Organizations], in +// the Organizations User Guide. // -// - Call the service as the Amazon Web Services Organizations management -// account or an account registered as a delegated administrator for the -// procurement insights service. Users without management or delegated -// administrator accounts can use the dashboard, but they only see data for their -// accounts. +// - Call the service as the Organizations management account or an account +// registered as a delegated administrator for the procurement insights service. // -// For more information about management accounts, see [Tutorial: Creating and configuring an organization]and [Managing the management account with Amazon Web Services Organizations], both in the Amazon +// For more information about management accounts, see [Tutorial: Creating and configuring an organization]and [Managing the management account with Organizations], both in the // -// Web Services Organizations User Guide. +// Organizations User Guide. // -// For more information about delegated administrators, see [Using delegated administrators], in the AWS +// For more information about delegated administrators, see [Using delegated administrators], in the Amazon Web // -// Marketplace Buyer Guide. +// Services Marketplace Buyer Guide. // // - Create an IAM policy that enables the aws-marketplace:GetBuyerDashboard and // organizations:DescribeOrganization permissions. In addition, the management // account requires the organizations:EnableAWSServiceAccess and -// iam:CreateServiceLinkedRole permissions to create For more information about -// creating the policy, see [Policies and permissions in Amazon Web Services Identity and Access Management], in the IAM User Guide. +// iam:CreateServiceLinkedRole permissions to create. For more information about +// creating the policy, see [Policies and permissions in Identity and Access Management], in the IAM User Guide. +// +// Access can be shared only by registering the desired linked account as a +// +// delegated administrator. That requires +// organizations:RegisterDelegatedAdministrator +// organizations:ListDelegatedAdministrators and +// organizations:DeregisterDelegatedAdministrator permissions. // // - Use the Amazon Web Services Marketplace console to create the // AWSServiceRoleForProcurementInsightsPolicy service-linked role. The role -// enables AWS Marketplace procurement visibility integration. The management -// account requires an IAM policy with the organizations:EnableAWSServiceAccess -// and iam:CreateServiceLinkedRole permissions to create the service-linked role -// and enable the service access. For more information, see [Granting access to Amazon Web Services Organizations], and [Service-linked role to share procurement data], in the -// Amazon Web Services Marketplace Buyer Guide. +// enables Amazon Web Services Marketplace procurement visibility integration. The +// management account requires an IAM policy with the +// organizations:EnableAWSServiceAccess and iam:CreateServiceLinkedRole +// permissions to create the service-linked role and enable the service access. For +// more information, see [Granting access to Organizations]and [Service-linked role to share procurement data]in the Amazon Web Services Marketplace Buyer Guide. +// +// - After creating the service-linked role, you must enable trusted access that +// grants Amazon Web Services Marketplace permission to access data from your +// Organizations. For more information, see [Granting access to Organizations]in the Amazon Web Services +// Marketplace Buyer Guide. // -// [Enabling all features for an organization with Amazon Web Services Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html +// [Managing the management account with Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs-manage_accounts_management.html // [Using delegated administrators]: https://docs.aws.amazon.com/marketplace/latest/buyerguide/management-delegates.html // [Tutorial: Creating and configuring an organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tutorials_basic.html -// [Managing the management account with Amazon Web Services Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs-manage_accounts_management.html +// [Enabling all features for an organization with Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html // -// [Granting access to Amazon Web Services Organizations]: https://docs.aws.amazon.com/marketplace/latest/buyerguide/orgs-access-slr.html -// [Policies and permissions in Amazon Web Services Identity and Access Management]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html +// [Policies and permissions in Identity and Access Management]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html +// [Granting access to Organizations]: https://docs.aws.amazon.com/marketplace/latest/buyerguide/orgs-access-slr.html // [Service-linked role to share procurement data]: https://docs.aws.amazon.com/marketplace/latest/buyerguide/buyer-service-linked-role-procurement.html package marketplacereporting diff --git a/service/outposts/internal/endpoints/endpoints.go b/service/outposts/internal/endpoints/endpoints.go index c8bc98ba79f..6727970a0eb 100644 --- a/service/outposts/internal/endpoints/endpoints.go +++ b/service/outposts/internal/endpoints/endpoints.go @@ -184,6 +184,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, diff --git a/service/qconnect/api_op_CreateAIAgent.go b/service/qconnect/api_op_CreateAIAgent.go new file mode 100644 index 00000000000..dae3a93fd8e --- /dev/null +++ b/service/qconnect/api_op_CreateAIAgent.go @@ -0,0 +1,227 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Amazon Q in Connect AI Agent. +func (c *Client) CreateAIAgent(ctx context.Context, params *CreateAIAgentInput, optFns ...func(*Options)) (*CreateAIAgentOutput, error) { + if params == nil { + params = &CreateAIAgentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAIAgent", params, optFns, c.addOperationCreateAIAgentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAIAgentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAIAgentInput struct { + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The configuration of the AI Agent. + // + // This member is required. + Configuration types.AIAgentConfiguration + + // The name of the AI Agent. + // + // This member is required. + Name *string + + // The type of the AI Agent. + // + // This member is required. + Type types.AIAgentType + + // The visibility status of the AI Agent. + // + // This member is required. + VisibilityStatus types.VisibilityStatus + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If not provided, the AWS SDK populates this field. For more + // information about idempotency, see [Making retries safe with idempotent APIs]. + // + // [Making retries safe with idempotent APIs]: http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/ + ClientToken *string + + // The description of the AI Agent. + Description *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateAIAgentOutput struct { + + // The data of the created AI Agent. + AiAgent *types.AIAgentData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAIAgentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAIAgent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAIAgent{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAIAgent"); 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 = addSpanRetryLoop(stack, options); 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_opCreateAIAgentMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateAIAgentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAIAgent(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateAIAgent struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateAIAgent) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateAIAgent) 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.(*CreateAIAgentInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAIAgentInput ") + } + + 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_opCreateAIAgentMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAIAgent{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateAIAgent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateAIAgent", + } +} diff --git a/service/qconnect/api_op_CreateAIAgentVersion.go b/service/qconnect/api_op_CreateAIAgentVersion.go new file mode 100644 index 00000000000..ef7f4f08104 --- /dev/null +++ b/service/qconnect/api_op_CreateAIAgentVersion.go @@ -0,0 +1,218 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates and Amazon Q in Connect AI Agent version. +func (c *Client) CreateAIAgentVersion(ctx context.Context, params *CreateAIAgentVersionInput, optFns ...func(*Options)) (*CreateAIAgentVersionOutput, error) { + if params == nil { + params = &CreateAIAgentVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAIAgentVersion", params, optFns, c.addOperationCreateAIAgentVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAIAgentVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAIAgentVersionInput struct { + + // The identifier of the Amazon Q in Connect AI Agent. + // + // This member is required. + AiAgentId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If not provided, the AWS SDK populates this field. For more + // information about idempotency, see [Making retries safe with idempotent APIs]. + // + // [Making retries safe with idempotent APIs]: http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/ + ClientToken *string + + // The modification time of the AI Agent should be tracked for version creation. + // This field should be specified to avoid version creation when simultaneous + // update to the underlying AI Agent are possible. The value should be the + // modifiedTime returned from the request to create or update an AI Agent so that + // version creation can fail if an update to the AI Agent post the specified + // modification time has been made. + ModifiedTime *time.Time + + noSmithyDocumentSerde +} + +type CreateAIAgentVersionOutput struct { + + // The data of the AI Agent version. + AiAgent *types.AIAgentData + + // The version number of the AI Agent version. + VersionNumber *int64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAIAgentVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAIAgentVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAIAgentVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAIAgentVersion"); 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 = addSpanRetryLoop(stack, options); 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_opCreateAIAgentVersionMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateAIAgentVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAIAgentVersion(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateAIAgentVersion struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateAIAgentVersion) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateAIAgentVersion) 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.(*CreateAIAgentVersionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAIAgentVersionInput ") + } + + 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_opCreateAIAgentVersionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAIAgentVersion{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateAIAgentVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateAIAgentVersion", + } +} diff --git a/service/qconnect/api_op_CreateAIPrompt.go b/service/qconnect/api_op_CreateAIPrompt.go new file mode 100644 index 00000000000..7b32620ae80 --- /dev/null +++ b/service/qconnect/api_op_CreateAIPrompt.go @@ -0,0 +1,243 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Amazon Q in Connect AI Prompt. +func (c *Client) CreateAIPrompt(ctx context.Context, params *CreateAIPromptInput, optFns ...func(*Options)) (*CreateAIPromptOutput, error) { + if params == nil { + params = &CreateAIPromptInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAIPrompt", params, optFns, c.addOperationCreateAIPromptMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAIPromptOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAIPromptInput struct { + + // The API Format of the AI Prompt. + // + // This member is required. + ApiFormat types.AIPromptAPIFormat + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The identifier of the model used for this AI Prompt. Model Ids supported are: + // CLAUDE_3_HAIKU_20240307_V1 + // + // This member is required. + ModelId *string + + // The name of the AI Prompt. + // + // This member is required. + Name *string + + // The configuration of the prompt template for this AI Prompt. + // + // This member is required. + TemplateConfiguration types.AIPromptTemplateConfiguration + + // The type of the prompt template for this AI Prompt. + // + // This member is required. + TemplateType types.AIPromptTemplateType + + // The type of this AI Prompt. + // + // This member is required. + Type types.AIPromptType + + // The visibility status of the AI Prompt. + // + // This member is required. + VisibilityStatus types.VisibilityStatus + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If not provided, the AWS SDK populates this field. For more + // information about idempotency, see [Making retries safe with idempotent APIs]. + // + // [Making retries safe with idempotent APIs]: http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/ + ClientToken *string + + // The description of the AI Prompt. + Description *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateAIPromptOutput struct { + + // The data of the AI Prompt. + AiPrompt *types.AIPromptData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAIPromptMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAIPrompt{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAIPrompt{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAIPrompt"); 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 = addSpanRetryLoop(stack, options); 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_opCreateAIPromptMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateAIPromptValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAIPrompt(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateAIPrompt struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateAIPrompt) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateAIPrompt) 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.(*CreateAIPromptInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAIPromptInput ") + } + + 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_opCreateAIPromptMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAIPrompt{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateAIPrompt(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateAIPrompt", + } +} diff --git a/service/qconnect/api_op_CreateAIPromptVersion.go b/service/qconnect/api_op_CreateAIPromptVersion.go new file mode 100644 index 00000000000..aabadac1701 --- /dev/null +++ b/service/qconnect/api_op_CreateAIPromptVersion.go @@ -0,0 +1,213 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates an Amazon Q in Connect AI Prompt version. +func (c *Client) CreateAIPromptVersion(ctx context.Context, params *CreateAIPromptVersionInput, optFns ...func(*Options)) (*CreateAIPromptVersionOutput, error) { + if params == nil { + params = &CreateAIPromptVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAIPromptVersion", params, optFns, c.addOperationCreateAIPromptVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAIPromptVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAIPromptVersionInput struct { + + // The identifier of the Amazon Q in Connect AI prompt. + // + // This member is required. + AiPromptId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If not provided, the AWS SDK populates this field. For more + // information about idempotency, see [Making retries safe with idempotent APIs]. + // + // [Making retries safe with idempotent APIs]: http://aws.amazon.com/https:/aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/ + ClientToken *string + + // The time the AI Prompt was last modified. + ModifiedTime *time.Time + + noSmithyDocumentSerde +} + +type CreateAIPromptVersionOutput struct { + + // The data of the AI Prompt version. + AiPrompt *types.AIPromptData + + // The version number of the AI Prompt version. + VersionNumber *int64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAIPromptVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAIPromptVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAIPromptVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAIPromptVersion"); 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 = addSpanRetryLoop(stack, options); 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_opCreateAIPromptVersionMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateAIPromptVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAIPromptVersion(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateAIPromptVersion struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateAIPromptVersion) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateAIPromptVersion) 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.(*CreateAIPromptVersionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAIPromptVersionInput ") + } + + 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_opCreateAIPromptVersionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAIPromptVersion{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateAIPromptVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateAIPromptVersion", + } +} diff --git a/service/qconnect/api_op_CreateKnowledgeBase.go b/service/qconnect/api_op_CreateKnowledgeBase.go index 880b50e2469..e602d152447 100644 --- a/service/qconnect/api_op_CreateKnowledgeBase.go +++ b/service/qconnect/api_op_CreateKnowledgeBase.go @@ -94,6 +94,9 @@ type CreateKnowledgeBaseInput struct { // The tags used to organize, track, or control access for this resource. Tags map[string]string + // Contains details about how to ingest the documents in a data source. + VectorIngestionConfiguration *types.VectorIngestionConfiguration + noSmithyDocumentSerde } diff --git a/service/qconnect/api_op_CreateSession.go b/service/qconnect/api_op_CreateSession.go index 3845a9c5750..26687802c59 100644 --- a/service/qconnect/api_op_CreateSession.go +++ b/service/qconnect/api_op_CreateSession.go @@ -42,6 +42,10 @@ type CreateSessionInput struct { // This member is required. Name *string + // The configuration of the AI Agents (mapped by AI Agent Type to AI Agent + // version) that should be used by Amazon Q in Connect for this Session. + AiAgentConfiguration map[string]types.AIAgentConfigurationData + // A unique, case-sensitive identifier that you provide to ensure the idempotency // of the request. If not provided, the Amazon Web Services SDK populates this // field. For more information about idempotency, see [Making retries safe with idempotent APIs]. diff --git a/service/qconnect/api_op_DeleteAIAgent.go b/service/qconnect/api_op_DeleteAIAgent.go new file mode 100644 index 00000000000..587ed43db4d --- /dev/null +++ b/service/qconnect/api_op_DeleteAIAgent.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +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 Amazon Q in Connect AI Agent. +func (c *Client) DeleteAIAgent(ctx context.Context, params *DeleteAIAgentInput, optFns ...func(*Options)) (*DeleteAIAgentOutput, error) { + if params == nil { + params = &DeleteAIAgentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAIAgent", params, optFns, c.addOperationDeleteAIAgentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAIAgentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAIAgentInput struct { + + // The identifier of the Amazon Q in Connect AI Agent. Can be either the ID or the + // ARN. URLs cannot contain the ARN. + // + // This member is required. + AiAgentId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + noSmithyDocumentSerde +} + +type DeleteAIAgentOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAIAgentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAIAgent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAIAgent{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAIAgent"); 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 = addSpanRetryLoop(stack, options); 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 = addOpDeleteAIAgentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAIAgent(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAIAgent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteAIAgent", + } +} diff --git a/service/qconnect/api_op_DeleteAIAgentVersion.go b/service/qconnect/api_op_DeleteAIAgentVersion.go new file mode 100644 index 00000000000..b78b60f8485 --- /dev/null +++ b/service/qconnect/api_op_DeleteAIAgentVersion.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +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 Amazon Q in Connect AI Agent Version. +func (c *Client) DeleteAIAgentVersion(ctx context.Context, params *DeleteAIAgentVersionInput, optFns ...func(*Options)) (*DeleteAIAgentVersionOutput, error) { + if params == nil { + params = &DeleteAIAgentVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAIAgentVersion", params, optFns, c.addOperationDeleteAIAgentVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAIAgentVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAIAgentVersionInput struct { + + // The identifier of the Amazon Q in Connect AI Agent. Can be either the ID or the + // ARN. URLs cannot contain the ARN. + // + // This member is required. + AiAgentId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The version number of the AI Agent version. + // + // This member is required. + VersionNumber *int64 + + noSmithyDocumentSerde +} + +type DeleteAIAgentVersionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAIAgentVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAIAgentVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAIAgentVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAIAgentVersion"); 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 = addSpanRetryLoop(stack, options); 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 = addOpDeleteAIAgentVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAIAgentVersion(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAIAgentVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteAIAgentVersion", + } +} diff --git a/service/qconnect/api_op_DeleteAIPrompt.go b/service/qconnect/api_op_DeleteAIPrompt.go new file mode 100644 index 00000000000..27245b7a766 --- /dev/null +++ b/service/qconnect/api_op_DeleteAIPrompt.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +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 Amazon Q in Connect AI Prompt. +func (c *Client) DeleteAIPrompt(ctx context.Context, params *DeleteAIPromptInput, optFns ...func(*Options)) (*DeleteAIPromptOutput, error) { + if params == nil { + params = &DeleteAIPromptInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAIPrompt", params, optFns, c.addOperationDeleteAIPromptMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAIPromptOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAIPromptInput struct { + + // The identifier of the Amazon Q in Connect AI prompt. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AiPromptId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + noSmithyDocumentSerde +} + +type DeleteAIPromptOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAIPromptMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAIPrompt{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAIPrompt{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAIPrompt"); 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 = addSpanRetryLoop(stack, options); 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 = addOpDeleteAIPromptValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAIPrompt(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAIPrompt(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteAIPrompt", + } +} diff --git a/service/qconnect/api_op_DeleteAIPromptVersion.go b/service/qconnect/api_op_DeleteAIPromptVersion.go new file mode 100644 index 00000000000..5629ed21507 --- /dev/null +++ b/service/qconnect/api_op_DeleteAIPromptVersion.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +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" +) + +// Delete and Amazon Q in Connect AI Prompt version. +func (c *Client) DeleteAIPromptVersion(ctx context.Context, params *DeleteAIPromptVersionInput, optFns ...func(*Options)) (*DeleteAIPromptVersionOutput, error) { + if params == nil { + params = &DeleteAIPromptVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAIPromptVersion", params, optFns, c.addOperationDeleteAIPromptVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAIPromptVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAIPromptVersionInput struct { + + // The identifier of the Amazon Q in Connect AI prompt. + // + // This member is required. + AiPromptId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The version number of the AI Prompt version to be deleted. + // + // This member is required. + VersionNumber *int64 + + noSmithyDocumentSerde +} + +type DeleteAIPromptVersionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAIPromptVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAIPromptVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAIPromptVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAIPromptVersion"); 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 = addSpanRetryLoop(stack, options); 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 = addOpDeleteAIPromptVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAIPromptVersion(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAIPromptVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteAIPromptVersion", + } +} diff --git a/service/qconnect/api_op_GetAIAgent.go b/service/qconnect/api_op_GetAIAgent.go new file mode 100644 index 00000000000..d78edd4727c --- /dev/null +++ b/service/qconnect/api_op_GetAIAgent.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets an Amazon Q in Connect AI Agent. +func (c *Client) GetAIAgent(ctx context.Context, params *GetAIAgentInput, optFns ...func(*Options)) (*GetAIAgentOutput, error) { + if params == nil { + params = &GetAIAgentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAIAgent", params, optFns, c.addOperationGetAIAgentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAIAgentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAIAgentInput struct { + + // The identifier of the Amazon Q in Connect AI Agent (with or without a version + // qualifier). Can be either the ID or the ARN. URLs cannot contain the ARN. + // + // This member is required. + AiAgentId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + noSmithyDocumentSerde +} + +type GetAIAgentOutput struct { + + // The data of the AI Agent. + AiAgent *types.AIAgentData + + // The version number of the AI Agent version (returned if an AI Agent version was + // specified via use of a qualifier for the aiAgentId on the request). + VersionNumber *int64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAIAgentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAIAgent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAIAgent{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAIAgent"); 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 = addSpanRetryLoop(stack, options); 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 = addOpGetAIAgentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAIAgent(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetAIAgent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetAIAgent", + } +} diff --git a/service/qconnect/api_op_GetAIPrompt.go b/service/qconnect/api_op_GetAIPrompt.go new file mode 100644 index 00000000000..5e7bddf9db4 --- /dev/null +++ b/service/qconnect/api_op_GetAIPrompt.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets and Amazon Q in Connect AI Prompt. +func (c *Client) GetAIPrompt(ctx context.Context, params *GetAIPromptInput, optFns ...func(*Options)) (*GetAIPromptOutput, error) { + if params == nil { + params = &GetAIPromptInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAIPrompt", params, optFns, c.addOperationGetAIPromptMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAIPromptOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAIPromptInput struct { + + // The identifier of the Amazon Q in Connect AI prompt. + // + // This member is required. + AiPromptId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + noSmithyDocumentSerde +} + +type GetAIPromptOutput struct { + + // The data of the AI Prompt. + AiPrompt *types.AIPromptData + + // The version number of the AI Prompt version (returned if an AI Prompt version + // was specified via use of a qualifier for the aiPromptId on the request). + VersionNumber *int64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAIPromptMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAIPrompt{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAIPrompt{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAIPrompt"); 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 = addSpanRetryLoop(stack, options); 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 = addOpGetAIPromptValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAIPrompt(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetAIPrompt(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetAIPrompt", + } +} diff --git a/service/qconnect/api_op_ListAIAgentVersions.go b/service/qconnect/api_op_ListAIAgentVersions.go new file mode 100644 index 00000000000..ed984434537 --- /dev/null +++ b/service/qconnect/api_op_ListAIAgentVersions.go @@ -0,0 +1,276 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List AI Agent versions. +func (c *Client) ListAIAgentVersions(ctx context.Context, params *ListAIAgentVersionsInput, optFns ...func(*Options)) (*ListAIAgentVersionsOutput, error) { + if params == nil { + params = &ListAIAgentVersionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAIAgentVersions", params, optFns, c.addOperationListAIAgentVersionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAIAgentVersionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAIAgentVersionsInput struct { + + // The identifier of the Amazon Q in Connect AI Agent for which versions are to be + // listed. + // + // This member is required. + AiAgentId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // The origin of the AI Agent versions to be listed. SYSTEM for a default AI Agent + // created by Q in Connect or CUSTOMER for an AI Agent created by calling AI Agent + // creation APIs. + Origin types.Origin + + noSmithyDocumentSerde +} + +type ListAIAgentVersionsOutput struct { + + // The summaries of AI Agent versions. + // + // This member is required. + AiAgentVersionSummaries []types.AIAgentVersionSummary + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAIAgentVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAIAgentVersions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAIAgentVersions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAIAgentVersions"); 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 = addSpanRetryLoop(stack, options); 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 = addOpListAIAgentVersionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAIAgentVersions(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListAIAgentVersionsPaginatorOptions is the paginator options for +// ListAIAgentVersions +type ListAIAgentVersionsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListAIAgentVersionsPaginator is a paginator for ListAIAgentVersions +type ListAIAgentVersionsPaginator struct { + options ListAIAgentVersionsPaginatorOptions + client ListAIAgentVersionsAPIClient + params *ListAIAgentVersionsInput + nextToken *string + firstPage bool +} + +// NewListAIAgentVersionsPaginator returns a new ListAIAgentVersionsPaginator +func NewListAIAgentVersionsPaginator(client ListAIAgentVersionsAPIClient, params *ListAIAgentVersionsInput, optFns ...func(*ListAIAgentVersionsPaginatorOptions)) *ListAIAgentVersionsPaginator { + if params == nil { + params = &ListAIAgentVersionsInput{} + } + + options := ListAIAgentVersionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAIAgentVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAIAgentVersionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAIAgentVersions page. +func (p *ListAIAgentVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAIAgentVersionsOutput, 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.ListAIAgentVersions(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 +} + +// ListAIAgentVersionsAPIClient is a client that implements the +// ListAIAgentVersions operation. +type ListAIAgentVersionsAPIClient interface { + ListAIAgentVersions(context.Context, *ListAIAgentVersionsInput, ...func(*Options)) (*ListAIAgentVersionsOutput, error) +} + +var _ ListAIAgentVersionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListAIAgentVersions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAIAgentVersions", + } +} diff --git a/service/qconnect/api_op_ListAIAgents.go b/service/qconnect/api_op_ListAIAgents.go new file mode 100644 index 00000000000..a5e3fe126d8 --- /dev/null +++ b/service/qconnect/api_op_ListAIAgents.go @@ -0,0 +1,268 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists AI Agents. +func (c *Client) ListAIAgents(ctx context.Context, params *ListAIAgentsInput, optFns ...func(*Options)) (*ListAIAgentsOutput, error) { + if params == nil { + params = &ListAIAgentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAIAgents", params, optFns, c.addOperationListAIAgentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAIAgentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAIAgentsInput struct { + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // The origin of the AI Agents to be listed. SYSTEM for a default AI Agent created + // by Q in Connect or CUSTOMER for an AI Agent created by calling AI Agent + // creation APIs. + Origin types.Origin + + noSmithyDocumentSerde +} + +type ListAIAgentsOutput struct { + + // The summaries of AI Agents. + // + // This member is required. + AiAgentSummaries []types.AIAgentSummary + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAIAgentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAIAgents{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAIAgents{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAIAgents"); 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 = addSpanRetryLoop(stack, options); 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 = addOpListAIAgentsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAIAgents(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListAIAgentsPaginatorOptions is the paginator options for ListAIAgents +type ListAIAgentsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListAIAgentsPaginator is a paginator for ListAIAgents +type ListAIAgentsPaginator struct { + options ListAIAgentsPaginatorOptions + client ListAIAgentsAPIClient + params *ListAIAgentsInput + nextToken *string + firstPage bool +} + +// NewListAIAgentsPaginator returns a new ListAIAgentsPaginator +func NewListAIAgentsPaginator(client ListAIAgentsAPIClient, params *ListAIAgentsInput, optFns ...func(*ListAIAgentsPaginatorOptions)) *ListAIAgentsPaginator { + if params == nil { + params = &ListAIAgentsInput{} + } + + options := ListAIAgentsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAIAgentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAIAgentsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAIAgents page. +func (p *ListAIAgentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAIAgentsOutput, 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.ListAIAgents(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 +} + +// ListAIAgentsAPIClient is a client that implements the ListAIAgents operation. +type ListAIAgentsAPIClient interface { + ListAIAgents(context.Context, *ListAIAgentsInput, ...func(*Options)) (*ListAIAgentsOutput, error) +} + +var _ ListAIAgentsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListAIAgents(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAIAgents", + } +} diff --git a/service/qconnect/api_op_ListAIPromptVersions.go b/service/qconnect/api_op_ListAIPromptVersions.go new file mode 100644 index 00000000000..4f4229eb737 --- /dev/null +++ b/service/qconnect/api_op_ListAIPromptVersions.go @@ -0,0 +1,276 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists AI Prompt versions. +func (c *Client) ListAIPromptVersions(ctx context.Context, params *ListAIPromptVersionsInput, optFns ...func(*Options)) (*ListAIPromptVersionsOutput, error) { + if params == nil { + params = &ListAIPromptVersionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAIPromptVersions", params, optFns, c.addOperationListAIPromptVersionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAIPromptVersionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAIPromptVersionsInput struct { + + // The identifier of the Amazon Q in Connect AI prompt for which versions are to + // be listed. + // + // This member is required. + AiPromptId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // The origin of the AI Prompt versions to be listed. SYSTEM for a default AI + // Agent created by Q in Connect or CUSTOMER for an AI Agent created by calling AI + // Agent creation APIs. + Origin types.Origin + + noSmithyDocumentSerde +} + +type ListAIPromptVersionsOutput struct { + + // The summaries of the AI Prompt versions. + // + // This member is required. + AiPromptVersionSummaries []types.AIPromptVersionSummary + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAIPromptVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAIPromptVersions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAIPromptVersions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAIPromptVersions"); 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 = addSpanRetryLoop(stack, options); 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 = addOpListAIPromptVersionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAIPromptVersions(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListAIPromptVersionsPaginatorOptions is the paginator options for +// ListAIPromptVersions +type ListAIPromptVersionsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListAIPromptVersionsPaginator is a paginator for ListAIPromptVersions +type ListAIPromptVersionsPaginator struct { + options ListAIPromptVersionsPaginatorOptions + client ListAIPromptVersionsAPIClient + params *ListAIPromptVersionsInput + nextToken *string + firstPage bool +} + +// NewListAIPromptVersionsPaginator returns a new ListAIPromptVersionsPaginator +func NewListAIPromptVersionsPaginator(client ListAIPromptVersionsAPIClient, params *ListAIPromptVersionsInput, optFns ...func(*ListAIPromptVersionsPaginatorOptions)) *ListAIPromptVersionsPaginator { + if params == nil { + params = &ListAIPromptVersionsInput{} + } + + options := ListAIPromptVersionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAIPromptVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAIPromptVersionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAIPromptVersions page. +func (p *ListAIPromptVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAIPromptVersionsOutput, 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.ListAIPromptVersions(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 +} + +// ListAIPromptVersionsAPIClient is a client that implements the +// ListAIPromptVersions operation. +type ListAIPromptVersionsAPIClient interface { + ListAIPromptVersions(context.Context, *ListAIPromptVersionsInput, ...func(*Options)) (*ListAIPromptVersionsOutput, error) +} + +var _ ListAIPromptVersionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListAIPromptVersions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAIPromptVersions", + } +} diff --git a/service/qconnect/api_op_ListAIPrompts.go b/service/qconnect/api_op_ListAIPrompts.go new file mode 100644 index 00000000000..d2cf092d1ac --- /dev/null +++ b/service/qconnect/api_op_ListAIPrompts.go @@ -0,0 +1,268 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the AI Prompts available on the Amazon Q in Connect assistant. +func (c *Client) ListAIPrompts(ctx context.Context, params *ListAIPromptsInput, optFns ...func(*Options)) (*ListAIPromptsOutput, error) { + if params == nil { + params = &ListAIPromptsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAIPrompts", params, optFns, c.addOperationListAIPromptsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAIPromptsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAIPromptsInput struct { + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // The origin of the AI Prompts to be listed. SYSTEM for a default AI Agent + // created by Q in Connect or CUSTOMER for an AI Agent created by calling AI Agent + // creation APIs. + Origin types.Origin + + noSmithyDocumentSerde +} + +type ListAIPromptsOutput struct { + + // The summaries of the AI Prompts. + // + // This member is required. + AiPromptSummaries []types.AIPromptSummary + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAIPromptsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAIPrompts{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAIPrompts{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAIPrompts"); 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 = addSpanRetryLoop(stack, options); 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 = addOpListAIPromptsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAIPrompts(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListAIPromptsPaginatorOptions is the paginator options for ListAIPrompts +type ListAIPromptsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListAIPromptsPaginator is a paginator for ListAIPrompts +type ListAIPromptsPaginator struct { + options ListAIPromptsPaginatorOptions + client ListAIPromptsAPIClient + params *ListAIPromptsInput + nextToken *string + firstPage bool +} + +// NewListAIPromptsPaginator returns a new ListAIPromptsPaginator +func NewListAIPromptsPaginator(client ListAIPromptsAPIClient, params *ListAIPromptsInput, optFns ...func(*ListAIPromptsPaginatorOptions)) *ListAIPromptsPaginator { + if params == nil { + params = &ListAIPromptsInput{} + } + + options := ListAIPromptsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAIPromptsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAIPromptsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAIPrompts page. +func (p *ListAIPromptsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAIPromptsOutput, 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.ListAIPrompts(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 +} + +// ListAIPromptsAPIClient is a client that implements the ListAIPrompts operation. +type ListAIPromptsAPIClient interface { + ListAIPrompts(context.Context, *ListAIPromptsInput, ...func(*Options)) (*ListAIPromptsOutput, error) +} + +var _ ListAIPromptsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListAIPrompts(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAIPrompts", + } +} diff --git a/service/qconnect/api_op_QueryAssistant.go b/service/qconnect/api_op_QueryAssistant.go index 26f1518bcb0..3f5db9e3411 100644 --- a/service/qconnect/api_op_QueryAssistant.go +++ b/service/qconnect/api_op_QueryAssistant.go @@ -48,11 +48,6 @@ type QueryAssistantInput struct { // This member is required. AssistantId *string - // The text to search for. - // - // This member is required. - QueryText *string - // The maximum number of results to return per page. MaxResults *int32 @@ -60,9 +55,20 @@ type QueryAssistantInput struct { // response in the next request to retrieve the next set of results. NextToken *string + // The search type to be used against the Knowledge Base for this request. The + // values can be SEMANTIC which uses vector embeddings or HYBRID which use vector + // embeddings and raw text. + OverrideKnowledgeBaseSearchType types.KnowledgeBaseSearchType + // Information about how to query content. QueryCondition []types.QueryCondition + // Information about the query. + QueryInputData types.QueryInputData + + // The text to search for. + QueryText *string + // The identifier of the Amazon Q in Connect session. Can be either the ID or the // ARN. URLs cannot contain the ARN. SessionId *string diff --git a/service/qconnect/api_op_RemoveAssistantAIAgent.go b/service/qconnect/api_op_RemoveAssistantAIAgent.go new file mode 100644 index 00000000000..1bb89a5e6b8 --- /dev/null +++ b/service/qconnect/api_op_RemoveAssistantAIAgent.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the AI Agent that is set for use by defafult on an Amazon Q in Connect +// Assistant. +func (c *Client) RemoveAssistantAIAgent(ctx context.Context, params *RemoveAssistantAIAgentInput, optFns ...func(*Options)) (*RemoveAssistantAIAgentOutput, error) { + if params == nil { + params = &RemoveAssistantAIAgentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveAssistantAIAgent", params, optFns, c.addOperationRemoveAssistantAIAgentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveAssistantAIAgentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RemoveAssistantAIAgentInput struct { + + // The type of the AI Agent being removed for use by default from the Amazon Q in + // Connect Assistant. + // + // This member is required. + AiAgentType types.AIAgentType + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + noSmithyDocumentSerde +} + +type RemoveAssistantAIAgentOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveAssistantAIAgentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpRemoveAssistantAIAgent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRemoveAssistantAIAgent{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveAssistantAIAgent"); 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 = addSpanRetryLoop(stack, options); 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 = addOpRemoveAssistantAIAgentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveAssistantAIAgent(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRemoveAssistantAIAgent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RemoveAssistantAIAgent", + } +} diff --git a/service/qconnect/api_op_UpdateAIAgent.go b/service/qconnect/api_op_UpdateAIAgent.go new file mode 100644 index 00000000000..111bf14813e --- /dev/null +++ b/service/qconnect/api_op_UpdateAIAgent.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an AI Agent. +func (c *Client) UpdateAIAgent(ctx context.Context, params *UpdateAIAgentInput, optFns ...func(*Options)) (*UpdateAIAgentOutput, error) { + if params == nil { + params = &UpdateAIAgentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAIAgent", params, optFns, c.addOperationUpdateAIAgentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAIAgentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAIAgentInput struct { + + // The identifier of the Amazon Q in Connect AI Agent. + // + // This member is required. + AiAgentId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The visbility status of the Amazon Q in Connect AI Agent. + // + // This member is required. + VisibilityStatus types.VisibilityStatus + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If not provided, the AWS SDK populates this field. For more + // information about idempotency, see [Making retries safe with idempotent APIs]. + // + // [Making retries safe with idempotent APIs]: http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/ + ClientToken *string + + // The configuration of the Amazon Q in Connect AI Agent. + Configuration types.AIAgentConfiguration + + // The description of the Amazon Q in Connect AI Agent. + Description *string + + noSmithyDocumentSerde +} + +type UpdateAIAgentOutput struct { + + // The data of the updated Amazon Q in Connect AI Agent. + AiAgent *types.AIAgentData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAIAgentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAIAgent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAIAgent{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAIAgent"); 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 = addSpanRetryLoop(stack, options); 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_opUpdateAIAgentMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateAIAgentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAIAgent(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpUpdateAIAgent struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpdateAIAgent) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpdateAIAgent) 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.(*UpdateAIAgentInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateAIAgentInput ") + } + + 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_opUpdateAIAgentMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateAIAgent{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpdateAIAgent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateAIAgent", + } +} diff --git a/service/qconnect/api_op_UpdateAIPrompt.go b/service/qconnect/api_op_UpdateAIPrompt.go new file mode 100644 index 00000000000..a96d1b6c95c --- /dev/null +++ b/service/qconnect/api_op_UpdateAIPrompt.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an AI Prompt. +func (c *Client) UpdateAIPrompt(ctx context.Context, params *UpdateAIPromptInput, optFns ...func(*Options)) (*UpdateAIPromptOutput, error) { + if params == nil { + params = &UpdateAIPromptInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAIPrompt", params, optFns, c.addOperationUpdateAIPromptMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAIPromptOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAIPromptInput struct { + + // The identifier of the Amazon Q in Connect AI Prompt. + // + // This member is required. + AiPromptId *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The visibility status of the Amazon Q in Connect AI prompt. + // + // This member is required. + VisibilityStatus types.VisibilityStatus + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If not provided, the AWS SDK populates this field. For more + // information about idempotency, see [Making retries safe with idempotent APIs]. + // + // [Making retries safe with idempotent APIs]: http://aws.amazon.com/https:/aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/ + ClientToken *string + + // The description of the Amazon Q in Connect AI Prompt. + Description *string + + // The configuration of the prompt template for this AI Prompt. + TemplateConfiguration types.AIPromptTemplateConfiguration + + noSmithyDocumentSerde +} + +type UpdateAIPromptOutput struct { + + // The data of the updated Amazon Q in Connect AI Prompt. + AiPrompt *types.AIPromptData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAIPromptMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAIPrompt{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAIPrompt{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAIPrompt"); 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 = addSpanRetryLoop(stack, options); 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_opUpdateAIPromptMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateAIPromptValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAIPrompt(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpUpdateAIPrompt struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpdateAIPrompt) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpdateAIPrompt) 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.(*UpdateAIPromptInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateAIPromptInput ") + } + + 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_opUpdateAIPromptMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateAIPrompt{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpdateAIPrompt(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateAIPrompt", + } +} diff --git a/service/qconnect/api_op_UpdateAssistantAIAgent.go b/service/qconnect/api_op_UpdateAssistantAIAgent.go new file mode 100644 index 00000000000..1b57200680b --- /dev/null +++ b/service/qconnect/api_op_UpdateAssistantAIAgent.go @@ -0,0 +1,171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the AI Agent that is set for use by defafult on an Amazon Q in Connect +// Assistant. +func (c *Client) UpdateAssistantAIAgent(ctx context.Context, params *UpdateAssistantAIAgentInput, optFns ...func(*Options)) (*UpdateAssistantAIAgentOutput, error) { + if params == nil { + params = &UpdateAssistantAIAgentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAssistantAIAgent", params, optFns, c.addOperationUpdateAssistantAIAgentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAssistantAIAgentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAssistantAIAgentInput struct { + + // The type of the AI Agent being updated for use by default on the Amazon Q in + // Connect Assistant. + // + // This member is required. + AiAgentType types.AIAgentType + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The configuration of the AI Agent being updated for use by default on the + // Amazon Q in Connect Assistant. + // + // This member is required. + Configuration *types.AIAgentConfigurationData + + noSmithyDocumentSerde +} + +type UpdateAssistantAIAgentOutput struct { + + // The assistant data. + Assistant *types.AssistantData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAssistantAIAgentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAssistantAIAgent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAssistantAIAgent{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAssistantAIAgent"); 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 = addSpanRetryLoop(stack, options); 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 = addOpUpdateAssistantAIAgentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAssistantAIAgent(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateAssistantAIAgent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateAssistantAIAgent", + } +} diff --git a/service/qconnect/api_op_UpdateSession.go b/service/qconnect/api_op_UpdateSession.go index c6d3c139487..1b1d1c6921f 100644 --- a/service/qconnect/api_op_UpdateSession.go +++ b/service/qconnect/api_op_UpdateSession.go @@ -43,6 +43,10 @@ type UpdateSessionInput struct { // This member is required. SessionId *string + // The configuration of the AI Agents (mapped by AI Agent Type to AI Agent + // version) that should be used by Amazon Q in Connect for this Session. + AiAgentConfiguration map[string]types.AIAgentConfigurationData + // The description. Description *string diff --git a/service/qconnect/api_op_UpdateSessionData.go b/service/qconnect/api_op_UpdateSessionData.go new file mode 100644 index 00000000000..0fbe69d87d1 --- /dev/null +++ b/service/qconnect/api_op_UpdateSessionData.go @@ -0,0 +1,191 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the data stored on an Amazon Q in Connect Session. +func (c *Client) UpdateSessionData(ctx context.Context, params *UpdateSessionDataInput, optFns ...func(*Options)) (*UpdateSessionDataOutput, error) { + if params == nil { + params = &UpdateSessionDataInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSessionData", params, optFns, c.addOperationUpdateSessionDataMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSessionDataOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSessionDataInput struct { + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The data stored on the Amazon Q in Connect Session. + // + // This member is required. + Data []types.RuntimeSessionData + + // The identifier of the session. Can be either the ID or the ARN. URLs cannot + // contain the ARN. + // + // This member is required. + SessionId *string + + // The namespace into which the session data is stored. Supported namespaces are: + // Custom + Namespace types.SessionDataNamespace + + noSmithyDocumentSerde +} + +type UpdateSessionDataOutput struct { + + // Data stored in the session. + // + // This member is required. + Data []types.RuntimeSessionData + + // The namespace into which the session data is stored. Supported namespaces are: + // Custom + // + // This member is required. + Namespace types.SessionDataNamespace + + // The Amazon Resource Name (ARN) of the session. + // + // This member is required. + SessionArn *string + + // The identifier of the session. + // + // This member is required. + SessionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSessionDataMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSessionData{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSessionData{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSessionData"); 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 = addSpanRetryLoop(stack, options); 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 = addOpUpdateSessionDataValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSessionData(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateSessionData(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateSessionData", + } +} diff --git a/service/qconnect/deserializers.go b/service/qconnect/deserializers.go index 7d73d96871c..ca0ccae5d1b 100644 --- a/service/qconnect/deserializers.go +++ b/service/qconnect/deserializers.go @@ -30,14 +30,14 @@ func deserializeS3Expires(v string) (*time.Time, error) { return &t, nil } -type awsRestjson1_deserializeOpCreateAssistant struct { +type awsRestjson1_deserializeOpCreateAIAgent struct { } -func (*awsRestjson1_deserializeOpCreateAssistant) ID() string { +func (*awsRestjson1_deserializeOpCreateAIAgent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateAssistant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAIAgent) 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,9 +55,9 @@ func (m *awsRestjson1_deserializeOpCreateAssistant) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateAssistant(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAIAgent(response, &metadata) } - output := &CreateAssistantOutput{} + output := &CreateAIAgentOutput{} out.Result = output var buff [1024]byte @@ -78,7 +78,7 @@ func (m *awsRestjson1_deserializeOpCreateAssistant) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateAssistantOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAIAgentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -92,7 +92,7 @@ func (m *awsRestjson1_deserializeOpCreateAssistant) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateAssistant(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAIAgent(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)} @@ -139,9 +139,15 @@ func awsRestjson1_deserializeOpErrorCreateAssistant(response *smithyhttp.Respons case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(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) @@ -155,7 +161,7 @@ func awsRestjson1_deserializeOpErrorCreateAssistant(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentCreateAssistantOutput(v **CreateAssistantOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAIAgentOutput(v **CreateAIAgentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -168,17 +174,17 @@ func awsRestjson1_deserializeOpDocumentCreateAssistantOutput(v **CreateAssistant return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateAssistantOutput + var sv *CreateAIAgentOutput if *v == nil { - sv = &CreateAssistantOutput{} + sv = &CreateAIAgentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assistant": - if err := awsRestjson1_deserializeDocumentAssistantData(&sv.Assistant, value); err != nil { + case "aiAgent": + if err := awsRestjson1_deserializeDocumentAIAgentData(&sv.AiAgent, value); err != nil { return err } @@ -191,14 +197,14 @@ func awsRestjson1_deserializeOpDocumentCreateAssistantOutput(v **CreateAssistant return nil } -type awsRestjson1_deserializeOpCreateAssistantAssociation struct { +type awsRestjson1_deserializeOpCreateAIAgentVersion struct { } -func (*awsRestjson1_deserializeOpCreateAssistantAssociation) ID() string { +func (*awsRestjson1_deserializeOpCreateAIAgentVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateAssistantAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAIAgentVersion) 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) @@ -216,9 +222,9 @@ func (m *awsRestjson1_deserializeOpCreateAssistantAssociation) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateAssistantAssociation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAIAgentVersion(response, &metadata) } - output := &CreateAssistantAssociationOutput{} + output := &CreateAIAgentVersionOutput{} out.Result = output var buff [1024]byte @@ -239,7 +245,7 @@ func (m *awsRestjson1_deserializeOpCreateAssistantAssociation) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateAssistantAssociationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAIAgentVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -253,7 +259,7 @@ func (m *awsRestjson1_deserializeOpCreateAssistantAssociation) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateAssistantAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAIAgentVersion(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)} @@ -306,6 +312,9 @@ func awsRestjson1_deserializeOpErrorCreateAssistantAssociation(response *smithyh 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) @@ -319,7 +328,7 @@ func awsRestjson1_deserializeOpErrorCreateAssistantAssociation(response *smithyh } } -func awsRestjson1_deserializeOpDocumentCreateAssistantAssociationOutput(v **CreateAssistantAssociationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAIAgentVersionOutput(v **CreateAIAgentVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -332,20 +341,33 @@ func awsRestjson1_deserializeOpDocumentCreateAssistantAssociationOutput(v **Crea return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateAssistantAssociationOutput + var sv *CreateAIAgentVersionOutput if *v == nil { - sv = &CreateAssistantAssociationOutput{} + sv = &CreateAIAgentVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assistantAssociation": - if err := awsRestjson1_deserializeDocumentAssistantAssociationData(&sv.AssistantAssociation, value); err != nil { + case "aiAgent": + if err := awsRestjson1_deserializeDocumentAIAgentData(&sv.AiAgent, value); err != nil { return err } + case "versionNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Version to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.VersionNumber = ptr.Int64(i64) + } + default: _, _ = key, value @@ -355,14 +377,14 @@ func awsRestjson1_deserializeOpDocumentCreateAssistantAssociationOutput(v **Crea return nil } -type awsRestjson1_deserializeOpCreateContent struct { +type awsRestjson1_deserializeOpCreateAIPrompt struct { } -func (*awsRestjson1_deserializeOpCreateContent) ID() string { +func (*awsRestjson1_deserializeOpCreateAIPrompt) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAIPrompt) 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) @@ -380,9 +402,9 @@ func (m *awsRestjson1_deserializeOpCreateContent) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateContent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAIPrompt(response, &metadata) } - output := &CreateContentOutput{} + output := &CreateAIPromptOutput{} out.Result = output var buff [1024]byte @@ -403,7 +425,7 @@ func (m *awsRestjson1_deserializeOpCreateContent) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateContentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAIPromptOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -417,7 +439,7 @@ func (m *awsRestjson1_deserializeOpCreateContent) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAIPrompt(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)} @@ -470,6 +492,9 @@ func awsRestjson1_deserializeOpErrorCreateContent(response *smithyhttp.Response, 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) @@ -483,7 +508,7 @@ func awsRestjson1_deserializeOpErrorCreateContent(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentCreateContentOutput(v **CreateContentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAIPromptOutput(v **CreateAIPromptOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -496,17 +521,17 @@ func awsRestjson1_deserializeOpDocumentCreateContentOutput(v **CreateContentOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateContentOutput + var sv *CreateAIPromptOutput if *v == nil { - sv = &CreateContentOutput{} + sv = &CreateAIPromptOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "content": - if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, value); err != nil { + case "aiPrompt": + if err := awsRestjson1_deserializeDocumentAIPromptData(&sv.AiPrompt, value); err != nil { return err } @@ -519,14 +544,14 @@ func awsRestjson1_deserializeOpDocumentCreateContentOutput(v **CreateContentOutp return nil } -type awsRestjson1_deserializeOpCreateContentAssociation struct { +type awsRestjson1_deserializeOpCreateAIPromptVersion struct { } -func (*awsRestjson1_deserializeOpCreateContentAssociation) ID() string { +func (*awsRestjson1_deserializeOpCreateAIPromptVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateContentAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAIPromptVersion) 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) @@ -544,9 +569,9 @@ func (m *awsRestjson1_deserializeOpCreateContentAssociation) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateContentAssociation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAIPromptVersion(response, &metadata) } - output := &CreateContentAssociationOutput{} + output := &CreateAIPromptVersionOutput{} out.Result = output var buff [1024]byte @@ -567,7 +592,7 @@ func (m *awsRestjson1_deserializeOpCreateContentAssociation) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateContentAssociationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAIPromptVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -581,7 +606,7 @@ func (m *awsRestjson1_deserializeOpCreateContentAssociation) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateContentAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAIPromptVersion(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)} @@ -650,7 +675,7 @@ func awsRestjson1_deserializeOpErrorCreateContentAssociation(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentCreateContentAssociationOutput(v **CreateContentAssociationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAIPromptVersionOutput(v **CreateAIPromptVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -663,20 +688,33 @@ func awsRestjson1_deserializeOpDocumentCreateContentAssociationOutput(v **Create return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateContentAssociationOutput + var sv *CreateAIPromptVersionOutput if *v == nil { - sv = &CreateContentAssociationOutput{} + sv = &CreateAIPromptVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "contentAssociation": - if err := awsRestjson1_deserializeDocumentContentAssociationData(&sv.ContentAssociation, value); err != nil { + case "aiPrompt": + if err := awsRestjson1_deserializeDocumentAIPromptData(&sv.AiPrompt, value); err != nil { return err } + case "versionNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Version to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.VersionNumber = ptr.Int64(i64) + } + default: _, _ = key, value @@ -686,14 +724,14 @@ func awsRestjson1_deserializeOpDocumentCreateContentAssociationOutput(v **Create return nil } -type awsRestjson1_deserializeOpCreateKnowledgeBase struct { +type awsRestjson1_deserializeOpCreateAssistant struct { } -func (*awsRestjson1_deserializeOpCreateKnowledgeBase) ID() string { +func (*awsRestjson1_deserializeOpCreateAssistant) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAssistant) 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) @@ -711,9 +749,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_deserializeOpErrorCreateAssistant(response, &metadata) } - output := &CreateKnowledgeBaseOutput{} + output := &CreateAssistantOutput{} out.Result = output var buff [1024]byte @@ -734,7 +772,7 @@ func (m *awsRestjson1_deserializeOpCreateKnowledgeBase) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAssistantOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -748,7 +786,7 @@ func (m *awsRestjson1_deserializeOpCreateKnowledgeBase) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAssistant(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)} @@ -811,7 +849,7 @@ func awsRestjson1_deserializeOpErrorCreateKnowledgeBase(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(v **CreateKnowledgeBaseOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAssistantOutput(v **CreateAssistantOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -824,17 +862,17 @@ func awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(v **CreateKnowl return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateKnowledgeBaseOutput + var sv *CreateAssistantOutput if *v == nil { - sv = &CreateKnowledgeBaseOutput{} + sv = &CreateAssistantOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBase": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, value); err != nil { + case "assistant": + if err := awsRestjson1_deserializeDocumentAssistantData(&sv.Assistant, value); err != nil { return err } @@ -847,14 +885,14 @@ func awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(v **CreateKnowl return nil } -type awsRestjson1_deserializeOpCreateQuickResponse struct { +type awsRestjson1_deserializeOpCreateAssistantAssociation struct { } -func (*awsRestjson1_deserializeOpCreateQuickResponse) ID() string { +func (*awsRestjson1_deserializeOpCreateAssistantAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateQuickResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAssistantAssociation) 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 +910,9 @@ func (m *awsRestjson1_deserializeOpCreateQuickResponse) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateQuickResponse(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAssistantAssociation(response, &metadata) } - output := &CreateQuickResponseOutput{} + output := &CreateAssistantAssociationOutput{} out.Result = output var buff [1024]byte @@ -895,7 +933,7 @@ func (m *awsRestjson1_deserializeOpCreateQuickResponse) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateQuickResponseOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAssistantAssociationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -909,7 +947,7 @@ func (m *awsRestjson1_deserializeOpCreateQuickResponse) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateQuickResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAssistantAssociation(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)} @@ -975,7 +1013,7 @@ func awsRestjson1_deserializeOpErrorCreateQuickResponse(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentCreateQuickResponseOutput(v **CreateQuickResponseOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAssistantAssociationOutput(v **CreateAssistantAssociationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -988,17 +1026,17 @@ func awsRestjson1_deserializeOpDocumentCreateQuickResponseOutput(v **CreateQuick return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateQuickResponseOutput + var sv *CreateAssistantAssociationOutput if *v == nil { - sv = &CreateQuickResponseOutput{} + sv = &CreateAssistantAssociationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "quickResponse": - if err := awsRestjson1_deserializeDocumentQuickResponseData(&sv.QuickResponse, value); err != nil { + case "assistantAssociation": + if err := awsRestjson1_deserializeDocumentAssistantAssociationData(&sv.AssistantAssociation, value); err != nil { return err } @@ -1011,14 +1049,14 @@ func awsRestjson1_deserializeOpDocumentCreateQuickResponseOutput(v **CreateQuick return nil } -type awsRestjson1_deserializeOpCreateSession struct { +type awsRestjson1_deserializeOpCreateContent struct { } -func (*awsRestjson1_deserializeOpCreateSession) ID() string { +func (*awsRestjson1_deserializeOpCreateContent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateContent) 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) @@ -1036,9 +1074,9 @@ func (m *awsRestjson1_deserializeOpCreateSession) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateSession(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateContent(response, &metadata) } - output := &CreateSessionOutput{} + output := &CreateContentOutput{} out.Result = output var buff [1024]byte @@ -1059,7 +1097,7 @@ func (m *awsRestjson1_deserializeOpCreateSession) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateSessionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateContentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1073,7 +1111,7 @@ func (m *awsRestjson1_deserializeOpCreateSession) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateSession(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateContent(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 +1161,9 @@ func awsRestjson1_deserializeOpErrorCreateSession(response *smithyhttp.Response, case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -1136,7 +1177,7 @@ func awsRestjson1_deserializeOpErrorCreateSession(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentCreateSessionOutput(v **CreateSessionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateContentOutput(v **CreateContentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1149,17 +1190,17 @@ func awsRestjson1_deserializeOpDocumentCreateSessionOutput(v **CreateSessionOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateSessionOutput + var sv *CreateContentOutput if *v == nil { - sv = &CreateSessionOutput{} + sv = &CreateContentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "session": - if err := awsRestjson1_deserializeDocumentSessionData(&sv.Session, value); err != nil { + case "content": + if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, value); err != nil { return err } @@ -1172,14 +1213,14 @@ func awsRestjson1_deserializeOpDocumentCreateSessionOutput(v **CreateSessionOutp return nil } -type awsRestjson1_deserializeOpDeleteAssistant struct { +type awsRestjson1_deserializeOpCreateContentAssociation struct { } -func (*awsRestjson1_deserializeOpDeleteAssistant) ID() string { +func (*awsRestjson1_deserializeOpCreateContentAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteAssistant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateContentAssociation) 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) @@ -1197,16 +1238,44 @@ func (m *awsRestjson1_deserializeOpDeleteAssistant) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAssistant(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateContentAssociation(response, &metadata) } - output := &DeleteAssistantOutput{} + output := &CreateContentAssociationOutput{} 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_deserializeOpDocumentCreateContentAssociationOutput(&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(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteAssistant(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateContentAssociation(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)} @@ -1250,9 +1319,18 @@ func awsRestjson1_deserializeOpErrorDeleteAssistant(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("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) @@ -1266,14 +1344,50 @@ func awsRestjson1_deserializeOpErrorDeleteAssistant(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDeleteAssistantAssociation struct { +func awsRestjson1_deserializeOpDocumentCreateContentAssociationOutput(v **CreateContentAssociationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateContentAssociationOutput + if *v == nil { + sv = &CreateContentAssociationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentAssociation": + if err := awsRestjson1_deserializeDocumentContentAssociationData(&sv.ContentAssociation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteAssistantAssociation) ID() string { +type awsRestjson1_deserializeOpCreateKnowledgeBase struct { +} + +func (*awsRestjson1_deserializeOpCreateKnowledgeBase) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteAssistantAssociation) 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) @@ -1291,16 +1405,44 @@ func (m *awsRestjson1_deserializeOpDeleteAssistantAssociation) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateKnowledgeBase(response, &metadata) } - output := &DeleteAssistantAssociationOutput{} + output := &CreateKnowledgeBaseOutput{} out.Result = output - span.End() - return out, metadata, err -} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -func awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + 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_deserializeOpDocumentCreateKnowledgeBaseOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +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)} @@ -1344,8 +1486,11 @@ func awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(response *smithyh case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -1360,14 +1505,50 @@ func awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(response *smithyh } } -type awsRestjson1_deserializeOpDeleteContent struct { +func awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(v **CreateKnowledgeBaseOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateKnowledgeBaseOutput + if *v == nil { + sv = &CreateKnowledgeBaseOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "knowledgeBase": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteContent) ID() string { +type awsRestjson1_deserializeOpCreateQuickResponse struct { +} + +func (*awsRestjson1_deserializeOpCreateQuickResponse) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateQuickResponse) 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) @@ -1385,16 +1566,44 @@ func (m *awsRestjson1_deserializeOpDeleteContent) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteContent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateQuickResponse(response, &metadata) } - output := &DeleteContentOutput{} + output := &CreateQuickResponseOutput{} 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_deserializeOpDocumentCreateQuickResponseOutput(&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(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateQuickResponse(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)} @@ -1438,9 +1647,15 @@ func awsRestjson1_deserializeOpErrorDeleteContent(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -1454,14 +1669,50 @@ func awsRestjson1_deserializeOpErrorDeleteContent(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpDeleteContentAssociation struct { +func awsRestjson1_deserializeOpDocumentCreateQuickResponseOutput(v **CreateQuickResponseOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateQuickResponseOutput + if *v == nil { + sv = &CreateQuickResponseOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "quickResponse": + if err := awsRestjson1_deserializeDocumentQuickResponseData(&sv.QuickResponse, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteContentAssociation) ID() string { +type awsRestjson1_deserializeOpCreateSession struct { +} + +func (*awsRestjson1_deserializeOpCreateSession) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteContentAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateSession) 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) @@ -1479,16 +1730,44 @@ func (m *awsRestjson1_deserializeOpDeleteContentAssociation) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteContentAssociation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateSession(response, &metadata) } - output := &DeleteContentAssociationOutput{} + output := &CreateSessionOutput{} 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_deserializeOpDocumentCreateSessionOutput(&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(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteContentAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateSession(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)} @@ -1532,6 +1811,9 @@ func awsRestjson1_deserializeOpErrorDeleteContentAssociation(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1548,14 +1830,50 @@ func awsRestjson1_deserializeOpErrorDeleteContentAssociation(response *smithyhtt } } -type awsRestjson1_deserializeOpDeleteImportJob struct { +func awsRestjson1_deserializeOpDocumentCreateSessionOutput(v **CreateSessionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateSessionOutput + if *v == nil { + sv = &CreateSessionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "session": + if err := awsRestjson1_deserializeDocumentSessionData(&sv.Session, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteImportJob) ID() string { +type awsRestjson1_deserializeOpDeleteAIAgent struct { +} + +func (*awsRestjson1_deserializeOpDeleteAIAgent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteImportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAIAgent) 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) @@ -1573,16 +1891,16 @@ func (m *awsRestjson1_deserializeOpDeleteImportJob) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteImportJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAIAgent(response, &metadata) } - output := &DeleteImportJobOutput{} + output := &DeleteAIAgentOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteImportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAIAgent(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)} @@ -1626,12 +1944,12 @@ func awsRestjson1_deserializeOpErrorDeleteImportJob(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("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) @@ -1645,14 +1963,14 @@ func awsRestjson1_deserializeOpErrorDeleteImportJob(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDeleteKnowledgeBase struct { +type awsRestjson1_deserializeOpDeleteAIAgentVersion struct { } -func (*awsRestjson1_deserializeOpDeleteKnowledgeBase) ID() string { +func (*awsRestjson1_deserializeOpDeleteAIAgentVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAIAgentVersion) 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) @@ -1670,16 +1988,16 @@ 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_deserializeOpErrorDeleteAIAgentVersion(response, &metadata) } - output := &DeleteKnowledgeBaseOutput{} + output := &DeleteAIAgentVersionOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAIAgentVersion(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)} @@ -1729,6 +2047,9 @@ func awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response *smithyhttp.Res 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) @@ -1742,14 +2063,14 @@ func awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpDeleteQuickResponse struct { +type awsRestjson1_deserializeOpDeleteAIPrompt struct { } -func (*awsRestjson1_deserializeOpDeleteQuickResponse) ID() string { +func (*awsRestjson1_deserializeOpDeleteAIPrompt) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteQuickResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAIPrompt) 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) @@ -1767,16 +2088,16 @@ func (m *awsRestjson1_deserializeOpDeleteQuickResponse) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteQuickResponse(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAIPrompt(response, &metadata) } - output := &DeleteQuickResponseOutput{} + output := &DeleteAIPromptOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteQuickResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAIPrompt(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)} @@ -1823,6 +2144,9 @@ func awsRestjson1_deserializeOpErrorDeleteQuickResponse(response *smithyhttp.Res 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) @@ -1836,14 +2160,14 @@ func awsRestjson1_deserializeOpErrorDeleteQuickResponse(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpGetAssistant struct { +type awsRestjson1_deserializeOpDeleteAIPromptVersion struct { } -func (*awsRestjson1_deserializeOpGetAssistant) ID() string { +func (*awsRestjson1_deserializeOpDeleteAIPromptVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAssistant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAIPromptVersion) 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) @@ -1861,44 +2185,16 @@ func (m *awsRestjson1_deserializeOpGetAssistant) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAssistant(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAIPromptVersion(response, &metadata) } - output := &GetAssistantOutput{} + output := &DeleteAIPromptVersionOutput{} 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_deserializeOpDocumentGetAssistantOutput(&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(), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAssistant(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAIPromptVersion(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)} @@ -1942,9 +2238,15 @@ func awsRestjson1_deserializeOpErrorGetAssistant(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("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) @@ -1958,50 +2260,14 @@ func awsRestjson1_deserializeOpErrorGetAssistant(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetAssistantOutput(v **GetAssistantOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetAssistantOutput - if *v == nil { - sv = &GetAssistantOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "assistant": - if err := awsRestjson1_deserializeDocumentAssistantData(&sv.Assistant, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetAssistantAssociation struct { +type awsRestjson1_deserializeOpDeleteAssistant struct { } -func (*awsRestjson1_deserializeOpGetAssistantAssociation) ID() string { +func (*awsRestjson1_deserializeOpDeleteAssistant) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAssistantAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAssistant) 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) @@ -2019,44 +2285,16 @@ func (m *awsRestjson1_deserializeOpGetAssistantAssociation) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAssistantAssociation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAssistant(response, &metadata) } - output := &GetAssistantAssociationOutput{} + output := &DeleteAssistantOutput{} 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_deserializeOpDocumentGetAssistantAssociationOutput(&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(), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAssistantAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAssistant(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)} @@ -2116,50 +2354,14 @@ func awsRestjson1_deserializeOpErrorGetAssistantAssociation(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentGetAssistantAssociationOutput(v **GetAssistantAssociationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetAssistantAssociationOutput - if *v == nil { - sv = &GetAssistantAssociationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "assistantAssociation": - if err := awsRestjson1_deserializeDocumentAssistantAssociationData(&sv.AssistantAssociation, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetContent struct { +type awsRestjson1_deserializeOpDeleteAssistantAssociation struct { } -func (*awsRestjson1_deserializeOpGetContent) ID() string { +func (*awsRestjson1_deserializeOpDeleteAssistantAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAssistantAssociation) 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) @@ -2177,44 +2379,16 @@ func (m *awsRestjson1_deserializeOpGetContent) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetContent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(response, &metadata) } - output := &GetContentOutput{} + output := &DeleteAssistantAssociationOutput{} 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_deserializeOpDocumentGetContentOutput(&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(), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(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)} @@ -2274,50 +2448,14 @@ func awsRestjson1_deserializeOpErrorGetContent(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentGetContentOutput(v **GetContentOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetContentOutput - if *v == nil { - sv = &GetContentOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "content": - if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetContentAssociation struct { +type awsRestjson1_deserializeOpDeleteContent struct { } -func (*awsRestjson1_deserializeOpGetContentAssociation) ID() string { +func (*awsRestjson1_deserializeOpDeleteContent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetContentAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteContent) 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) @@ -2335,44 +2473,16 @@ func (m *awsRestjson1_deserializeOpGetContentAssociation) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetContentAssociation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteContent(response, &metadata) } - output := &GetContentAssociationOutput{} + output := &DeleteContentOutput{} out.Result = output - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) + span.End() + return out, metadata, err +} - 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_deserializeOpDocumentGetContentAssociationOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorGetContentAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteContent(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)} @@ -2432,50 +2542,14 @@ func awsRestjson1_deserializeOpErrorGetContentAssociation(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentGetContentAssociationOutput(v **GetContentAssociationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetContentAssociationOutput - if *v == nil { - sv = &GetContentAssociationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "contentAssociation": - if err := awsRestjson1_deserializeDocumentContentAssociationData(&sv.ContentAssociation, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetContentSummary struct { +type awsRestjson1_deserializeOpDeleteContentAssociation struct { } -func (*awsRestjson1_deserializeOpGetContentSummary) ID() string { +func (*awsRestjson1_deserializeOpDeleteContentAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetContentSummary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteContentAssociation) 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) @@ -2493,44 +2567,16 @@ func (m *awsRestjson1_deserializeOpGetContentSummary) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetContentSummary(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteContentAssociation(response, &metadata) } - output := &GetContentSummaryOutput{} + output := &DeleteContentAssociationOutput{} 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_deserializeOpDocumentGetContentSummaryOutput(&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(), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetContentSummary(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteContentAssociation(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)} @@ -2590,50 +2636,14 @@ func awsRestjson1_deserializeOpErrorGetContentSummary(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetContentSummaryOutput(v **GetContentSummaryOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetContentSummaryOutput - if *v == nil { - sv = &GetContentSummaryOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "contentSummary": - if err := awsRestjson1_deserializeDocumentContentSummary(&sv.ContentSummary, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetImportJob struct { +type awsRestjson1_deserializeOpDeleteImportJob struct { } -func (*awsRestjson1_deserializeOpGetImportJob) ID() string { +func (*awsRestjson1_deserializeOpDeleteImportJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetImportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteImportJob) 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) @@ -2651,44 +2661,16 @@ func (m *awsRestjson1_deserializeOpGetImportJob) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetImportJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteImportJob(response, &metadata) } - output := &GetImportJobOutput{} + output := &DeleteImportJobOutput{} 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_deserializeOpDocumentGetImportJobOutput(&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(), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetImportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteImportJob(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)} @@ -2732,6 +2714,9 @@ func awsRestjson1_deserializeOpErrorGetImportJob(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -2748,50 +2733,14 @@ func awsRestjson1_deserializeOpErrorGetImportJob(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetImportJobOutput(v **GetImportJobOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetImportJobOutput - if *v == nil { - sv = &GetImportJobOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "importJob": - if err := awsRestjson1_deserializeDocumentImportJobData(&sv.ImportJob, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetKnowledgeBase struct { +type awsRestjson1_deserializeOpDeleteKnowledgeBase struct { } -func (*awsRestjson1_deserializeOpGetKnowledgeBase) ID() string { +func (*awsRestjson1_deserializeOpDeleteKnowledgeBase) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetKnowledgeBase) 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) @@ -2809,44 +2758,113 @@ 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_deserializeOpErrorDeleteKnowledgeBase(response, &metadata) } - output := &GetKnowledgeBaseOutput{} + output := &DeleteKnowledgeBaseOutput{} out.Result = output + span.End() + return out, metadata, err +} + +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)} + } + 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(response.Body, 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{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return out, metadata, err + return err } - err = awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(&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(), + 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("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_deserializeOpDeleteQuickResponse struct { +} + +func (*awsRestjson1_deserializeOpDeleteQuickResponse) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteQuickResponse) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDeleteQuickResponse(response, &metadata) } + output := &DeleteQuickResponseOutput{} + out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteQuickResponse(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)} @@ -2906,50 +2924,14 @@ func awsRestjson1_deserializeOpErrorGetKnowledgeBase(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(v **GetKnowledgeBaseOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetKnowledgeBaseOutput - if *v == nil { - sv = &GetKnowledgeBaseOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "knowledgeBase": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetQuickResponse struct { +type awsRestjson1_deserializeOpGetAIAgent struct { } -func (*awsRestjson1_deserializeOpGetQuickResponse) ID() string { +func (*awsRestjson1_deserializeOpGetAIAgent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetQuickResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAIAgent) 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) @@ -2967,9 +2949,9 @@ func (m *awsRestjson1_deserializeOpGetQuickResponse) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetQuickResponse(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAIAgent(response, &metadata) } - output := &GetQuickResponseOutput{} + output := &GetAIAgentOutput{} out.Result = output var buff [1024]byte @@ -2990,7 +2972,7 @@ func (m *awsRestjson1_deserializeOpGetQuickResponse) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetQuickResponseOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAIAgentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3004,7 +2986,7 @@ func (m *awsRestjson1_deserializeOpGetQuickResponse) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetQuickResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAIAgent(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)} @@ -3051,6 +3033,9 @@ func awsRestjson1_deserializeOpErrorGetQuickResponse(response *smithyhttp.Respon 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) @@ -3064,7 +3049,7 @@ func awsRestjson1_deserializeOpErrorGetQuickResponse(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetQuickResponseOutput(v **GetQuickResponseOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAIAgentOutput(v **GetAIAgentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3077,20 +3062,33 @@ func awsRestjson1_deserializeOpDocumentGetQuickResponseOutput(v **GetQuickRespon return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetQuickResponseOutput + var sv *GetAIAgentOutput if *v == nil { - sv = &GetQuickResponseOutput{} + sv = &GetAIAgentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "quickResponse": - if err := awsRestjson1_deserializeDocumentQuickResponseData(&sv.QuickResponse, value); err != nil { + case "aiAgent": + if err := awsRestjson1_deserializeDocumentAIAgentData(&sv.AiAgent, value); err != nil { return err } + case "versionNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Version to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.VersionNumber = ptr.Int64(i64) + } + default: _, _ = key, value @@ -3100,14 +3098,14 @@ func awsRestjson1_deserializeOpDocumentGetQuickResponseOutput(v **GetQuickRespon return nil } -type awsRestjson1_deserializeOpGetRecommendations struct { +type awsRestjson1_deserializeOpGetAIPrompt struct { } -func (*awsRestjson1_deserializeOpGetRecommendations) ID() string { +func (*awsRestjson1_deserializeOpGetAIPrompt) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAIPrompt) 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) @@ -3125,9 +3123,9 @@ func (m *awsRestjson1_deserializeOpGetRecommendations) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetRecommendations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAIPrompt(response, &metadata) } - output := &GetRecommendationsOutput{} + output := &GetAIPromptOutput{} out.Result = output var buff [1024]byte @@ -3148,7 +3146,7 @@ func (m *awsRestjson1_deserializeOpGetRecommendations) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAIPromptOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3162,7 +3160,7 @@ func (m *awsRestjson1_deserializeOpGetRecommendations) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAIPrompt(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)} @@ -3209,6 +3207,9 @@ func awsRestjson1_deserializeOpErrorGetRecommendations(response *smithyhttp.Resp 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) @@ -3222,7 +3223,7 @@ func awsRestjson1_deserializeOpErrorGetRecommendations(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(v **GetRecommendationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAIPromptOutput(v **GetAIPromptOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3235,23 +3236,31 @@ func awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(v **GetRecommend return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetRecommendationsOutput + var sv *GetAIPromptOutput if *v == nil { - sv = &GetRecommendationsOutput{} + sv = &GetAIPromptOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "recommendations": - if err := awsRestjson1_deserializeDocumentRecommendationList(&sv.Recommendations, value); err != nil { + case "aiPrompt": + if err := awsRestjson1_deserializeDocumentAIPromptData(&sv.AiPrompt, value); err != nil { return err } - case "triggers": - if err := awsRestjson1_deserializeDocumentRecommendationTriggerList(&sv.Triggers, value); err != nil { - return err + case "versionNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Version to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.VersionNumber = ptr.Int64(i64) } default: @@ -3263,14 +3272,14 @@ func awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(v **GetRecommend return nil } -type awsRestjson1_deserializeOpGetSession struct { +type awsRestjson1_deserializeOpGetAssistant struct { } -func (*awsRestjson1_deserializeOpGetSession) ID() string { +func (*awsRestjson1_deserializeOpGetAssistant) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAssistant) 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) @@ -3288,9 +3297,9 @@ func (m *awsRestjson1_deserializeOpGetSession) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetSession(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAssistant(response, &metadata) } - output := &GetSessionOutput{} + output := &GetAssistantOutput{} out.Result = output var buff [1024]byte @@ -3311,7 +3320,7 @@ func (m *awsRestjson1_deserializeOpGetSession) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetSessionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAssistantOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3325,7 +3334,7 @@ func (m *awsRestjson1_deserializeOpGetSession) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetSession(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAssistant(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)} @@ -3385,7 +3394,7 @@ func awsRestjson1_deserializeOpErrorGetSession(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentGetSessionOutput(v **GetSessionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAssistantOutput(v **GetAssistantOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3398,17 +3407,17 @@ func awsRestjson1_deserializeOpDocumentGetSessionOutput(v **GetSessionOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetSessionOutput + var sv *GetAssistantOutput if *v == nil { - sv = &GetSessionOutput{} + sv = &GetAssistantOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "session": - if err := awsRestjson1_deserializeDocumentSessionData(&sv.Session, value); err != nil { + case "assistant": + if err := awsRestjson1_deserializeDocumentAssistantData(&sv.Assistant, value); err != nil { return err } @@ -3421,14 +3430,14 @@ func awsRestjson1_deserializeOpDocumentGetSessionOutput(v **GetSessionOutput, va return nil } -type awsRestjson1_deserializeOpListAssistantAssociations struct { +type awsRestjson1_deserializeOpGetAssistantAssociation struct { } -func (*awsRestjson1_deserializeOpListAssistantAssociations) ID() string { +func (*awsRestjson1_deserializeOpGetAssistantAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAssistantAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAssistantAssociation) 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) @@ -3446,9 +3455,9 @@ func (m *awsRestjson1_deserializeOpListAssistantAssociations) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssistantAssociations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAssistantAssociation(response, &metadata) } - output := &ListAssistantAssociationsOutput{} + output := &GetAssistantAssociationOutput{} out.Result = output var buff [1024]byte @@ -3469,7 +3478,7 @@ func (m *awsRestjson1_deserializeOpListAssistantAssociations) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAssistantAssociationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3483,7 +3492,7 @@ func (m *awsRestjson1_deserializeOpListAssistantAssociations) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAssistantAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAssistantAssociation(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)} @@ -3543,7 +3552,7 @@ func awsRestjson1_deserializeOpErrorListAssistantAssociations(response *smithyht } } -func awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(v **ListAssistantAssociationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAssistantAssociationOutput(v **GetAssistantAssociationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3556,29 +3565,20 @@ func awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(v **ListA return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAssistantAssociationsOutput + var sv *GetAssistantAssociationOutput if *v == nil { - sv = &ListAssistantAssociationsOutput{} + sv = &GetAssistantAssociationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assistantAssociationSummaries": - if err := awsRestjson1_deserializeDocumentAssistantAssociationSummaryList(&sv.AssistantAssociationSummaries, value); err != nil { + case "assistantAssociation": + if err := awsRestjson1_deserializeDocumentAssistantAssociationData(&sv.AssistantAssociation, 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 @@ -3588,14 +3588,14 @@ func awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(v **ListA return nil } -type awsRestjson1_deserializeOpListAssistants struct { +type awsRestjson1_deserializeOpGetContent struct { } -func (*awsRestjson1_deserializeOpListAssistants) ID() string { +func (*awsRestjson1_deserializeOpGetContent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAssistants) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetContent) 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) @@ -3613,9 +3613,9 @@ func (m *awsRestjson1_deserializeOpListAssistants) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssistants(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetContent(response, &metadata) } - output := &ListAssistantsOutput{} + output := &GetContentOutput{} out.Result = output var buff [1024]byte @@ -3636,7 +3636,7 @@ func (m *awsRestjson1_deserializeOpListAssistants) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAssistantsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetContentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3650,7 +3650,7 @@ func (m *awsRestjson1_deserializeOpListAssistants) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAssistants(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetContent(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)} @@ -3694,6 +3694,9 @@ func awsRestjson1_deserializeOpErrorListAssistants(response *smithyhttp.Response case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -3707,7 +3710,7 @@ func awsRestjson1_deserializeOpErrorListAssistants(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListAssistantsOutput(v **ListAssistantsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetContentOutput(v **GetContentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3720,29 +3723,20 @@ func awsRestjson1_deserializeOpDocumentListAssistantsOutput(v **ListAssistantsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAssistantsOutput + var sv *GetContentOutput if *v == nil { - sv = &ListAssistantsOutput{} + sv = &GetContentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assistantSummaries": - if err := awsRestjson1_deserializeDocumentAssistantList(&sv.AssistantSummaries, value); err != nil { + case "content": + if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, 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 @@ -3752,14 +3746,14 @@ func awsRestjson1_deserializeOpDocumentListAssistantsOutput(v **ListAssistantsOu return nil } -type awsRestjson1_deserializeOpListContentAssociations struct { +type awsRestjson1_deserializeOpGetContentAssociation struct { } -func (*awsRestjson1_deserializeOpListContentAssociations) ID() string { +func (*awsRestjson1_deserializeOpGetContentAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListContentAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetContentAssociation) 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) @@ -3777,9 +3771,9 @@ func (m *awsRestjson1_deserializeOpListContentAssociations) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListContentAssociations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetContentAssociation(response, &metadata) } - output := &ListContentAssociationsOutput{} + output := &GetContentAssociationOutput{} out.Result = output var buff [1024]byte @@ -3800,7 +3794,7 @@ func (m *awsRestjson1_deserializeOpListContentAssociations) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListContentAssociationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetContentAssociationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3814,7 +3808,7 @@ func (m *awsRestjson1_deserializeOpListContentAssociations) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorListContentAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetContentAssociation(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)} @@ -3874,7 +3868,7 @@ func awsRestjson1_deserializeOpErrorListContentAssociations(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListContentAssociationsOutput(v **ListContentAssociationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetContentAssociationOutput(v **GetContentAssociationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3887,29 +3881,20 @@ func awsRestjson1_deserializeOpDocumentListContentAssociationsOutput(v **ListCon return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListContentAssociationsOutput + var sv *GetContentAssociationOutput if *v == nil { - sv = &ListContentAssociationsOutput{} + sv = &GetContentAssociationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "contentAssociationSummaries": - if err := awsRestjson1_deserializeDocumentContentAssociationSummaryList(&sv.ContentAssociationSummaries, value); err != nil { + case "contentAssociation": + if err := awsRestjson1_deserializeDocumentContentAssociationData(&sv.ContentAssociation, 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 @@ -3919,14 +3904,14 @@ func awsRestjson1_deserializeOpDocumentListContentAssociationsOutput(v **ListCon return nil } -type awsRestjson1_deserializeOpListContents struct { +type awsRestjson1_deserializeOpGetContentSummary struct { } -func (*awsRestjson1_deserializeOpListContents) ID() string { +func (*awsRestjson1_deserializeOpGetContentSummary) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListContents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetContentSummary) 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) @@ -3944,9 +3929,9 @@ func (m *awsRestjson1_deserializeOpListContents) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListContents(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetContentSummary(response, &metadata) } - output := &ListContentsOutput{} + output := &GetContentSummaryOutput{} out.Result = output var buff [1024]byte @@ -3967,7 +3952,7 @@ func (m *awsRestjson1_deserializeOpListContents) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListContentsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetContentSummaryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3981,7 +3966,7 @@ func (m *awsRestjson1_deserializeOpListContents) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListContents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetContentSummary(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)} @@ -4041,7 +4026,7 @@ func awsRestjson1_deserializeOpErrorListContents(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListContentsOutput(v **ListContentsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetContentSummaryOutput(v **GetContentSummaryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4054,29 +4039,20 @@ func awsRestjson1_deserializeOpDocumentListContentsOutput(v **ListContentsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListContentsOutput + var sv *GetContentSummaryOutput if *v == nil { - sv = &ListContentsOutput{} + sv = &GetContentSummaryOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "contentSummaries": - if err := awsRestjson1_deserializeDocumentContentSummaryList(&sv.ContentSummaries, value); err != nil { + case "contentSummary": + if err := awsRestjson1_deserializeDocumentContentSummary(&sv.ContentSummary, 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 @@ -4086,14 +4062,14 @@ func awsRestjson1_deserializeOpDocumentListContentsOutput(v **ListContentsOutput return nil } -type awsRestjson1_deserializeOpListImportJobs struct { +type awsRestjson1_deserializeOpGetImportJob struct { } -func (*awsRestjson1_deserializeOpListImportJobs) ID() string { +func (*awsRestjson1_deserializeOpGetImportJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetImportJob) 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) @@ -4111,9 +4087,9 @@ func (m *awsRestjson1_deserializeOpListImportJobs) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImportJobs(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetImportJob(response, &metadata) } - output := &ListImportJobsOutput{} + output := &GetImportJobOutput{} out.Result = output var buff [1024]byte @@ -4134,7 +4110,7 @@ func (m *awsRestjson1_deserializeOpListImportJobs) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImportJobsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetImportJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4148,7 +4124,7 @@ func (m *awsRestjson1_deserializeOpListImportJobs) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetImportJob(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)} @@ -4192,6 +4168,9 @@ func awsRestjson1_deserializeOpErrorListImportJobs(response *smithyhttp.Response case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -4205,7 +4184,7 @@ func awsRestjson1_deserializeOpErrorListImportJobs(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListImportJobsOutput(v **ListImportJobsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetImportJobOutput(v **GetImportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4218,29 +4197,20 @@ func awsRestjson1_deserializeOpDocumentListImportJobsOutput(v **ListImportJobsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImportJobsOutput + var sv *GetImportJobOutput if *v == nil { - sv = &ListImportJobsOutput{} + sv = &GetImportJobOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "importJobSummaries": - if err := awsRestjson1_deserializeDocumentImportJobList(&sv.ImportJobSummaries, value); err != nil { + case "importJob": + if err := awsRestjson1_deserializeDocumentImportJobData(&sv.ImportJob, value); err != nil { return err } - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -4250,14 +4220,14 @@ func awsRestjson1_deserializeOpDocumentListImportJobsOutput(v **ListImportJobsOu return nil } -type awsRestjson1_deserializeOpListKnowledgeBases struct { +type awsRestjson1_deserializeOpGetKnowledgeBase struct { } -func (*awsRestjson1_deserializeOpListKnowledgeBases) ID() string { +func (*awsRestjson1_deserializeOpGetKnowledgeBase) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListKnowledgeBases) 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) @@ -4275,9 +4245,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_deserializeOpErrorGetKnowledgeBase(response, &metadata) } - output := &ListKnowledgeBasesOutput{} + output := &GetKnowledgeBaseOutput{} out.Result = output var buff [1024]byte @@ -4298,7 +4268,7 @@ func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4312,7 +4282,7 @@ func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListKnowledgeBases(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)} @@ -4356,6 +4326,9 @@ func awsRestjson1_deserializeOpErrorListKnowledgeBases(response *smithyhttp.Resp case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -4369,7 +4342,7 @@ func awsRestjson1_deserializeOpErrorListKnowledgeBases(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledgeBasesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(v **GetKnowledgeBaseOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4382,29 +4355,20 @@ func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledg return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListKnowledgeBasesOutput + var sv *GetKnowledgeBaseOutput if *v == nil { - sv = &ListKnowledgeBasesOutput{} + sv = &GetKnowledgeBaseOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBaseSummaries": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseList(&sv.KnowledgeBaseSummaries, value); err != nil { + case "knowledgeBase": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, value); err != nil { return err } - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -4414,14 +4378,14 @@ func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledg return nil } -type awsRestjson1_deserializeOpListQuickResponses struct { +type awsRestjson1_deserializeOpGetQuickResponse struct { } -func (*awsRestjson1_deserializeOpListQuickResponses) ID() string { +func (*awsRestjson1_deserializeOpGetQuickResponse) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListQuickResponses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetQuickResponse) 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) @@ -4439,9 +4403,9 @@ func (m *awsRestjson1_deserializeOpListQuickResponses) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListQuickResponses(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetQuickResponse(response, &metadata) } - output := &ListQuickResponsesOutput{} + output := &GetQuickResponseOutput{} out.Result = output var buff [1024]byte @@ -4462,7 +4426,7 @@ func (m *awsRestjson1_deserializeOpListQuickResponses) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListQuickResponsesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetQuickResponseOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4476,7 +4440,7 @@ func (m *awsRestjson1_deserializeOpListQuickResponses) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListQuickResponses(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetQuickResponse(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)} @@ -4536,7 +4500,7 @@ func awsRestjson1_deserializeOpErrorListQuickResponses(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListQuickResponsesOutput(v **ListQuickResponsesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetQuickResponseOutput(v **GetQuickResponseOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4549,26 +4513,17 @@ func awsRestjson1_deserializeOpDocumentListQuickResponsesOutput(v **ListQuickRes return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListQuickResponsesOutput + var sv *GetQuickResponseOutput if *v == nil { - sv = &ListQuickResponsesOutput{} + sv = &GetQuickResponseOutput{} } 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 NonEmptyString to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "quickResponseSummaries": - if err := awsRestjson1_deserializeDocumentQuickResponseSummaryList(&sv.QuickResponseSummaries, value); err != nil { + case "quickResponse": + if err := awsRestjson1_deserializeDocumentQuickResponseData(&sv.QuickResponse, value); err != nil { return err } @@ -4581,14 +4536,14 @@ func awsRestjson1_deserializeOpDocumentListQuickResponsesOutput(v **ListQuickRes return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpGetRecommendations struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpGetRecommendations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetRecommendations) 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) @@ -4606,9 +4561,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_deserializeOpErrorGetRecommendations(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &GetRecommendationsOutput{} out.Result = output var buff [1024]byte @@ -4629,7 +4584,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4643,7 +4598,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetRecommendations(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)} @@ -4684,9 +4639,15 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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, @@ -4697,7 +4658,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(v **GetRecommendationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4710,17 +4671,22 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *GetRecommendationsOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &GetRecommendationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + case "recommendations": + if err := awsRestjson1_deserializeDocumentRecommendationList(&sv.Recommendations, value); err != nil { + return err + } + + case "triggers": + if err := awsRestjson1_deserializeDocumentRecommendationTriggerList(&sv.Triggers, value); err != nil { return err } @@ -4733,14 +4699,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpNotifyRecommendationsReceived struct { +type awsRestjson1_deserializeOpGetSession struct { } -func (*awsRestjson1_deserializeOpNotifyRecommendationsReceived) ID() string { +func (*awsRestjson1_deserializeOpGetSession) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpNotifyRecommendationsReceived) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetSession) 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) @@ -4758,9 +4724,9 @@ func (m *awsRestjson1_deserializeOpNotifyRecommendationsReceived) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorNotifyRecommendationsReceived(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetSession(response, &metadata) } - output := &NotifyRecommendationsReceivedOutput{} + output := &GetSessionOutput{} out.Result = output var buff [1024]byte @@ -4781,7 +4747,7 @@ func (m *awsRestjson1_deserializeOpNotifyRecommendationsReceived) HandleDeserial return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentNotifyRecommendationsReceivedOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetSessionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4795,7 +4761,7 @@ func (m *awsRestjson1_deserializeOpNotifyRecommendationsReceived) HandleDeserial return out, metadata, err } -func awsRestjson1_deserializeOpErrorNotifyRecommendationsReceived(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetSession(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)} @@ -4855,7 +4821,7 @@ func awsRestjson1_deserializeOpErrorNotifyRecommendationsReceived(response *smit } } -func awsRestjson1_deserializeOpDocumentNotifyRecommendationsReceivedOutput(v **NotifyRecommendationsReceivedOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetSessionOutput(v **GetSessionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4868,22 +4834,17 @@ func awsRestjson1_deserializeOpDocumentNotifyRecommendationsReceivedOutput(v **N return fmt.Errorf("unexpected JSON type %v", value) } - var sv *NotifyRecommendationsReceivedOutput + var sv *GetSessionOutput if *v == nil { - sv = &NotifyRecommendationsReceivedOutput{} + sv = &GetSessionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "errors": - if err := awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedErrorList(&sv.Errors, value); err != nil { - return err - } - - case "recommendationIds": - if err := awsRestjson1_deserializeDocumentRecommendationIdList(&sv.RecommendationIds, value); err != nil { + case "session": + if err := awsRestjson1_deserializeDocumentSessionData(&sv.Session, value); err != nil { return err } @@ -4896,14 +4857,14 @@ func awsRestjson1_deserializeOpDocumentNotifyRecommendationsReceivedOutput(v **N return nil } -type awsRestjson1_deserializeOpPutFeedback struct { +type awsRestjson1_deserializeOpListAIAgents struct { } -func (*awsRestjson1_deserializeOpPutFeedback) ID() string { +func (*awsRestjson1_deserializeOpListAIAgents) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutFeedback) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAIAgents) 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) @@ -4921,9 +4882,9 @@ func (m *awsRestjson1_deserializeOpPutFeedback) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutFeedback(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAIAgents(response, &metadata) } - output := &PutFeedbackOutput{} + output := &ListAIAgentsOutput{} out.Result = output var buff [1024]byte @@ -4944,7 +4905,7 @@ func (m *awsRestjson1_deserializeOpPutFeedback) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutFeedbackOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAIAgentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4958,7 +4919,7 @@ func (m *awsRestjson1_deserializeOpPutFeedback) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutFeedback(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAIAgents(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)} @@ -5005,6 +4966,9 @@ func awsRestjson1_deserializeOpErrorPutFeedback(response *smithyhttp.Response, m 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) @@ -5018,7 +4982,7 @@ func awsRestjson1_deserializeOpErrorPutFeedback(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentPutFeedbackOutput(v **PutFeedbackOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAIAgentsOutput(v **ListAIAgentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5031,54 +4995,27 @@ func awsRestjson1_deserializeOpDocumentPutFeedbackOutput(v **PutFeedbackOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutFeedbackOutput + var sv *ListAIAgentsOutput if *v == nil { - sv = &PutFeedbackOutput{} + sv = &ListAIAgentsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assistantArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UuidOrArn to be of type string, got %T instead", value) - } - sv.AssistantArn = ptr.String(jtv) + case "aiAgentSummaries": + if err := awsRestjson1_deserializeDocumentAIAgentSummaryList(&sv.AiAgentSummaries, value); err != nil { + return err } - case "assistantId": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.AssistantId = ptr.String(jtv) - } - - case "contentFeedback": - if err := awsRestjson1_deserializeDocumentContentFeedbackData(&sv.ContentFeedback, value); err != nil { - return err - } - - case "targetId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) - } - sv.TargetId = ptr.String(jtv) - } - - case "targetType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TargetType to be of type string, got %T instead", value) - } - sv.TargetType = types.TargetType(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -5090,14 +5027,14 @@ func awsRestjson1_deserializeOpDocumentPutFeedbackOutput(v **PutFeedbackOutput, return nil } -type awsRestjson1_deserializeOpQueryAssistant struct { +type awsRestjson1_deserializeOpListAIAgentVersions struct { } -func (*awsRestjson1_deserializeOpQueryAssistant) ID() string { +func (*awsRestjson1_deserializeOpListAIAgentVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpQueryAssistant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAIAgentVersions) 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) @@ -5115,9 +5052,9 @@ func (m *awsRestjson1_deserializeOpQueryAssistant) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorQueryAssistant(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAIAgentVersions(response, &metadata) } - output := &QueryAssistantOutput{} + output := &ListAIAgentVersionsOutput{} out.Result = output var buff [1024]byte @@ -5138,7 +5075,7 @@ func (m *awsRestjson1_deserializeOpQueryAssistant) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentQueryAssistantOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAIAgentVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5152,7 +5089,7 @@ func (m *awsRestjson1_deserializeOpQueryAssistant) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorQueryAssistant(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAIAgentVersions(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)} @@ -5196,12 +5133,12 @@ func awsRestjson1_deserializeOpErrorQueryAssistant(response *smithyhttp.Response case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("RequestTimeoutException", errorCode): - return awsRestjson1_deserializeErrorRequestTimeoutException(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) @@ -5215,7 +5152,7 @@ func awsRestjson1_deserializeOpErrorQueryAssistant(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentQueryAssistantOutput(v **QueryAssistantOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAIAgentVersionsOutput(v **ListAIAgentVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5228,15 +5165,20 @@ func awsRestjson1_deserializeOpDocumentQueryAssistantOutput(v **QueryAssistantOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *QueryAssistantOutput + var sv *ListAIAgentVersionsOutput if *v == nil { - sv = &QueryAssistantOutput{} + sv = &ListAIAgentVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "aiAgentVersionSummaries": + if err := awsRestjson1_deserializeDocumentAIAgentVersionSummariesList(&sv.AiAgentVersionSummaries, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -5246,11 +5188,6 @@ func awsRestjson1_deserializeOpDocumentQueryAssistantOutput(v **QueryAssistantOu sv.NextToken = ptr.String(jtv) } - case "results": - if err := awsRestjson1_deserializeDocumentQueryResultsList(&sv.Results, value); err != nil { - return err - } - default: _, _ = key, value @@ -5260,14 +5197,14 @@ func awsRestjson1_deserializeOpDocumentQueryAssistantOutput(v **QueryAssistantOu return nil } -type awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri struct { +type awsRestjson1_deserializeOpListAIPrompts struct { } -func (*awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri) ID() string { +func (*awsRestjson1_deserializeOpListAIPrompts) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAIPrompts) 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) @@ -5285,16 +5222,44 @@ func (m *awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAIPrompts(response, &metadata) } - output := &RemoveKnowledgeBaseTemplateUriOutput{} + output := &ListAIPromptsOutput{} 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_deserializeOpDocumentListAIPromptsOutput(&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(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAIPrompts(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)} @@ -5341,6 +5306,9 @@ func awsRestjson1_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(response *smi 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) @@ -5354,14 +5322,59 @@ func awsRestjson1_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(response *smi } } -type awsRestjson1_deserializeOpSearchContent struct { +func awsRestjson1_deserializeOpDocumentListAIPromptsOutput(v **ListAIPromptsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListAIPromptsOutput + if *v == nil { + sv = &ListAIPromptsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aiPromptSummaries": + if err := awsRestjson1_deserializeDocumentAIPromptSummaryList(&sv.AiPromptSummaries, 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_deserializeOpSearchContent) ID() string { +type awsRestjson1_deserializeOpListAIPromptVersions struct { +} + +func (*awsRestjson1_deserializeOpListAIPromptVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAIPromptVersions) 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) @@ -5379,9 +5392,9 @@ func (m *awsRestjson1_deserializeOpSearchContent) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchContent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAIPromptVersions(response, &metadata) } - output := &SearchContentOutput{} + output := &ListAIPromptVersionsOutput{} out.Result = output var buff [1024]byte @@ -5402,7 +5415,7 @@ func (m *awsRestjson1_deserializeOpSearchContent) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchContentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAIPromptVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5416,7 +5429,7 @@ func (m *awsRestjson1_deserializeOpSearchContent) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAIPromptVersions(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)} @@ -5463,6 +5476,9 @@ func awsRestjson1_deserializeOpErrorSearchContent(response *smithyhttp.Response, 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) @@ -5476,7 +5492,7 @@ func awsRestjson1_deserializeOpErrorSearchContent(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentSearchContentOutput(v **SearchContentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAIPromptVersionsOutput(v **ListAIPromptVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5489,17 +5505,17 @@ func awsRestjson1_deserializeOpDocumentSearchContentOutput(v **SearchContentOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchContentOutput + var sv *ListAIPromptVersionsOutput if *v == nil { - sv = &SearchContentOutput{} + sv = &ListAIPromptVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "contentSummaries": - if err := awsRestjson1_deserializeDocumentContentSummaryList(&sv.ContentSummaries, value); err != nil { + case "aiPromptVersionSummaries": + if err := awsRestjson1_deserializeDocumentAIPromptVersionSummariesList(&sv.AiPromptVersionSummaries, value); err != nil { return err } @@ -5521,14 +5537,14 @@ func awsRestjson1_deserializeOpDocumentSearchContentOutput(v **SearchContentOutp return nil } -type awsRestjson1_deserializeOpSearchQuickResponses struct { +type awsRestjson1_deserializeOpListAssistantAssociations struct { } -func (*awsRestjson1_deserializeOpSearchQuickResponses) ID() string { +func (*awsRestjson1_deserializeOpListAssistantAssociations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchQuickResponses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAssistantAssociations) 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) @@ -5546,9 +5562,9 @@ func (m *awsRestjson1_deserializeOpSearchQuickResponses) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchQuickResponses(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAssistantAssociations(response, &metadata) } - output := &SearchQuickResponsesOutput{} + output := &ListAssistantAssociationsOutput{} out.Result = output var buff [1024]byte @@ -5569,7 +5585,7 @@ func (m *awsRestjson1_deserializeOpSearchQuickResponses) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchQuickResponsesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5583,7 +5599,7 @@ func (m *awsRestjson1_deserializeOpSearchQuickResponses) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchQuickResponses(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAssistantAssociations(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)} @@ -5627,9 +5643,6 @@ func awsRestjson1_deserializeOpErrorSearchQuickResponses(response *smithyhttp.Re case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("RequestTimeoutException", errorCode): - return awsRestjson1_deserializeErrorRequestTimeoutException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -5646,7 +5659,7 @@ func awsRestjson1_deserializeOpErrorSearchQuickResponses(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentSearchQuickResponsesOutput(v **SearchQuickResponsesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(v **ListAssistantAssociationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5659,29 +5672,29 @@ func awsRestjson1_deserializeOpDocumentSearchQuickResponsesOutput(v **SearchQuic return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchQuickResponsesOutput + var sv *ListAssistantAssociationsOutput if *v == nil { - sv = &SearchQuickResponsesOutput{} + sv = &ListAssistantAssociationsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "assistantAssociationSummaries": + if err := awsRestjson1_deserializeDocumentAssistantAssociationSummaryList(&sv.AssistantAssociationSummaries, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } - case "results": - if err := awsRestjson1_deserializeDocumentQuickResponseSearchResultsList(&sv.Results, value); err != nil { - return err - } - default: _, _ = key, value @@ -5691,14 +5704,14 @@ func awsRestjson1_deserializeOpDocumentSearchQuickResponsesOutput(v **SearchQuic return nil } -type awsRestjson1_deserializeOpSearchSessions struct { +type awsRestjson1_deserializeOpListAssistants struct { } -func (*awsRestjson1_deserializeOpSearchSessions) ID() string { +func (*awsRestjson1_deserializeOpListAssistants) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchSessions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAssistants) 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) @@ -5716,9 +5729,9 @@ func (m *awsRestjson1_deserializeOpSearchSessions) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchSessions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAssistants(response, &metadata) } - output := &SearchSessionsOutput{} + output := &ListAssistantsOutput{} out.Result = output var buff [1024]byte @@ -5739,7 +5752,7 @@ func (m *awsRestjson1_deserializeOpSearchSessions) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchSessionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssistantsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5753,7 +5766,7 @@ func (m *awsRestjson1_deserializeOpSearchSessions) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchSessions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAssistants(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)} @@ -5797,9 +5810,6 @@ func awsRestjson1_deserializeOpErrorSearchSessions(response *smithyhttp.Response case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -5813,7 +5823,7 @@ func awsRestjson1_deserializeOpErrorSearchSessions(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentSearchSessionsOutput(v **SearchSessionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssistantsOutput(v **ListAssistantsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5826,15 +5836,20 @@ func awsRestjson1_deserializeOpDocumentSearchSessionsOutput(v **SearchSessionsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchSessionsOutput + var sv *ListAssistantsOutput if *v == nil { - sv = &SearchSessionsOutput{} + sv = &ListAssistantsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "assistantSummaries": + if err := awsRestjson1_deserializeDocumentAssistantList(&sv.AssistantSummaries, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -5844,11 +5859,6 @@ func awsRestjson1_deserializeOpDocumentSearchSessionsOutput(v **SearchSessionsOu sv.NextToken = ptr.String(jtv) } - case "sessionSummaries": - if err := awsRestjson1_deserializeDocumentSessionSummaries(&sv.SessionSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -5858,14 +5868,14 @@ func awsRestjson1_deserializeOpDocumentSearchSessionsOutput(v **SearchSessionsOu return nil } -type awsRestjson1_deserializeOpStartContentUpload struct { +type awsRestjson1_deserializeOpListContentAssociations struct { } -func (*awsRestjson1_deserializeOpStartContentUpload) ID() string { +func (*awsRestjson1_deserializeOpListContentAssociations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartContentUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListContentAssociations) 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) @@ -5883,9 +5893,9 @@ func (m *awsRestjson1_deserializeOpStartContentUpload) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartContentUpload(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListContentAssociations(response, &metadata) } - output := &StartContentUploadOutput{} + output := &ListContentAssociationsOutput{} out.Result = output var buff [1024]byte @@ -5906,7 +5916,7 @@ func (m *awsRestjson1_deserializeOpStartContentUpload) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartContentUploadOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListContentAssociationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5920,7 +5930,7 @@ func (m *awsRestjson1_deserializeOpStartContentUpload) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartContentUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListContentAssociations(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)} @@ -5980,7 +5990,7 @@ func awsRestjson1_deserializeOpErrorStartContentUpload(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentStartContentUploadOutput(v **StartContentUploadOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListContentAssociationsOutput(v **ListContentAssociationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5993,71 +6003,46 @@ func awsRestjson1_deserializeOpDocumentStartContentUploadOutput(v **StartContent return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartContentUploadOutput + var sv *ListContentAssociationsOutput if *v == nil { - sv = &StartContentUploadOutput{} + sv = &ListContentAssociationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "headersToInclude": - if err := awsRestjson1_deserializeDocumentHeaders(&sv.HeadersToInclude, value); err != nil { + case "contentAssociationSummaries": + if err := awsRestjson1_deserializeDocumentContentAssociationSummaryList(&sv.ContentAssociationSummaries, value); err != nil { return err } - case "uploadId": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected UploadId to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.UploadId = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "url": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Url to be of type string, got %T instead", value) - } - sv.Url = ptr.String(jtv) - } + default: + _, _ = key, value - case "urlExpiry": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UrlExpiry = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + } + *v = sv + return nil +} - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpStartImportJob struct { +type awsRestjson1_deserializeOpListContents struct { } -func (*awsRestjson1_deserializeOpStartImportJob) ID() string { +func (*awsRestjson1_deserializeOpListContents) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartImportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListContents) 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) @@ -6075,9 +6060,9 @@ func (m *awsRestjson1_deserializeOpStartImportJob) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartImportJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListContents(response, &metadata) } - output := &StartImportJobOutput{} + output := &ListContentsOutput{} out.Result = output var buff [1024]byte @@ -6098,7 +6083,7 @@ func (m *awsRestjson1_deserializeOpStartImportJob) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartImportJobOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListContentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6112,7 +6097,7 @@ func (m *awsRestjson1_deserializeOpStartImportJob) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartImportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListContents(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)} @@ -6156,15 +6141,9 @@ func awsRestjson1_deserializeOpErrorStartImportJob(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -6178,7 +6157,7 @@ func awsRestjson1_deserializeOpErrorStartImportJob(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentStartImportJobOutput(v **StartImportJobOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListContentsOutput(v **ListContentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6191,20 +6170,29 @@ func awsRestjson1_deserializeOpDocumentStartImportJobOutput(v **StartImportJobOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartImportJobOutput + var sv *ListContentsOutput if *v == nil { - sv = &StartImportJobOutput{} + sv = &ListContentsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "importJob": - if err := awsRestjson1_deserializeDocumentImportJobData(&sv.ImportJob, value); err != nil { + case "contentSummaries": + if err := awsRestjson1_deserializeDocumentContentSummaryList(&sv.ContentSummaries, 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 @@ -6214,14 +6202,14 @@ func awsRestjson1_deserializeOpDocumentStartImportJobOutput(v **StartImportJobOu return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpListImportJobs struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpListImportJobs) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImportJobs) 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) @@ -6239,107 +6227,44 @@ 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_deserializeOpErrorListImportJobs(response, &metadata) } - output := &TagResourceOutput{} + output := &ListImportJobsOutput{} out.Result = output - span.End() - 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) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { + 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 - } - - 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("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyTagsException", errorCode): - return awsRestjson1_deserializeErrorTooManyTagsException(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 } - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - 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) + err = awsRestjson1_deserializeOpDocumentListImportJobsOutput(&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(), + } } - output := &UntagResourceOutput{} - out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImportJobs(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)} @@ -6380,8 +6305,11 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } switch { - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -6393,14 +6321,59 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateContent struct { +func awsRestjson1_deserializeOpDocumentListImportJobsOutput(v **ListImportJobsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListImportJobsOutput + if *v == nil { + sv = &ListImportJobsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "importJobSummaries": + if err := awsRestjson1_deserializeDocumentImportJobList(&sv.ImportJobSummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateContent) ID() string { +type awsRestjson1_deserializeOpListKnowledgeBases struct { +} + +func (*awsRestjson1_deserializeOpListKnowledgeBases) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -6418,9 +6391,9 @@ func (m *awsRestjson1_deserializeOpUpdateContent) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateContent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListKnowledgeBases(response, &metadata) } - output := &UpdateContentOutput{} + output := &ListKnowledgeBasesOutput{} out.Result = output var buff [1024]byte @@ -6441,7 +6414,7 @@ func (m *awsRestjson1_deserializeOpUpdateContent) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateContentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6455,7 +6428,7 @@ func (m *awsRestjson1_deserializeOpUpdateContent) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -6499,12 +6472,6 @@ func awsRestjson1_deserializeOpErrorUpdateContent(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("PreconditionFailedException", errorCode): - return awsRestjson1_deserializeErrorPreconditionFailedException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -6518,7 +6485,7 @@ func awsRestjson1_deserializeOpErrorUpdateContent(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdateContentOutput(v **UpdateContentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledgeBasesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6531,20 +6498,29 @@ func awsRestjson1_deserializeOpDocumentUpdateContentOutput(v **UpdateContentOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateContentOutput + var sv *ListKnowledgeBasesOutput if *v == nil { - sv = &UpdateContentOutput{} + sv = &ListKnowledgeBasesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "content": - if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, value); err != nil { + case "knowledgeBaseSummaries": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseList(&sv.KnowledgeBaseSummaries, value); err != nil { return err } + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -6554,14 +6530,14 @@ func awsRestjson1_deserializeOpDocumentUpdateContentOutput(v **UpdateContentOutp return nil } -type awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri struct { +type awsRestjson1_deserializeOpListQuickResponses struct { } -func (*awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) ID() string { +func (*awsRestjson1_deserializeOpListQuickResponses) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListQuickResponses) 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) @@ -6579,9 +6555,9 @@ func (m *awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateKnowledgeBaseTemplateUri(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListQuickResponses(response, &metadata) } - output := &UpdateKnowledgeBaseTemplateUriOutput{} + output := &ListQuickResponsesOutput{} out.Result = output var buff [1024]byte @@ -6602,7 +6578,7 @@ func (m *awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListQuickResponsesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6616,7 +6592,7 @@ func (m *awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateKnowledgeBaseTemplateUri(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListQuickResponses(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)} @@ -6676,7 +6652,7 @@ func awsRestjson1_deserializeOpErrorUpdateKnowledgeBaseTemplateUri(response *smi } } -func awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(v **UpdateKnowledgeBaseTemplateUriOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListQuickResponsesOutput(v **ListQuickResponsesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6689,17 +6665,26 @@ func awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateKnowledgeBaseTemplateUriOutput + var sv *ListQuickResponsesOutput if *v == nil { - sv = &UpdateKnowledgeBaseTemplateUriOutput{} + sv = &ListQuickResponsesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBase": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, value); err != nil { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "quickResponseSummaries": + if err := awsRestjson1_deserializeDocumentQuickResponseSummaryList(&sv.QuickResponseSummaries, value); err != nil { return err } @@ -6712,14 +6697,14 @@ func awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(v ** return nil } -type awsRestjson1_deserializeOpUpdateQuickResponse struct { +type awsRestjson1_deserializeOpListTagsForResource struct { } -func (*awsRestjson1_deserializeOpUpdateQuickResponse) ID() string { +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateQuickResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -6737,9 +6722,9 @@ func (m *awsRestjson1_deserializeOpUpdateQuickResponse) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateQuickResponse(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &UpdateQuickResponseOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -6760,7 +6745,7 @@ func (m *awsRestjson1_deserializeOpUpdateQuickResponse) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateQuickResponseOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6774,7 +6759,7 @@ func (m *awsRestjson1_deserializeOpUpdateQuickResponse) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateQuickResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -6815,21 +6800,9 @@ func awsRestjson1_deserializeOpErrorUpdateQuickResponse(response *smithyhttp.Res } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("PreconditionFailedException", errorCode): - return awsRestjson1_deserializeErrorPreconditionFailedException(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, @@ -6840,7 +6813,7 @@ func awsRestjson1_deserializeOpErrorUpdateQuickResponse(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentUpdateQuickResponseOutput(v **UpdateQuickResponseOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6853,17 +6826,17 @@ func awsRestjson1_deserializeOpDocumentUpdateQuickResponseOutput(v **UpdateQuick return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateQuickResponseOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &UpdateQuickResponseOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "quickResponse": - if err := awsRestjson1_deserializeDocumentQuickResponseData(&sv.QuickResponse, value); err != nil { + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } @@ -6876,14 +6849,14 @@ func awsRestjson1_deserializeOpDocumentUpdateQuickResponseOutput(v **UpdateQuick return nil } -type awsRestjson1_deserializeOpUpdateSession struct { +type awsRestjson1_deserializeOpNotifyRecommendationsReceived struct { } -func (*awsRestjson1_deserializeOpUpdateSession) ID() string { +func (*awsRestjson1_deserializeOpNotifyRecommendationsReceived) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpNotifyRecommendationsReceived) 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) @@ -6901,9 +6874,9 @@ func (m *awsRestjson1_deserializeOpUpdateSession) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateSession(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorNotifyRecommendationsReceived(response, &metadata) } - output := &UpdateSessionOutput{} + output := &NotifyRecommendationsReceivedOutput{} out.Result = output var buff [1024]byte @@ -6924,7 +6897,7 @@ func (m *awsRestjson1_deserializeOpUpdateSession) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateSessionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentNotifyRecommendationsReceivedOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6938,7 +6911,7 @@ func (m *awsRestjson1_deserializeOpUpdateSession) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateSession(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorNotifyRecommendationsReceived(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)} @@ -6998,7 +6971,7 @@ func awsRestjson1_deserializeOpErrorUpdateSession(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdateSessionOutput(v **UpdateSessionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentNotifyRecommendationsReceivedOutput(v **NotifyRecommendationsReceivedOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7011,17 +6984,22 @@ func awsRestjson1_deserializeOpDocumentUpdateSessionOutput(v **UpdateSessionOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateSessionOutput + var sv *NotifyRecommendationsReceivedOutput if *v == nil { - sv = &UpdateSessionOutput{} + sv = &NotifyRecommendationsReceivedOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "session": - if err := awsRestjson1_deserializeDocumentSessionData(&sv.Session, value); err != nil { + case "errors": + if err := awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedErrorList(&sv.Errors, value); err != nil { + return err + } + + case "recommendationIds": + if err := awsRestjson1_deserializeDocumentRecommendationIdList(&sv.RecommendationIds, value); err != nil { return err } @@ -7034,48 +7012,41 @@ func awsRestjson1_deserializeOpDocumentUpdateSessionOutput(v **UpdateSessionOutp 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 - } +type awsRestjson1_deserializeOpPutFeedback struct { +} - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) +func (*awsRestjson1_deserializeOpPutFeedback) ID() string { + return "OperationDeserializer" +} +func (m *awsRestjson1_deserializeOpPutFeedback) 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) + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorPutFeedback(response, &metadata) + } + output := &PutFeedbackOutput{} + out.Result = 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) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -7086,83 +7057,45 @@ func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Respons Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentConflictException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentPutFeedbackOutput(&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 + span.End() + return out, metadata, err } -func awsRestjson1_deserializeErrorPreconditionFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.PreconditionFailedException{} - 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 +func awsRestjson1_deserializeOpErrorPutFeedback(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()) - err := awsRestjson1_deserializeDocumentPreconditionFailedException(&output, shape) + errorCode := "UnknownError" + errorMessage := errorCode - 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 + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorRequestTimeoutException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.RequestTimeoutException{} 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_deserializeDocumentRequestTimeoutException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7174,56 +7107,190 @@ func awsRestjson1_deserializeErrorRequestTimeoutException(response *smithyhttp.R } 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) -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - 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(), + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err - } + return genericError - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + } +} - if err != nil { +func awsRestjson1_deserializeOpDocumentPutFeedbackOutput(v **PutFeedbackOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutFeedbackOutput + if *v == nil { + sv = &PutFeedbackOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistantArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UuidOrArn to be of type string, got %T instead", value) + } + sv.AssistantArn = ptr.String(jtv) + } + + case "assistantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantId = ptr.String(jtv) + } + + case "contentFeedback": + if err := awsRestjson1_deserializeDocumentContentFeedbackData(&sv.ContentFeedback, value); err != nil { + return err + } + + case "targetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.TargetId = ptr.String(jtv) + } + + case "targetType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetType to be of type string, got %T instead", value) + } + sv.TargetType = types.TargetType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpQueryAssistant struct { +} + +func (*awsRestjson1_deserializeOpQueryAssistant) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpQueryAssistant) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorQueryAssistant(response, &metadata) + } + output := &QueryAssistantOutput{} + 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 err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + err = awsRestjson1_deserializeOpDocumentQueryAssistantOutput(&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 output + span.End() + return out, metadata, err } -func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceQuotaExceededException{} +func awsRestjson1_deserializeOpErrorQueryAssistant(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{ @@ -7233,132 +7300,3979 @@ 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 + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("RequestTimeoutException", errorCode): + return awsRestjson1_deserializeErrorRequestTimeoutException(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_deserializeOpDocumentQueryAssistantOutput(v **QueryAssistantOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *QueryAssistantOutput + if *v == nil { + sv = &QueryAssistantOutput{} + } 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 "results": + if err := awsRestjson1_deserializeDocumentQueryResultsList(&sv.Results, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRemoveAssistantAIAgent struct { +} + +func (*awsRestjson1_deserializeOpRemoveAssistantAIAgent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRemoveAssistantAIAgent) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorRemoveAssistantAIAgent(response, &metadata) + } + output := &RemoveAssistantAIAgentOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorRemoveAssistantAIAgent(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("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_deserializeOpRemoveKnowledgeBaseTemplateUri struct { +} + +func (*awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(response, &metadata) + } + output := &RemoveKnowledgeBaseTemplateUriOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(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("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_deserializeOpSearchContent struct { +} + +func (*awsRestjson1_deserializeOpSearchContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchContent) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorSearchContent(response, &metadata) + } + output := &SearchContentOutput{} + 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_deserializeOpDocumentSearchContentOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchContent(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("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_deserializeOpDocumentSearchContentOutput(v **SearchContentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *SearchContentOutput + if *v == nil { + sv = &SearchContentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentSummaries": + if err := awsRestjson1_deserializeDocumentContentSummaryList(&sv.ContentSummaries, 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_deserializeOpSearchQuickResponses struct { +} + +func (*awsRestjson1_deserializeOpSearchQuickResponses) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchQuickResponses) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorSearchQuickResponses(response, &metadata) + } + output := &SearchQuickResponsesOutput{} + 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_deserializeOpDocumentSearchQuickResponsesOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchQuickResponses(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("RequestTimeoutException", errorCode): + return awsRestjson1_deserializeErrorRequestTimeoutException(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_deserializeOpDocumentSearchQuickResponsesOutput(v **SearchQuickResponsesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *SearchQuickResponsesOutput + if *v == nil { + sv = &SearchQuickResponsesOutput{} + } 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 NonEmptyString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "results": + if err := awsRestjson1_deserializeDocumentQuickResponseSearchResultsList(&sv.Results, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSearchSessions struct { +} + +func (*awsRestjson1_deserializeOpSearchSessions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchSessions) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorSearchSessions(response, &metadata) + } + output := &SearchSessionsOutput{} + 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_deserializeOpDocumentSearchSessionsOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchSessions(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("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_deserializeOpDocumentSearchSessionsOutput(v **SearchSessionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *SearchSessionsOutput + if *v == nil { + sv = &SearchSessionsOutput{} + } 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 "sessionSummaries": + if err := awsRestjson1_deserializeDocumentSessionSummaries(&sv.SessionSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartContentUpload struct { +} + +func (*awsRestjson1_deserializeOpStartContentUpload) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartContentUpload) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorStartContentUpload(response, &metadata) + } + output := &StartContentUploadOutput{} + 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_deserializeOpDocumentStartContentUploadOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartContentUpload(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("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_deserializeOpDocumentStartContentUploadOutput(v **StartContentUploadOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartContentUploadOutput + if *v == nil { + sv = &StartContentUploadOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "headersToInclude": + if err := awsRestjson1_deserializeDocumentHeaders(&sv.HeadersToInclude, value); err != nil { + return err + } + + case "uploadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UploadId to be of type string, got %T instead", value) + } + sv.UploadId = ptr.String(jtv) + } + + case "url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) + } + + case "urlExpiry": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UrlExpiry = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartImportJob struct { +} + +func (*awsRestjson1_deserializeOpStartImportJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartImportJob) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorStartImportJob(response, &metadata) + } + output := &StartImportJobOutput{} + 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_deserializeOpDocumentStartImportJobOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartImportJob(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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartImportJobOutput(v **StartImportJobOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartImportJobOutput + if *v == nil { + sv = &StartImportJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "importJob": + if err := awsRestjson1_deserializeDocumentImportJobData(&sv.ImportJob, 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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 + + span.End() + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsRestjson1_deserializeErrorTooManyTagsException(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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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 + + span.End() + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateAIAgent struct { +} + +func (*awsRestjson1_deserializeOpUpdateAIAgent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAIAgent) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateAIAgent(response, &metadata) + } + output := &UpdateAIAgentOutput{} + 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_deserializeOpDocumentUpdateAIAgentOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateAIAgent(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("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_deserializeOpDocumentUpdateAIAgentOutput(v **UpdateAIAgentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateAIAgentOutput + if *v == nil { + sv = &UpdateAIAgentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aiAgent": + if err := awsRestjson1_deserializeDocumentAIAgentData(&sv.AiAgent, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateAIPrompt struct { +} + +func (*awsRestjson1_deserializeOpUpdateAIPrompt) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAIPrompt) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateAIPrompt(response, &metadata) + } + output := &UpdateAIPromptOutput{} + 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_deserializeOpDocumentUpdateAIPromptOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateAIPrompt(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("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_deserializeOpDocumentUpdateAIPromptOutput(v **UpdateAIPromptOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateAIPromptOutput + if *v == nil { + sv = &UpdateAIPromptOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aiPrompt": + if err := awsRestjson1_deserializeDocumentAIPromptData(&sv.AiPrompt, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateAssistantAIAgent struct { +} + +func (*awsRestjson1_deserializeOpUpdateAssistantAIAgent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAssistantAIAgent) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateAssistantAIAgent(response, &metadata) + } + output := &UpdateAssistantAIAgentOutput{} + 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_deserializeOpDocumentUpdateAssistantAIAgentOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateAssistantAIAgent(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("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_deserializeOpDocumentUpdateAssistantAIAgentOutput(v **UpdateAssistantAIAgentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateAssistantAIAgentOutput + if *v == nil { + sv = &UpdateAssistantAIAgentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistant": + if err := awsRestjson1_deserializeDocumentAssistantData(&sv.Assistant, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateContent struct { +} + +func (*awsRestjson1_deserializeOpUpdateContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateContent) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateContent(response, &metadata) + } + output := &UpdateContentOutput{} + 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_deserializeOpDocumentUpdateContentOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateContent(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("PreconditionFailedException", errorCode): + return awsRestjson1_deserializeErrorPreconditionFailedException(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_deserializeOpDocumentUpdateContentOutput(v **UpdateContentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateContentOutput + if *v == nil { + sv = &UpdateContentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "content": + if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri struct { +} + +func (*awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateKnowledgeBaseTemplateUri(response, &metadata) + } + output := &UpdateKnowledgeBaseTemplateUriOutput{} + 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_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateKnowledgeBaseTemplateUri(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("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_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(v **UpdateKnowledgeBaseTemplateUriOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateKnowledgeBaseTemplateUriOutput + if *v == nil { + sv = &UpdateKnowledgeBaseTemplateUriOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "knowledgeBase": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateQuickResponse struct { +} + +func (*awsRestjson1_deserializeOpUpdateQuickResponse) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateQuickResponse) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateQuickResponse(response, &metadata) + } + output := &UpdateQuickResponseOutput{} + 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_deserializeOpDocumentUpdateQuickResponseOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateQuickResponse(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("PreconditionFailedException", errorCode): + return awsRestjson1_deserializeErrorPreconditionFailedException(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_deserializeOpDocumentUpdateQuickResponseOutput(v **UpdateQuickResponseOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateQuickResponseOutput + if *v == nil { + sv = &UpdateQuickResponseOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "quickResponse": + if err := awsRestjson1_deserializeDocumentQuickResponseData(&sv.QuickResponse, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateSession struct { +} + +func (*awsRestjson1_deserializeOpUpdateSession) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSession) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateSession(response, &metadata) + } + output := &UpdateSessionOutput{} + 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_deserializeOpDocumentUpdateSessionOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateSession(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("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_deserializeOpDocumentUpdateSessionOutput(v **UpdateSessionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateSessionOutput + if *v == nil { + sv = &UpdateSessionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "session": + if err := awsRestjson1_deserializeDocumentSessionData(&sv.Session, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateSessionData struct { +} + +func (*awsRestjson1_deserializeOpUpdateSessionData) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSessionData) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateSessionData(response, &metadata) + } + output := &UpdateSessionDataOutput{} + 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_deserializeOpDocumentUpdateSessionDataOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateSessionData(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("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_deserializeOpDocumentUpdateSessionDataOutput(v **UpdateSessionDataOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateSessionDataOutput + if *v == nil { + sv = &UpdateSessionDataOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "data": + if err := awsRestjson1_deserializeDocumentRuntimeSessionDataList(&sv.Data, value); err != nil { + return err + } + + case "namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SessionDataNamespace to be of type string, got %T instead", value) + } + sv.Namespace = types.SessionDataNamespace(jtv) + } + + case "sessionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.SessionArn = ptr.String(jtv) + } + + case "sessionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.SessionId = 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_deserializeErrorPreconditionFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.PreconditionFailedException{} + 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_deserializeDocumentPreconditionFailedException(&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_deserializeErrorRequestTimeoutException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RequestTimeoutException{} + 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_deserializeDocumentRequestTimeoutException(&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_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTagsException{} + 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_deserializeDocumentTooManyTagsException(&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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAIAgentConfiguration(v *types.AIAgentConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.AIAgentConfiguration +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "answerRecommendationAIAgentConfiguration": + var mv types.AnswerRecommendationAIAgentConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentAnswerRecommendationAIAgentConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AIAgentConfigurationMemberAnswerRecommendationAIAgentConfiguration{Value: mv} + break loop + + case "manualSearchAIAgentConfiguration": + var mv types.ManualSearchAIAgentConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentManualSearchAIAgentConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AIAgentConfigurationMemberManualSearchAIAgentConfiguration{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentAIAgentConfigurationData(v **types.AIAgentConfigurationData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AIAgentConfigurationData + if *v == nil { + sv = &types.AIAgentConfigurationData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aiAgentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UuidWithQualifier to be of type string, got %T instead", value) + } + sv.AiAgentId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAIAgentConfigurationMap(v *map[string]types.AIAgentConfigurationData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.AIAgentConfigurationData + if *v == nil { + mv = map[string]types.AIAgentConfigurationData{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.AIAgentConfigurationData + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentAIAgentConfigurationData(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentAIAgentData(v **types.AIAgentData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AIAgentData + if *v == nil { + sv = &types.AIAgentData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aiAgentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AiAgentArn = ptr.String(jtv) + } + + case "aiAgentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AiAgentId = ptr.String(jtv) + } + + case "assistantArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AssistantArn = ptr.String(jtv) + } + + case "assistantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantId = ptr.String(jtv) + } + + case "configuration": + if err := awsRestjson1_deserializeDocumentAIAgentConfiguration(&sv.Configuration, value); err != nil { + return err + } + + 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 "modifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + 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 "origin": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Origin to be of type string, got %T instead", value) + } + sv.Origin = types.Origin(jtv) + } + + 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 "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AIAgentType to be of type string, got %T instead", value) + } + sv.Type = types.AIAgentType(jtv) + } + + case "visibilityStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VisibilityStatus to be of type string, got %T instead", value) + } + sv.VisibilityStatus = types.VisibilityStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAIAgentSummary(v **types.AIAgentSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AIAgentSummary + if *v == nil { + sv = &types.AIAgentSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aiAgentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AiAgentArn = ptr.String(jtv) + } + + case "aiAgentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AiAgentId = ptr.String(jtv) + } + + case "assistantArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AssistantArn = ptr.String(jtv) + } + + case "assistantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantId = ptr.String(jtv) + } + + case "configuration": + if err := awsRestjson1_deserializeDocumentAIAgentConfiguration(&sv.Configuration, value); err != nil { + return err + } + + 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 "modifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + 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 "origin": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Origin to be of type string, got %T instead", value) + } + sv.Origin = types.Origin(jtv) + } + + 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 "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AIAgentType to be of type string, got %T instead", value) + } + sv.Type = types.AIAgentType(jtv) + } + + case "visibilityStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VisibilityStatus to be of type string, got %T instead", value) + } + sv.VisibilityStatus = types.VisibilityStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAIAgentSummaryList(v *[]types.AIAgentSummary, 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.AIAgentSummary + if *v == nil { + cv = []types.AIAgentSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AIAgentSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAIAgentSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAIAgentVersionSummariesList(v *[]types.AIAgentVersionSummary, 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.AIAgentVersionSummary + if *v == nil { + cv = []types.AIAgentVersionSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AIAgentVersionSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAIAgentVersionSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAIAgentVersionSummary(v **types.AIAgentVersionSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AIAgentVersionSummary + if *v == nil { + sv = &types.AIAgentVersionSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aiAgentSummary": + if err := awsRestjson1_deserializeDocumentAIAgentSummary(&sv.AiAgentSummary, value); err != nil { + return err + } + + case "versionNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Version to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.VersionNumber = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAIPromptData(v **types.AIPromptData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AIPromptData + if *v == nil { + sv = &types.AIPromptData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aiPromptArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AiPromptArn = ptr.String(jtv) + } + + case "aiPromptId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AiPromptId = ptr.String(jtv) + } + + case "apiFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AIPromptAPIFormat to be of type string, got %T instead", value) + } + sv.ApiFormat = types.AIPromptAPIFormat(jtv) + } + + case "assistantArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AssistantArn = ptr.String(jtv) + } + + case "assistantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantId = 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 "modelId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AIPromptModelIdentifier to be of type string, got %T instead", value) + } + sv.ModelId = ptr.String(jtv) + } + + case "modifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + 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 "origin": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Origin to be of type string, got %T instead", value) + } + sv.Origin = types.Origin(jtv) + } + + 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 "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "templateConfiguration": + if err := awsRestjson1_deserializeDocumentAIPromptTemplateConfiguration(&sv.TemplateConfiguration, value); err != nil { + return err + } + + case "templateType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AIPromptTemplateType to be of type string, got %T instead", value) + } + sv.TemplateType = types.AIPromptTemplateType(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AIPromptType to be of type string, got %T instead", value) + } + sv.Type = types.AIPromptType(jtv) + } + + case "visibilityStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VisibilityStatus to be of type string, got %T instead", value) + } + sv.VisibilityStatus = types.VisibilityStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAIPromptSummary(v **types.AIPromptSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AIPromptSummary + if *v == nil { + sv = &types.AIPromptSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aiPromptArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AiPromptArn = ptr.String(jtv) + } + + case "aiPromptId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AiPromptId = ptr.String(jtv) + } + + case "apiFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AIPromptAPIFormat to be of type string, got %T instead", value) + } + sv.ApiFormat = types.AIPromptAPIFormat(jtv) + } + + case "assistantArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AssistantArn = ptr.String(jtv) + } + + case "assistantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantId = 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 "modelId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AIPromptModelIdentifier to be of type string, got %T instead", value) + } + sv.ModelId = ptr.String(jtv) + } + + case "modifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + 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 "origin": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Origin to be of type string, got %T instead", value) + } + sv.Origin = types.Origin(jtv) + } + + 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 "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "templateType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AIPromptTemplateType to be of type string, got %T instead", value) + } + sv.TemplateType = types.AIPromptTemplateType(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AIPromptType to be of type string, got %T instead", value) + } + sv.Type = types.AIPromptType(jtv) + } - 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 "visibilityStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VisibilityStatus to be of type string, got %T instead", value) + } + sv.VisibilityStatus = types.VisibilityStatus(jtv) + } - errorBody.Seek(0, io.SeekStart) + default: + _, _ = key, value - return output + } + } + *v = sv + return nil } -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 +func awsRestjson1_deserializeDocumentAIPromptSummaryList(v *[]types.AIPromptSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - 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 + var cv []types.AIPromptSummary + if *v == nil { + cv = []types.AIPromptSummary{} + } else { + cv = *v } - errorBody.Seek(0, io.SeekStart) + for _, value := range shape { + var col types.AIPromptSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAIPromptSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) - return output + } + *v = cv + return nil } -func awsRestjson1_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTagsException{} - 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 +func awsRestjson1_deserializeDocumentAIPromptTemplateConfiguration(v *types.AIPromptTemplateConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - err := awsRestjson1_deserializeDocumentTooManyTagsException(&output, shape) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - 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(), + var uv types.AIPromptTemplateConfiguration +loop: + for key, value := range shape { + if value == nil { + continue } - return err - } + switch key { + case "textFullAIPromptEditTemplateConfiguration": + var mv types.TextFullAIPromptEditTemplateConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentTextFullAIPromptEditTemplateConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AIPromptTemplateConfigurationMemberTextFullAIPromptEditTemplateConfiguration{Value: mv} + break loop - errorBody.Seek(0, io.SeekStart) + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop - return output + } + } + *v = uv + return nil } -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 +func awsRestjson1_deserializeDocumentAIPromptVersionSummariesList(v *[]types.AIPromptVersionSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - 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 + var cv []types.AIPromptVersionSummary + if *v == nil { + cv = []types.AIPromptVersionSummary{} + } else { + cv = *v } - errorBody.Seek(0, io.SeekStart) + for _, value := range shape { + var col types.AIPromptVersionSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAIPromptVersionSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) - return output + } + *v = cv + return nil } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeDocumentAIPromptVersionSummary(v **types.AIPromptVersionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7371,22 +11285,31 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *types.AIPromptVersionSummary if *v == nil { - sv = &types.AccessDeniedException{} + sv = &types.AIPromptVersionSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "aiPromptSummary": + if err := awsRestjson1_deserializeDocumentAIPromptSummary(&sv.AiPromptSummary, value); err != nil { + return err + } + + case "versionNumber": if value != nil { - jtv, ok := value.(string) + 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 Version to be json.Number, got %T instead", value) } - sv.Message = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.VersionNumber = ptr.Int64(i64) } default: @@ -7451,24 +11374,87 @@ func awsRestjson1_deserializeDocumentAndConditions(v *[]types.TagCondition, valu return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.TagCondition - if *v == nil { - cv = []types.TagCondition{} - } else { - cv = *v - } + var cv []types.TagCondition + if *v == nil { + cv = []types.TagCondition{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TagCondition + destAddr := &col + if err := awsRestjson1_deserializeDocumentTagCondition(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAnswerRecommendationAIAgentConfiguration(v **types.AnswerRecommendationAIAgentConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AnswerRecommendationAIAgentConfiguration + if *v == nil { + sv = &types.AnswerRecommendationAIAgentConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "answerGenerationAIPromptId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UuidWithQualifier to be of type string, got %T instead", value) + } + sv.AnswerGenerationAIPromptId = ptr.String(jtv) + } + + case "associationConfigurations": + if err := awsRestjson1_deserializeDocumentAssociationConfigurationList(&sv.AssociationConfigurations, value); err != nil { + return err + } + + case "intentLabelingGenerationAIPromptId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UuidWithQualifier to be of type string, got %T instead", value) + } + sv.IntentLabelingGenerationAIPromptId = ptr.String(jtv) + } + + case "queryReformulationAIPromptId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UuidWithQualifier to be of type string, got %T instead", value) + } + sv.QueryReformulationAIPromptId = ptr.String(jtv) + } + + default: + _, _ = key, value - for _, value := range shape { - var col types.TagCondition - destAddr := &col - if err := awsRestjson1_deserializeDocumentTagCondition(&destAddr, value); err != nil { - return err } - col = *destAddr - cv = append(cv, col) - } - *v = cv + *v = sv return nil } @@ -7825,6 +11811,11 @@ func awsRestjson1_deserializeDocumentAssistantData(v **types.AssistantData, valu for key, value := range shape { switch key { + case "aiAgentConfiguration": + if err := awsRestjson1_deserializeDocumentAIAgentConfigurationMap(&sv.AiAgentConfiguration, value); err != nil { + return err + } + case "assistantArn": if value != nil { jtv, ok := value.(string) @@ -8004,6 +11995,11 @@ func awsRestjson1_deserializeDocumentAssistantSummary(v **types.AssistantSummary for key, value := range shape { switch key { + case "aiAgentConfiguration": + if err := awsRestjson1_deserializeDocumentAIAgentConfigurationMap(&sv.AiAgentConfiguration, value); err != nil { + return err + } + case "assistantArn": if value != nil { jtv, ok := value.(string) @@ -8069,13 +12065,277 @@ func awsRestjson1_deserializeDocumentAssistantSummary(v **types.AssistantSummary return err } - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AssistantType to be of type string, got %T instead", value) - } - sv.Type = types.AssistantType(jtv) + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssistantType to be of type string, got %T instead", value) + } + sv.Type = types.AssistantType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssociationConfiguration(v **types.AssociationConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AssociationConfiguration + if *v == nil { + sv = &types.AssociationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "associationConfigurationData": + if err := awsRestjson1_deserializeDocumentAssociationConfigurationData(&sv.AssociationConfigurationData, value); err != nil { + return err + } + + case "associationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssociationId = ptr.String(jtv) + } + + case "associationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AIAgentAssociationConfigurationType to be of type string, got %T instead", value) + } + sv.AssociationType = types.AIAgentAssociationConfigurationType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssociationConfigurationData(v *types.AssociationConfigurationData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.AssociationConfigurationData +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "knowledgeBaseAssociationConfigurationData": + var mv types.KnowledgeBaseAssociationConfigurationData + destAddr := &mv + if err := awsRestjson1_deserializeDocumentKnowledgeBaseAssociationConfigurationData(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AssociationConfigurationDataMemberKnowledgeBaseAssociationConfigurationData{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentAssociationConfigurationList(v *[]types.AssociationConfiguration, 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.AssociationConfiguration + if *v == nil { + cv = []types.AssociationConfiguration{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssociationConfiguration + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssociationConfiguration(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBedrockFoundationModelConfigurationForParsing(v **types.BedrockFoundationModelConfigurationForParsing, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.BedrockFoundationModelConfigurationForParsing + if *v == nil { + sv = &types.BedrockFoundationModelConfigurationForParsing{} + } 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 BedrockModelArnForParsing 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_deserializeDocumentChannels(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 Channel to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + 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: @@ -8087,7 +12347,7 @@ func awsRestjson1_deserializeDocumentAssistantSummary(v **types.AssistantSummary return nil } -func awsRestjson1_deserializeDocumentChannels(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentCitationSpan(v **types.CitationSpan, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8095,31 +12355,52 @@ func awsRestjson1_deserializeDocumentChannels(v *[]string, value interface{}) er 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.CitationSpan if *v == nil { - cv = []string{} + sv = &types.CitationSpan{} } 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 Channel to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "beginOffsetInclusive": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected CitationSpanOffset to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BeginOffsetInclusive = int32(i64) + } + + case "endOffsetExclusive": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected CitationSpanOffset to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.EndOffsetExclusive = int32(i64) } - col = jtv - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } @@ -8892,6 +13173,24 @@ func awsRestjson1_deserializeDocumentContentReference(v **types.ContentReference sv.KnowledgeBaseId = ptr.String(jtv) } + case "referenceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReferenceType to be of type string, got %T instead", value) + } + sv.ReferenceType = types.ReferenceType(jtv) + } + + case "sourceURL": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SourceURL = ptr.String(jtv) + } + default: _, _ = key, value @@ -9097,6 +13396,16 @@ loop: uv = &types.DataDetailsMemberGenerativeData{Value: mv} break loop + case "intentDetectedData": + var mv types.IntentDetectedDataDetails + destAddr := &mv + if err := awsRestjson1_deserializeDocumentIntentDetectedDataDetails(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.DataDetailsMemberIntentDetectedData{Value: mv} + break loop + case "sourceContentData": var mv types.SourceContentDataDetails destAddr := &mv @@ -9378,6 +13687,99 @@ func awsRestjson1_deserializeDocumentExternalSourceConfiguration(v **types.Exter return nil } +func awsRestjson1_deserializeDocumentFailureReason(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func 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_deserializeDocumentGenerativeContentFeedbackData(v **types.GenerativeContentFeedbackData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9627,10 +14029,137 @@ func awsRestjson1_deserializeDocumentHeaders(v *map[string]string, value interfa } parsedVal = jtv } - mv[key] = parsedVal + mv[key] = parsedVal + + } + *v = mv + 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 = mv + *v = cv return nil } @@ -10047,6 +14576,113 @@ func awsRestjson1_deserializeDocumentImportJobSummary(v **types.ImportJobSummary return nil } +func awsRestjson1_deserializeDocumentIntentDetectedDataDetails(v **types.IntentDetectedDataDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.IntentDetectedDataDetails + if *v == nil { + sv = &types.IntentDetectedDataDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "intent": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value) + } + sv.Intent = ptr.String(jtv) + } + + case "intentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.IntentId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKnowledgeBaseAssociationConfigurationData(v **types.KnowledgeBaseAssociationConfigurationData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.KnowledgeBaseAssociationConfigurationData + if *v == nil { + sv = &types.KnowledgeBaseAssociationConfigurationData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentTagFilter": + if err := awsRestjson1_deserializeDocumentTagFilter(&sv.ContentTagFilter, value); err != nil { + return err + } + + case "maxResults": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaxResults to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxResults = ptr.Int32(int32(i64)) + } + + case "overrideKnowledgeBaseSearchType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KnowledgeBaseSearchType to be of type string, got %T instead", value) + } + sv.OverrideKnowledgeBaseSearchType = types.KnowledgeBaseSearchType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentKnowledgeBaseAssociationData(v **types.KnowledgeBaseAssociationData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10127,6 +14763,20 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseData(v **types.KnowledgeBaseDa sv.Description = ptr.String(jtv) } + case "ingestionFailureReasons": + if err := awsRestjson1_deserializeDocumentFailureReason(&sv.IngestionFailureReasons, value); err != nil { + return err + } + + case "ingestionStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SyncStatus to be of type string, got %T instead", value) + } + sv.IngestionStatus = types.SyncStatus(jtv) + } + case "knowledgeBaseArn": if value != nil { jtv, ok := value.(string) @@ -10208,6 +14858,11 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseData(v **types.KnowledgeBaseDa return err } + case "vectorIngestionConfiguration": + if err := awsRestjson1_deserializeDocumentVectorIngestionConfiguration(&sv.VectorIngestionConfiguration, value); err != nil { + return err + } + default: _, _ = key, value @@ -10347,6 +15002,96 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseSummary(v **types.KnowledgeBas return err } + case "vectorIngestionConfiguration": + if err := awsRestjson1_deserializeDocumentVectorIngestionConfiguration(&sv.VectorIngestionConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentManagedSourceConfiguration(v *types.ManagedSourceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ManagedSourceConfiguration +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "webCrawlerConfiguration": + var mv types.WebCrawlerConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentWebCrawlerConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ManagedSourceConfigurationMemberWebCrawlerConfiguration{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentManualSearchAIAgentConfiguration(v **types.ManualSearchAIAgentConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ManualSearchAIAgentConfiguration + if *v == nil { + sv = &types.ManualSearchAIAgentConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "answerGenerationAIPromptId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UuidWithQualifier to be of type string, got %T instead", value) + } + sv.AnswerGenerationAIPromptId = ptr.String(jtv) + } + + case "associationConfigurations": + if err := awsRestjson1_deserializeDocumentAssociationConfigurationList(&sv.AssociationConfigurations, value); err != nil { + return err + } + default: _, _ = key, value @@ -10509,21 +15254,98 @@ loop: if err := awsRestjson1_deserializeDocumentTagCondition(&destAddr, value); err != nil { return err } - mv = *destAddr - uv = &types.OrConditionMemberTagCondition{Value: mv} - break loop + mv = *destAddr + uv = &types.OrConditionMemberTagCondition{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentOrConditions(v *[]types.OrCondition, 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.OrCondition + if *v == nil { + cv = []types.OrCondition{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OrCondition + if err := awsRestjson1_deserializeDocumentOrCondition(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentParsingConfiguration(v **types.ParsingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ParsingConfiguration + if *v == nil { + sv = &types.ParsingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "bedrockFoundationModelConfiguration": + if err := awsRestjson1_deserializeDocumentBedrockFoundationModelConfigurationForParsing(&sv.BedrockFoundationModelConfiguration, value); err != nil { + return err + } + + case "parsingStrategy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParsingStrategy to be of type string, got %T instead", value) + } + sv.ParsingStrategy = types.ParsingStrategy(jtv) + } default: - uv = &types.UnknownUnionMember{Tag: key} - break loop + _, _ = key, value } } - *v = uv + *v = sv return nil } -func awsRestjson1_deserializeDocumentOrConditions(v *[]types.OrCondition, value interface{}) error { +func awsRestjson1_deserializeDocumentParsingPrompt(v **types.ParsingPrompt, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10531,27 +15353,35 @@ func awsRestjson1_deserializeDocumentOrConditions(v *[]types.OrCondition, value 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.OrCondition + var sv *types.ParsingPrompt if *v == nil { - cv = []types.OrCondition{} + sv = &types.ParsingPrompt{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.OrCondition - if err := awsRestjson1_deserializeDocumentOrCondition(&col, value); err != nil { - return err - } - cv = append(cv, col) + for key, value := range shape { + switch key { + case "parsingPromptText": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParsingPromptText to be of type string, got %T instead", value) + } + sv.ParsingPromptText = ptr.String(jtv) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } @@ -11958,22 +16788,287 @@ func awsRestjson1_deserializeDocumentResultData(v **types.ResultData, value inte } } - case "resultId": + case "resultId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.ResultId = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryResultType to be of type string, got %T instead", value) + } + sv.Type = types.QueryResultType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRuntimeSessionData(v **types.RuntimeSessionData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RuntimeSessionData + if *v == nil { + sv = &types.RuntimeSessionData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptySensitiveString to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "value": + if err := awsRestjson1_deserializeDocumentRuntimeSessionDataValue(&sv.Value, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRuntimeSessionDataList(v *[]types.RuntimeSessionData, 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.RuntimeSessionData + if *v == nil { + cv = []types.RuntimeSessionData{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RuntimeSessionData + destAddr := &col + if err := awsRestjson1_deserializeDocumentRuntimeSessionData(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRuntimeSessionDataValue(v *types.RuntimeSessionDataValue, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.RuntimeSessionDataValue +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "stringValue": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptySensitiveString to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.RuntimeSessionDataValueMemberStringValue{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentSeedUrl(v **types.SeedUrl, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SeedUrl + if *v == nil { + sv = &types.SeedUrl{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WebUrl to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSeedUrls(v *[]types.SeedUrl, 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.SeedUrl + if *v == nil { + cv = []types.SeedUrl{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SeedUrl + destAddr := &col + if err := awsRestjson1_deserializeDocumentSeedUrl(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSemanticChunkingConfiguration(v **types.SemanticChunkingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SemanticChunkingConfiguration + if *v == nil { + sv = &types.SemanticChunkingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "breakpointPercentileThreshold": + 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.BreakpointPercentileThreshold = ptr.Int32(int32(i64)) + } + + case "bufferSize": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.ResultId = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BufferSize = ptr.Int32(int32(i64)) } - case "type": + case "maxTokens": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected QueryResultType 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.QueryResultType(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxTokens = ptr.Int32(int32(i64)) } default: @@ -12087,6 +17182,11 @@ func awsRestjson1_deserializeDocumentSessionData(v **types.SessionData, value in for key, value := range shape { switch key { + case "aiAgentConfiguration": + if err := awsRestjson1_deserializeDocumentAIAgentConfigurationMap(&sv.AiAgentConfiguration, value); err != nil { + return err + } + case "description": if value != nil { jtv, ok := value.(string) @@ -12318,6 +17418,14 @@ loop: uv = &types.SourceConfigurationMemberAppIntegrations{Value: mv} break loop + case "managedSourceConfiguration": + var mv types.ManagedSourceConfiguration + if err := awsRestjson1_deserializeDocumentManagedSourceConfiguration(&mv, value); err != nil { + return err + } + uv = &types.SourceConfigurationMemberManagedSourceConfiguration{Value: mv} + break loop + default: uv = &types.UnknownUnionMember{Tag: key} break loop @@ -12350,6 +17458,11 @@ func awsRestjson1_deserializeDocumentSourceContentDataDetails(v **types.SourceCo for key, value := range shape { switch key { + case "citationSpan": + if err := awsRestjson1_deserializeDocumentCitationSpan(&sv.CitationSpan, value); err != nil { + return err + } + case "id": if value != nil { jtv, ok := value.(string) @@ -12569,6 +17682,46 @@ func awsRestjson1_deserializeDocumentTextData(v **types.TextData, value interfac return nil } +func awsRestjson1_deserializeDocumentTextFullAIPromptEditTemplateConfiguration(v **types.TextFullAIPromptEditTemplateConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TextFullAIPromptEditTemplateConfiguration + if *v == nil { + sv = &types.TextFullAIPromptEditTemplateConfiguration{} + } 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 TextAIPrompt to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12658,6 +17811,78 @@ func awsRestjson1_deserializeDocumentTooManyTagsException(v **types.TooManyTagsE return nil } +func awsRestjson1_deserializeDocumentUrlConfiguration(v **types.UrlConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.UrlConfiguration + if *v == nil { + sv = &types.UrlConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "seedUrls": + if err := awsRestjson1_deserializeDocumentSeedUrls(&sv.SeedUrls, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUrlFilterList(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 UrlFilterPattern to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12697,3 +17922,148 @@ func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationExc *v = sv return nil } + +func awsRestjson1_deserializeDocumentVectorIngestionConfiguration(v **types.VectorIngestionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.VectorIngestionConfiguration + if *v == nil { + sv = &types.VectorIngestionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "chunkingConfiguration": + if err := awsRestjson1_deserializeDocumentChunkingConfiguration(&sv.ChunkingConfiguration, value); err != nil { + return err + } + + case "parsingConfiguration": + if err := awsRestjson1_deserializeDocumentParsingConfiguration(&sv.ParsingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *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_deserializeDocumentUrlFilterList(&sv.ExclusionFilters, value); err != nil { + return err + } + + case "inclusionFilters": + if err := awsRestjson1_deserializeDocumentUrlFilterList(&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) + } + + case "urlConfiguration": + if err := awsRestjson1_deserializeDocumentUrlConfiguration(&sv.UrlConfiguration, value); err != nil { + return err + } + + 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 +} diff --git a/service/qconnect/doc.go b/service/qconnect/doc.go index df625fb281d..313ef9036b0 100644 --- a/service/qconnect/doc.go +++ b/service/qconnect/doc.go @@ -3,9 +3,12 @@ // Package qconnect provides the API client, operations, and parameter types for // Amazon Q Connect. // -// Powered by Amazon Bedrock: Amazon Web Services implements [automated abuse detection]. Because Amazon Q +// [Amazon Q actions] // -// in Connect is built on Amazon Bedrock, users can take full advantage of the +// [Amazon Q data types] +// +// Powered by Amazon Bedrock: Amazon Web Services implements [automated abuse detection]. Because Amazon Q in +// Connect is built on Amazon Bedrock, users can take full advantage of the // controls implemented in Amazon Bedrock to enforce safety, security, and the // responsible use of artificial intelligence (AI). // @@ -27,6 +30,7 @@ // For more information, see [Use Amazon Q in Connect for generative AI powered agent assistance in real-time] in the Amazon Connect Administrator Guide. // // [Use Amazon Q in Connect for generative AI powered agent assistance in real-time]: https://docs.aws.amazon.com/connect/latest/adminguide/amazon-q-connect.html -// +// [Amazon Q actions]: https://docs.aws.amazon.com/connect/latest/APIReference/API_Operations_Amazon_Q_Connect.html // [automated abuse detection]: https://docs.aws.amazon.com/bedrock/latest/userguide/abuse-detection.html +// [Amazon Q data types]: https://docs.aws.amazon.com/connect/latest/APIReference/API_Types_Amazon_Q_Connect.html package qconnect diff --git a/service/qconnect/generated.json b/service/qconnect/generated.json index 88fd26aa727..b3b323051b8 100644 --- a/service/qconnect/generated.json +++ b/service/qconnect/generated.json @@ -8,6 +8,10 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_CreateAIAgent.go", + "api_op_CreateAIAgentVersion.go", + "api_op_CreateAIPrompt.go", + "api_op_CreateAIPromptVersion.go", "api_op_CreateAssistant.go", "api_op_CreateAssistantAssociation.go", "api_op_CreateContent.go", @@ -15,6 +19,10 @@ "api_op_CreateKnowledgeBase.go", "api_op_CreateQuickResponse.go", "api_op_CreateSession.go", + "api_op_DeleteAIAgent.go", + "api_op_DeleteAIAgentVersion.go", + "api_op_DeleteAIPrompt.go", + "api_op_DeleteAIPromptVersion.go", "api_op_DeleteAssistant.go", "api_op_DeleteAssistantAssociation.go", "api_op_DeleteContent.go", @@ -22,6 +30,8 @@ "api_op_DeleteImportJob.go", "api_op_DeleteKnowledgeBase.go", "api_op_DeleteQuickResponse.go", + "api_op_GetAIAgent.go", + "api_op_GetAIPrompt.go", "api_op_GetAssistant.go", "api_op_GetAssistantAssociation.go", "api_op_GetContent.go", @@ -32,6 +42,10 @@ "api_op_GetQuickResponse.go", "api_op_GetRecommendations.go", "api_op_GetSession.go", + "api_op_ListAIAgentVersions.go", + "api_op_ListAIAgents.go", + "api_op_ListAIPromptVersions.go", + "api_op_ListAIPrompts.go", "api_op_ListAssistantAssociations.go", "api_op_ListAssistants.go", "api_op_ListContentAssociations.go", @@ -43,6 +57,7 @@ "api_op_NotifyRecommendationsReceived.go", "api_op_PutFeedback.go", "api_op_QueryAssistant.go", + "api_op_RemoveAssistantAIAgent.go", "api_op_RemoveKnowledgeBaseTemplateUri.go", "api_op_SearchContent.go", "api_op_SearchQuickResponses.go", @@ -51,10 +66,14 @@ "api_op_StartImportJob.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdateAIAgent.go", + "api_op_UpdateAIPrompt.go", + "api_op_UpdateAssistantAIAgent.go", "api_op_UpdateContent.go", "api_op_UpdateKnowledgeBaseTemplateUri.go", "api_op_UpdateQuickResponse.go", "api_op_UpdateSession.go", + "api_op_UpdateSessionData.go", "auth.go", "deserializers.go", "doc.go", diff --git a/service/qconnect/serializers.go b/service/qconnect/serializers.go index 2858eed6e83..1df602708db 100644 --- a/service/qconnect/serializers.go +++ b/service/qconnect/serializers.go @@ -11,18 +11,19 @@ import ( "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" ) -type awsRestjson1_serializeOpCreateAssistant struct { +type awsRestjson1_serializeOpCreateAIAgent struct { } -func (*awsRestjson1_serializeOpCreateAssistant) ID() string { +func (*awsRestjson1_serializeOpCreateAIAgent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpCreateAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateAIAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -34,13 +35,13 @@ func (m *awsRestjson1_serializeOpCreateAssistant) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateAssistantInput) + input, ok := in.Parameters.(*CreateAIAgentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiagents") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -56,10 +57,14 @@ func (m *awsRestjson1_serializeOpCreateAssistant) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } + if err := awsRestjson1_serializeOpHttpBindingsCreateAIAgentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateAssistantInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentCreateAIAgentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -76,15 +81,24 @@ func (m *awsRestjson1_serializeOpCreateAssistant) HandleSerialize(ctx context.Co span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsCreateAssistantInput(v *CreateAssistantInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateAIAgentInput(v *CreateAIAgentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + return nil } -func awsRestjson1_serializeOpDocumentCreateAssistantInput(v *CreateAssistantInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentCreateAIAgentInput(v *CreateAIAgentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -93,6 +107,13 @@ func awsRestjson1_serializeOpDocumentCreateAssistantInput(v *CreateAssistantInpu ok.String(*v.ClientToken) } + if v.Configuration != nil { + ok := object.Key("configuration") + if err := awsRestjson1_serializeDocumentAIAgentConfiguration(v.Configuration, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -103,13 +124,6 @@ func awsRestjson1_serializeOpDocumentCreateAssistantInput(v *CreateAssistantInpu 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.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { @@ -122,17 +136,22 @@ func awsRestjson1_serializeOpDocumentCreateAssistantInput(v *CreateAssistantInpu ok.String(string(v.Type)) } + if len(v.VisibilityStatus) > 0 { + ok := object.Key("visibilityStatus") + ok.String(string(v.VisibilityStatus)) + } + return nil } -type awsRestjson1_serializeOpCreateAssistantAssociation struct { +type awsRestjson1_serializeOpCreateAIAgentVersion struct { } -func (*awsRestjson1_serializeOpCreateAssistantAssociation) ID() string { +func (*awsRestjson1_serializeOpCreateAIAgentVersion) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpCreateAssistantAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateAIAgentVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -144,13 +163,13 @@ func (m *awsRestjson1_serializeOpCreateAssistantAssociation) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateAssistantAssociationInput) + input, ok := in.Parameters.(*CreateAIAgentVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/associations") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiagents/{aiAgentId}/versions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -166,14 +185,14 @@ func (m *awsRestjson1_serializeOpCreateAssistantAssociation) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsCreateAssistantAssociationInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsCreateAIAgentVersionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateAssistantAssociationInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentCreateAIAgentVersionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -190,11 +209,20 @@ func (m *awsRestjson1_serializeOpCreateAssistantAssociation) HandleSerialize(ctx span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsCreateAssistantAssociationInput(v *CreateAssistantAssociationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateAIAgentVersionInput(v *CreateAIAgentVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } + if v.AiAgentId == nil || len(*v.AiAgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiAgentId must not be empty")} + } + if v.AiAgentId != nil { + if err := encoder.SetURI("aiAgentId").String(*v.AiAgentId); err != nil { + return err + } + } + if v.AssistantId == nil || len(*v.AssistantId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } @@ -207,45 +235,31 @@ func awsRestjson1_serializeOpHttpBindingsCreateAssistantAssociationInput(v *Crea return nil } -func awsRestjson1_serializeOpDocumentCreateAssistantAssociationInput(v *CreateAssistantAssociationInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentCreateAIAgentVersionInput(v *CreateAIAgentVersionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Association != nil { - ok := object.Key("association") - if err := awsRestjson1_serializeDocumentAssistantAssociationInputData(v.Association, ok); err != nil { - return err - } - } - - if len(v.AssociationType) > 0 { - ok := object.Key("associationType") - ok.String(string(v.AssociationType)) - } - if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { - return err - } + if v.ModifiedTime != nil { + ok := object.Key("modifiedTime") + ok.Double(smithytime.FormatEpochSeconds(*v.ModifiedTime)) } return nil } -type awsRestjson1_serializeOpCreateContent struct { +type awsRestjson1_serializeOpCreateAIPrompt struct { } -func (*awsRestjson1_serializeOpCreateContent) ID() string { +func (*awsRestjson1_serializeOpCreateAIPrompt) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpCreateContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateAIPrompt) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -257,13 +271,13 @@ func (m *awsRestjson1_serializeOpCreateContent) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateContentInput) + input, ok := in.Parameters.(*CreateAIPromptInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiprompts") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -279,14 +293,14 @@ func (m *awsRestjson1_serializeOpCreateContent) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsCreateContentInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsCreateAIPromptInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateContentInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentCreateAIPromptInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -303,16 +317,16 @@ func (m *awsRestjson1_serializeOpCreateContent) HandleSerialize(ctx context.Cont span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsCreateContentInput(v *CreateContentInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateAIPromptInput(v *CreateAIPromptInput, 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.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } @@ -320,20 +334,28 @@ func awsRestjson1_serializeOpHttpBindingsCreateContentInput(v *CreateContentInpu return nil } -func awsRestjson1_serializeOpDocumentCreateContentInput(v *CreateContentInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentCreateAIPromptInput(v *CreateAIPromptInput, value smithyjson.Value) error { object := value.Object() defer object.Close() + if len(v.ApiFormat) > 0 { + ok := object.Key("apiFormat") + ok.String(string(v.ApiFormat)) + } + if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } - if v.Metadata != nil { - ok := object.Key("metadata") - if err := awsRestjson1_serializeDocumentContentMetadata(v.Metadata, ok); err != nil { - return err - } + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.ModelId != nil { + ok := object.Key("modelId") + ok.String(*v.ModelId) } if v.Name != nil { @@ -341,11 +363,6 @@ func awsRestjson1_serializeOpDocumentCreateContentInput(v *CreateContentInput, v ok.String(*v.Name) } - if v.OverrideLinkOutUri != nil { - ok := object.Key("overrideLinkOutUri") - ok.String(*v.OverrideLinkOutUri) - } - if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { @@ -353,27 +370,39 @@ func awsRestjson1_serializeOpDocumentCreateContentInput(v *CreateContentInput, v } } - if v.Title != nil { - ok := object.Key("title") - ok.String(*v.Title) + if v.TemplateConfiguration != nil { + ok := object.Key("templateConfiguration") + if err := awsRestjson1_serializeDocumentAIPromptTemplateConfiguration(v.TemplateConfiguration, ok); err != nil { + return err + } } - if v.UploadId != nil { - ok := object.Key("uploadId") - ok.String(*v.UploadId) + if len(v.TemplateType) > 0 { + ok := object.Key("templateType") + ok.String(string(v.TemplateType)) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + if len(v.VisibilityStatus) > 0 { + ok := object.Key("visibilityStatus") + ok.String(string(v.VisibilityStatus)) } return nil } -type awsRestjson1_serializeOpCreateContentAssociation struct { +type awsRestjson1_serializeOpCreateAIPromptVersion struct { } -func (*awsRestjson1_serializeOpCreateContentAssociation) ID() string { +func (*awsRestjson1_serializeOpCreateAIPromptVersion) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpCreateContentAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateAIPromptVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -385,13 +414,13 @@ func (m *awsRestjson1_serializeOpCreateContentAssociation) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateContentAssociationInput) + input, ok := in.Parameters.(*CreateAIPromptVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/associations") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiprompts/{aiPromptId}/versions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -407,14 +436,14 @@ func (m *awsRestjson1_serializeOpCreateContentAssociation) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsCreateContentAssociationInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsCreateAIPromptVersionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateContentAssociationInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentCreateAIPromptVersionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -431,25 +460,25 @@ func (m *awsRestjson1_serializeOpCreateContentAssociation) HandleSerialize(ctx c span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsCreateContentAssociationInput(v *CreateContentAssociationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateAIPromptVersionInput(v *CreateAIPromptVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ContentId == nil || len(*v.ContentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + if v.AiPromptId == nil || len(*v.AiPromptId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiPromptId must not be empty")} } - if v.ContentId != nil { - if err := encoder.SetURI("contentId").String(*v.ContentId); err != nil { + if v.AiPromptId != nil { + if err := encoder.SetURI("aiPromptId").String(*v.AiPromptId); 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.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } @@ -457,45 +486,31 @@ func awsRestjson1_serializeOpHttpBindingsCreateContentAssociationInput(v *Create return nil } -func awsRestjson1_serializeOpDocumentCreateContentAssociationInput(v *CreateContentAssociationInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentCreateAIPromptVersionInput(v *CreateAIPromptVersionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Association != nil { - ok := object.Key("association") - if err := awsRestjson1_serializeDocumentContentAssociationContents(v.Association, ok); err != nil { - return err - } - } - - if len(v.AssociationType) > 0 { - ok := object.Key("associationType") - ok.String(string(v.AssociationType)) - } - if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { - return err - } + if v.ModifiedTime != nil { + ok := object.Key("modifiedTime") + ok.Double(smithytime.FormatEpochSeconds(*v.ModifiedTime)) } return nil } -type awsRestjson1_serializeOpCreateKnowledgeBase struct { +type awsRestjson1_serializeOpCreateAssistant struct { } -func (*awsRestjson1_serializeOpCreateKnowledgeBase) ID() string { +func (*awsRestjson1_serializeOpCreateAssistant) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpCreateKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -507,13 +522,13 @@ 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.(*CreateAssistantInput) _ = 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("/assistants") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -532,7 +547,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_serializeOpDocumentCreateAssistantInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -549,7 +564,7 @@ func (m *awsRestjson1_serializeOpCreateKnowledgeBase) HandleSerialize(ctx contex span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateAssistantInput(v *CreateAssistantInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -557,7 +572,7 @@ func awsRestjson1_serializeOpHttpBindingsCreateKnowledgeBaseInput(v *CreateKnowl return nil } -func awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentCreateAssistantInput(v *CreateAssistantInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -571,23 +586,11 @@ func awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(v *CreateKnowledge ok.String(*v.Description) } - if len(v.KnowledgeBaseType) > 0 { - ok := object.Key("knowledgeBaseType") - ok.String(string(v.KnowledgeBaseType)) - } - if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } - if v.RenderingConfiguration != nil { - ok := object.Key("renderingConfiguration") - if err := awsRestjson1_serializeDocumentRenderingConfiguration(v.RenderingConfiguration, ok); err != nil { - return err - } - } - if v.ServerSideEncryptionConfiguration != nil { ok := object.Key("serverSideEncryptionConfiguration") if err := awsRestjson1_serializeDocumentServerSideEncryptionConfiguration(v.ServerSideEncryptionConfiguration, ok); err != nil { @@ -595,13 +598,6 @@ func awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(v *CreateKnowledge } } - if v.SourceConfiguration != nil { - ok := object.Key("sourceConfiguration") - if err := awsRestjson1_serializeDocumentSourceConfiguration(v.SourceConfiguration, ok); err != nil { - return err - } - } - if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { @@ -609,17 +605,22 @@ func awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(v *CreateKnowledge } } + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + return nil } -type awsRestjson1_serializeOpCreateQuickResponse struct { +type awsRestjson1_serializeOpCreateAssistantAssociation struct { } -func (*awsRestjson1_serializeOpCreateQuickResponse) ID() string { +func (*awsRestjson1_serializeOpCreateAssistantAssociation) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpCreateQuickResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateAssistantAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -631,13 +632,13 @@ func (m *awsRestjson1_serializeOpCreateQuickResponse) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateQuickResponseInput) + input, ok := in.Parameters.(*CreateAssistantAssociationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/associations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -653,14 +654,14 @@ func (m *awsRestjson1_serializeOpCreateQuickResponse) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsCreateQuickResponseInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsCreateAssistantAssociationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateQuickResponseInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentCreateAssistantAssociationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -677,16 +678,16 @@ func (m *awsRestjson1_serializeOpCreateQuickResponse) HandleSerialize(ctx contex span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsCreateQuickResponseInput(v *CreateQuickResponseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateAssistantAssociationInput(v *CreateAssistantAssociationInput, 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.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } @@ -694,69 +695,1657 @@ func awsRestjson1_serializeOpHttpBindingsCreateQuickResponseInput(v *CreateQuick return nil } -func awsRestjson1_serializeOpDocumentCreateQuickResponseInput(v *CreateQuickResponseInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentCreateAssistantAssociationInput(v *CreateAssistantAssociationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Channels != nil { - ok := object.Key("channels") - if err := awsRestjson1_serializeDocumentChannels(v.Channels, ok); err != nil { + if v.Association != nil { + ok := object.Key("association") + if err := awsRestjson1_serializeDocumentAssistantAssociationInputData(v.Association, ok); err != nil { return err } } + if len(v.AssociationType) > 0 { + ok := object.Key("associationType") + ok.String(string(v.AssociationType)) + } + if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } - if v.Content != nil { - ok := object.Key("content") - if err := awsRestjson1_serializeDocumentQuickResponseDataProvider(v.Content, ok); err != nil { + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { return err } } - if v.ContentType != nil { - ok := object.Key("contentType") - ok.String(*v.ContentType) - } - - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) - } + return nil +} - if v.GroupingConfiguration != nil { - ok := object.Key("groupingConfiguration") - if err := awsRestjson1_serializeDocumentGroupingConfiguration(v.GroupingConfiguration, ok); err != nil { - return err - } - } +type awsRestjson1_serializeOpCreateContent struct { +} - if v.IsActive != nil { +func (*awsRestjson1_serializeOpCreateContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents") + 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_serializeOpHttpBindingsCreateContentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateContentInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateContentInput(v *CreateContentInput, 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_serializeOpDocumentCreateContentInput(v *CreateContentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Metadata != nil { + ok := object.Key("metadata") + if err := awsRestjson1_serializeDocumentContentMetadata(v.Metadata, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.OverrideLinkOutUri != nil { + ok := object.Key("overrideLinkOutUri") + ok.String(*v.OverrideLinkOutUri) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + if v.Title != nil { + ok := object.Key("title") + ok.String(*v.Title) + } + + if v.UploadId != nil { + ok := object.Key("uploadId") + ok.String(*v.UploadId) + } + + return nil +} + +type awsRestjson1_serializeOpCreateContentAssociation struct { +} + +func (*awsRestjson1_serializeOpCreateContentAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateContentAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateContentAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/associations") + 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_serializeOpHttpBindingsCreateContentAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateContentAssociationInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateContentAssociationInput(v *CreateContentAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContentId == nil || len(*v.ContentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + } + if v.ContentId != nil { + if err := encoder.SetURI("contentId").String(*v.ContentId); 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_serializeOpDocumentCreateContentAssociationInput(v *CreateContentAssociationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Association != nil { + ok := object.Key("association") + if err := awsRestjson1_serializeDocumentContentAssociationContents(v.Association, ok); err != nil { + return err + } + } + + if len(v.AssociationType) > 0 { + ok := object.Key("associationType") + ok.String(string(v.AssociationType)) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateKnowledgeBase struct { +} + +func (*awsRestjson1_serializeOpCreateKnowledgeBase) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateKnowledgeBaseInput) + _ = 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_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} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + 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.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if len(v.KnowledgeBaseType) > 0 { + ok := object.Key("knowledgeBaseType") + ok.String(string(v.KnowledgeBaseType)) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.RenderingConfiguration != nil { + ok := object.Key("renderingConfiguration") + if err := awsRestjson1_serializeDocumentRenderingConfiguration(v.RenderingConfiguration, ok); err != nil { + return err + } + } + + if v.ServerSideEncryptionConfiguration != nil { + ok := object.Key("serverSideEncryptionConfiguration") + if err := awsRestjson1_serializeDocumentServerSideEncryptionConfiguration(v.ServerSideEncryptionConfiguration, ok); err != nil { + return err + } + } + + if v.SourceConfiguration != nil { + ok := object.Key("sourceConfiguration") + if err := awsRestjson1_serializeDocumentSourceConfiguration(v.SourceConfiguration, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, 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_serializeOpCreateQuickResponse struct { +} + +func (*awsRestjson1_serializeOpCreateQuickResponse) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateQuickResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateQuickResponseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses") + 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_serializeOpHttpBindingsCreateQuickResponseInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateQuickResponseInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateQuickResponseInput(v *CreateQuickResponseInput, 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_serializeOpDocumentCreateQuickResponseInput(v *CreateQuickResponseInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Channels != nil { + ok := object.Key("channels") + if err := awsRestjson1_serializeDocumentChannels(v.Channels, ok); err != nil { + return err + } + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Content != nil { + ok := object.Key("content") + if err := awsRestjson1_serializeDocumentQuickResponseDataProvider(v.Content, ok); err != nil { + return err + } + } + + if v.ContentType != nil { + ok := object.Key("contentType") + ok.String(*v.ContentType) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.GroupingConfiguration != nil { + ok := object.Key("groupingConfiguration") + if err := awsRestjson1_serializeDocumentGroupingConfiguration(v.GroupingConfiguration, ok); err != nil { + return err + } + } + + if v.IsActive != nil { ok := object.Key("isActive") ok.Boolean(*v.IsActive) } - if v.Language != nil { - ok := object.Key("language") - ok.String(*v.Language) + if v.Language != nil { + ok := object.Key("language") + ok.String(*v.Language) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.ShortcutKey != nil { + ok := object.Key("shortcutKey") + ok.String(*v.ShortcutKey) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateSession struct { +} + +func (*awsRestjson1_serializeOpCreateSession) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateSessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions") + 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_serializeOpHttpBindingsCreateSessionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateSessionInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateSessionInput(v *CreateSessionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSessionInput(v *CreateSessionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AiAgentConfiguration != nil { + ok := object.Key("aiAgentConfiguration") + if err := awsRestjson1_serializeDocumentAIAgentConfigurationMap(v.AiAgentConfiguration, ok); err != nil { + return err + } + } + + 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.TagFilter != nil { + ok := object.Key("tagFilter") + if err := awsRestjson1_serializeDocumentTagFilter(v.TagFilter, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteAIAgent struct { +} + +func (*awsRestjson1_serializeOpDeleteAIAgent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAIAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteAIAgentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiagents/{aiAgentId}") + 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_serializeOpHttpBindingsDeleteAIAgentInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteAIAgentInput(v *DeleteAIAgentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AiAgentId == nil || len(*v.AiAgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiAgentId must not be empty")} + } + if v.AiAgentId != nil { + if err := encoder.SetURI("aiAgentId").String(*v.AiAgentId); err != nil { + return err + } + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteAIAgentVersion struct { +} + +func (*awsRestjson1_serializeOpDeleteAIAgentVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAIAgentVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteAIAgentVersionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiagents/{aiAgentId}/versions/{versionNumber}") + 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_serializeOpHttpBindingsDeleteAIAgentVersionInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteAIAgentVersionInput(v *DeleteAIAgentVersionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AiAgentId == nil || len(*v.AiAgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiAgentId must not be empty")} + } + if v.AiAgentId != nil { + if err := encoder.SetURI("aiAgentId").String(*v.AiAgentId); err != nil { + return err + } + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + if v.VersionNumber == nil { + return &smithy.SerializationError{Err: fmt.Errorf("input member versionNumber must not be empty")} + } + if v.VersionNumber != nil { + if err := encoder.SetURI("versionNumber").Long(*v.VersionNumber); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteAIPrompt struct { +} + +func (*awsRestjson1_serializeOpDeleteAIPrompt) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAIPrompt) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteAIPromptInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiprompts/{aiPromptId}") + 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_serializeOpHttpBindingsDeleteAIPromptInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteAIPromptInput(v *DeleteAIPromptInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AiPromptId == nil || len(*v.AiPromptId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiPromptId must not be empty")} + } + if v.AiPromptId != nil { + if err := encoder.SetURI("aiPromptId").String(*v.AiPromptId); err != nil { + return err + } + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteAIPromptVersion struct { +} + +func (*awsRestjson1_serializeOpDeleteAIPromptVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAIPromptVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteAIPromptVersionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiprompts/{aiPromptId}/versions/{versionNumber}") + 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_serializeOpHttpBindingsDeleteAIPromptVersionInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteAIPromptVersionInput(v *DeleteAIPromptVersionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AiPromptId == nil || len(*v.AiPromptId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiPromptId must not be empty")} + } + if v.AiPromptId != nil { + if err := encoder.SetURI("aiPromptId").String(*v.AiPromptId); err != nil { + return err + } + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + if v.VersionNumber == nil { + return &smithy.SerializationError{Err: fmt.Errorf("input member versionNumber must not be empty")} + } + if v.VersionNumber != nil { + if err := encoder.SetURI("versionNumber").Long(*v.VersionNumber); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteAssistant struct { +} + +func (*awsRestjson1_serializeOpDeleteAssistant) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteAssistantInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}") + 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_serializeOpHttpBindingsDeleteAssistantInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteAssistantInput(v *DeleteAssistantInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteAssistantAssociation struct { +} + +func (*awsRestjson1_serializeOpDeleteAssistantAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAssistantAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteAssistantAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/associations/{assistantAssociationId}") + 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_serializeOpHttpBindingsDeleteAssistantAssociationInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteAssistantAssociationInput(v *DeleteAssistantAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantAssociationId == nil || len(*v.AssistantAssociationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantAssociationId must not be empty")} + } + if v.AssistantAssociationId != nil { + if err := encoder.SetURI("assistantAssociationId").String(*v.AssistantAssociationId); err != nil { + return err + } + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteContent struct { +} + +func (*awsRestjson1_serializeOpDeleteContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}") + 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_serializeOpHttpBindingsDeleteContentInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteContentInput(v *DeleteContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContentId == nil || len(*v.ContentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + } + if v.ContentId != nil { + if err := encoder.SetURI("contentId").String(*v.ContentId); 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 +} + +type awsRestjson1_serializeOpDeleteContentAssociation struct { +} + +func (*awsRestjson1_serializeOpDeleteContentAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteContentAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteContentAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/associations/{contentAssociationId}") + 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_serializeOpHttpBindingsDeleteContentAssociationInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteContentAssociationInput(v *DeleteContentAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContentAssociationId == nil || len(*v.ContentAssociationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member contentAssociationId must not be empty")} + } + if v.ContentAssociationId != nil { + if err := encoder.SetURI("contentAssociationId").String(*v.ContentAssociationId); err != nil { + return err + } + } + + if v.ContentId == nil || len(*v.ContentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + } + if v.ContentId != nil { + if err := encoder.SetURI("contentId").String(*v.ContentId); 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 +} + +type awsRestjson1_serializeOpDeleteImportJob struct { +} + +func (*awsRestjson1_serializeOpDeleteImportJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteImportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteImportJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/importJobs/{importJobId}") + 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_serializeOpHttpBindingsDeleteImportJobInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteImportJobInput(v *DeleteImportJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ImportJobId == nil || len(*v.ImportJobId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member importJobId must not be empty")} + } + if v.ImportJobId != nil { + if err := encoder.SetURI("importJobId").String(*v.ImportJobId); 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 +} + +type awsRestjson1_serializeOpDeleteKnowledgeBase struct { +} + +func (*awsRestjson1_serializeOpDeleteKnowledgeBase) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*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}") + 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_serializeOpHttpBindingsDeleteKnowledgeBaseInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteKnowledgeBaseInput(v *DeleteKnowledgeBaseInput, 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 +} + +type awsRestjson1_serializeOpDeleteQuickResponse struct { +} + +func (*awsRestjson1_serializeOpDeleteQuickResponse) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteQuickResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteQuickResponseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}") + 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_serializeOpHttpBindingsDeleteQuickResponseInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteQuickResponseInput(v *DeleteQuickResponseInput, 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 + } + } + + if v.QuickResponseId == nil || len(*v.QuickResponseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member quickResponseId must not be empty")} + } + if v.QuickResponseId != nil { + if err := encoder.SetURI("quickResponseId").String(*v.QuickResponseId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetAIAgent struct { +} + +func (*awsRestjson1_serializeOpGetAIAgent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetAIAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetAIAgentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiagents/{aiAgentId}") + 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_serializeOpHttpBindingsGetAIAgentInput(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 - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetAIAgentInput(v *GetAIAgentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ShortcutKey != nil { - ok := object.Key("shortcutKey") - ok.String(*v.ShortcutKey) + if v.AiAgentId == nil || len(*v.AiAgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiAgentId must not be empty")} + } + if v.AiAgentId != nil { + if err := encoder.SetURI("aiAgentId").String(*v.AiAgentId); err != nil { + return err + } } - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } @@ -764,14 +2353,14 @@ func awsRestjson1_serializeOpDocumentCreateQuickResponseInput(v *CreateQuickResp return nil } -type awsRestjson1_serializeOpCreateSession struct { +type awsRestjson1_serializeOpGetAIPrompt struct { } -func (*awsRestjson1_serializeOpCreateSession) ID() string { +func (*awsRestjson1_serializeOpGetAIPrompt) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpCreateSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetAIPrompt) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -783,16 +2372,16 @@ func (m *awsRestjson1_serializeOpCreateSession) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateSessionInput) + input, ok := in.Parameters.(*GetAIPromptInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiprompts/{aiPromptId}") 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) @@ -805,18 +2394,7 @@ func (m *awsRestjson1_serializeOpCreateSession) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsCreateSessionInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateSessionInput(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_serializeOpHttpBindingsGetAIPromptInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -829,52 +2407,25 @@ func (m *awsRestjson1_serializeOpCreateSession) HandleSerialize(ctx context.Cont span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsCreateSessionInput(v *CreateSessionInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetAIPromptInput(v *GetAIPromptInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssistantId == nil || len(*v.AssistantId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + if v.AiPromptId == nil || len(*v.AiPromptId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiPromptId must not be empty")} } - if v.AssistantId != nil { - if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + if v.AiPromptId != nil { + if err := encoder.SetURI("aiPromptId").String(*v.AiPromptId); err != nil { return err } } - return nil -} - -func awsRestjson1_serializeOpDocumentCreateSessionInput(v *CreateSessionInput, 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.TagFilter != nil { - ok := object.Key("tagFilter") - if err := awsRestjson1_serializeDocumentTagFilter(v.TagFilter, ok); err != nil { - return err - } + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } @@ -882,14 +2433,14 @@ func awsRestjson1_serializeOpDocumentCreateSessionInput(v *CreateSessionInput, v return nil } -type awsRestjson1_serializeOpDeleteAssistant struct { +type awsRestjson1_serializeOpGetAssistant struct { } -func (*awsRestjson1_serializeOpDeleteAssistant) ID() string { +func (*awsRestjson1_serializeOpGetAssistant) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -901,7 +2452,7 @@ func (m *awsRestjson1_serializeOpDeleteAssistant) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteAssistantInput) + input, ok := in.Parameters.(*GetAssistantInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -910,7 +2461,7 @@ func (m *awsRestjson1_serializeOpDeleteAssistant) HandleSerialize(ctx context.Co opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}") 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) @@ -923,7 +2474,7 @@ func (m *awsRestjson1_serializeOpDeleteAssistant) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteAssistantInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetAssistantInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -936,7 +2487,7 @@ func (m *awsRestjson1_serializeOpDeleteAssistant) HandleSerialize(ctx context.Co span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteAssistantInput(v *DeleteAssistantInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetAssistantInput(v *GetAssistantInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -953,14 +2504,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteAssistantInput(v *DeleteAssistant return nil } -type awsRestjson1_serializeOpDeleteAssistantAssociation struct { +type awsRestjson1_serializeOpGetAssistantAssociation struct { } -func (*awsRestjson1_serializeOpDeleteAssistantAssociation) ID() string { +func (*awsRestjson1_serializeOpGetAssistantAssociation) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteAssistantAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetAssistantAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -972,7 +2523,7 @@ func (m *awsRestjson1_serializeOpDeleteAssistantAssociation) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteAssistantAssociationInput) + input, ok := in.Parameters.(*GetAssistantAssociationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -981,7 +2532,7 @@ func (m *awsRestjson1_serializeOpDeleteAssistantAssociation) HandleSerialize(ctx opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/associations/{assistantAssociationId}") 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) @@ -994,7 +2545,7 @@ func (m *awsRestjson1_serializeOpDeleteAssistantAssociation) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteAssistantAssociationInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetAssistantAssociationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1007,7 +2558,7 @@ func (m *awsRestjson1_serializeOpDeleteAssistantAssociation) HandleSerialize(ctx span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteAssistantAssociationInput(v *DeleteAssistantAssociationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetAssistantAssociationInput(v *GetAssistantAssociationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1033,14 +2584,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteAssistantAssociationInput(v *Dele return nil } -type awsRestjson1_serializeOpDeleteContent struct { +type awsRestjson1_serializeOpGetContent struct { } -func (*awsRestjson1_serializeOpDeleteContent) ID() string { +func (*awsRestjson1_serializeOpGetContent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1052,7 +2603,7 @@ func (m *awsRestjson1_serializeOpDeleteContent) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteContentInput) + input, ok := in.Parameters.(*GetContentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1061,7 +2612,7 @@ func (m *awsRestjson1_serializeOpDeleteContent) HandleSerialize(ctx context.Cont opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}") 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) @@ -1074,7 +2625,7 @@ func (m *awsRestjson1_serializeOpDeleteContent) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteContentInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetContentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1087,7 +2638,7 @@ func (m *awsRestjson1_serializeOpDeleteContent) HandleSerialize(ctx context.Cont span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteContentInput(v *DeleteContentInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetContentInput(v *GetContentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1113,14 +2664,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteContentInput(v *DeleteContentInpu return nil } -type awsRestjson1_serializeOpDeleteContentAssociation struct { +type awsRestjson1_serializeOpGetContentAssociation struct { } -func (*awsRestjson1_serializeOpDeleteContentAssociation) ID() string { +func (*awsRestjson1_serializeOpGetContentAssociation) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteContentAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetContentAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1132,7 +2683,7 @@ func (m *awsRestjson1_serializeOpDeleteContentAssociation) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteContentAssociationInput) + input, ok := in.Parameters.(*GetContentAssociationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1141,7 +2692,7 @@ func (m *awsRestjson1_serializeOpDeleteContentAssociation) HandleSerialize(ctx c opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/associations/{contentAssociationId}") 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) @@ -1154,7 +2705,7 @@ func (m *awsRestjson1_serializeOpDeleteContentAssociation) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteContentAssociationInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetContentAssociationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1167,7 +2718,7 @@ func (m *awsRestjson1_serializeOpDeleteContentAssociation) HandleSerialize(ctx c span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteContentAssociationInput(v *DeleteContentAssociationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetContentAssociationInput(v *GetContentAssociationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1202,14 +2753,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteContentAssociationInput(v *Delete return nil } -type awsRestjson1_serializeOpDeleteImportJob struct { +type awsRestjson1_serializeOpGetContentSummary struct { } -func (*awsRestjson1_serializeOpDeleteImportJob) ID() string { +func (*awsRestjson1_serializeOpGetContentSummary) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteImportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetContentSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1221,7 +2772,87 @@ func (m *awsRestjson1_serializeOpDeleteImportJob) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteImportJobInput) + input, ok := in.Parameters.(*GetContentSummaryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/summary") + 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_serializeOpHttpBindingsGetContentSummaryInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetContentSummaryInput(v *GetContentSummaryInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContentId == nil || len(*v.ContentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + } + if v.ContentId != nil { + if err := encoder.SetURI("contentId").String(*v.ContentId); 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 +} + +type awsRestjson1_serializeOpGetImportJob struct { +} + +func (*awsRestjson1_serializeOpGetImportJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetImportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetImportJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1230,7 +2861,7 @@ func (m *awsRestjson1_serializeOpDeleteImportJob) HandleSerialize(ctx context.Co opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/importJobs/{importJobId}") 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) @@ -1243,7 +2874,7 @@ func (m *awsRestjson1_serializeOpDeleteImportJob) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteImportJobInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetImportJobInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1256,7 +2887,7 @@ func (m *awsRestjson1_serializeOpDeleteImportJob) HandleSerialize(ctx context.Co span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteImportJobInput(v *DeleteImportJobInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetImportJobInput(v *GetImportJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1282,14 +2913,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteImportJobInput(v *DeleteImportJob return nil } -type awsRestjson1_serializeOpDeleteKnowledgeBase struct { +type awsRestjson1_serializeOpGetKnowledgeBase struct { } -func (*awsRestjson1_serializeOpDeleteKnowledgeBase) ID() string { +func (*awsRestjson1_serializeOpGetKnowledgeBase) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteKnowledgeBase) 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, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1301,7 +2932,7 @@ 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.(*GetKnowledgeBaseInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1310,7 +2941,7 @@ func (m *awsRestjson1_serializeOpDeleteKnowledgeBase) HandleSerialize(ctx contex 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 = "DELETE" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1323,7 +2954,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_serializeOpHttpBindingsGetKnowledgeBaseInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1336,7 +2967,7 @@ func (m *awsRestjson1_serializeOpDeleteKnowledgeBase) HandleSerialize(ctx contex span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteKnowledgeBaseInput(v *DeleteKnowledgeBaseInput, 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) } @@ -1353,14 +2984,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteKnowledgeBaseInput(v *DeleteKnowl return nil } -type awsRestjson1_serializeOpDeleteQuickResponse struct { +type awsRestjson1_serializeOpGetQuickResponse struct { } -func (*awsRestjson1_serializeOpDeleteQuickResponse) ID() string { +func (*awsRestjson1_serializeOpGetQuickResponse) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteQuickResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetQuickResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1372,7 +3003,7 @@ func (m *awsRestjson1_serializeOpDeleteQuickResponse) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteQuickResponseInput) + input, ok := in.Parameters.(*GetQuickResponseInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1381,7 +3012,7 @@ func (m *awsRestjson1_serializeOpDeleteQuickResponse) HandleSerialize(ctx contex opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}") 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) @@ -1394,7 +3025,7 @@ func (m *awsRestjson1_serializeOpDeleteQuickResponse) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteQuickResponseInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetQuickResponseInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1407,7 +3038,7 @@ func (m *awsRestjson1_serializeOpDeleteQuickResponse) HandleSerialize(ctx contex span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteQuickResponseInput(v *DeleteQuickResponseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetQuickResponseInput(v *GetQuickResponseInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1433,14 +3064,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteQuickResponseInput(v *DeleteQuick return nil } -type awsRestjson1_serializeOpGetAssistant struct { +type awsRestjson1_serializeOpGetRecommendations struct { } -func (*awsRestjson1_serializeOpGetAssistant) ID() string { +func (*awsRestjson1_serializeOpGetRecommendations) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetRecommendations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1452,13 +3083,13 @@ func (m *awsRestjson1_serializeOpGetAssistant) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAssistantInput) + input, ok := in.Parameters.(*GetRecommendationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}/recommendations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1474,7 +3105,7 @@ func (m *awsRestjson1_serializeOpGetAssistant) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetAssistantInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetRecommendationsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1487,7 +3118,7 @@ func (m *awsRestjson1_serializeOpGetAssistant) HandleSerialize(ctx context.Conte span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetAssistantInput(v *GetAssistantInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetRecommendationsInput(v *GetRecommendationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1501,17 +3132,34 @@ func awsRestjson1_serializeOpHttpBindingsGetAssistantInput(v *GetAssistantInput, } } + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.SessionId == nil || len(*v.SessionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")} + } + if v.SessionId != nil { + if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil { + return err + } + } + + if v.WaitTimeSeconds != 0 { + encoder.SetQuery("waitTimeSeconds").Integer(v.WaitTimeSeconds) + } + return nil } -type awsRestjson1_serializeOpGetAssistantAssociation struct { +type awsRestjson1_serializeOpGetSession struct { } -func (*awsRestjson1_serializeOpGetAssistantAssociation) ID() string { +func (*awsRestjson1_serializeOpGetSession) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetAssistantAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1523,13 +3171,13 @@ func (m *awsRestjson1_serializeOpGetAssistantAssociation) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAssistantAssociationInput) + input, ok := in.Parameters.(*GetSessionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/associations/{assistantAssociationId}") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1545,7 +3193,7 @@ func (m *awsRestjson1_serializeOpGetAssistantAssociation) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetAssistantAssociationInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetSessionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1558,25 +3206,25 @@ func (m *awsRestjson1_serializeOpGetAssistantAssociation) HandleSerialize(ctx co span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetAssistantAssociationInput(v *GetAssistantAssociationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetSessionInput(v *GetSessionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssistantAssociationId == nil || len(*v.AssistantAssociationId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assistantAssociationId must not be empty")} + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.AssistantAssociationId != nil { - if err := encoder.SetURI("assistantAssociationId").String(*v.AssistantAssociationId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } - if v.AssistantId == nil || len(*v.AssistantId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + if v.SessionId == nil || len(*v.SessionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")} } - if v.AssistantId != nil { - if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + if v.SessionId != nil { + if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil { return err } } @@ -1584,14 +3232,14 @@ func awsRestjson1_serializeOpHttpBindingsGetAssistantAssociationInput(v *GetAssi return nil } -type awsRestjson1_serializeOpGetContent struct { +type awsRestjson1_serializeOpListAIAgents struct { } -func (*awsRestjson1_serializeOpGetContent) ID() string { +func (*awsRestjson1_serializeOpListAIAgents) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListAIAgents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1603,13 +3251,13 @@ func (m *awsRestjson1_serializeOpGetContent) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetContentInput) + input, ok := in.Parameters.(*ListAIAgentsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiagents") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1625,7 +3273,7 @@ func (m *awsRestjson1_serializeOpGetContent) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetContentInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListAIAgentsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1638,40 +3286,43 @@ func (m *awsRestjson1_serializeOpGetContent) HandleSerialize(ctx context.Context span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetContentInput(v *GetContentInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListAIAgentsInput(v *ListAIAgentsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ContentId == nil || len(*v.ContentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.ContentId != nil { - if err := encoder.SetURI("contentId").String(*v.ContentId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); 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.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { - return err - } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.Origin) > 0 { + encoder.SetQuery("origin").String(string(v.Origin)) } return nil } -type awsRestjson1_serializeOpGetContentAssociation struct { +type awsRestjson1_serializeOpListAIAgentVersions struct { } -func (*awsRestjson1_serializeOpGetContentAssociation) ID() string { +func (*awsRestjson1_serializeOpListAIAgentVersions) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetContentAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListAIAgentVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1683,13 +3334,13 @@ func (m *awsRestjson1_serializeOpGetContentAssociation) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetContentAssociationInput) + input, ok := in.Parameters.(*ListAIAgentVersionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/associations/{contentAssociationId}") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiagents/{aiAgentId}/versions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1705,7 +3356,7 @@ func (m *awsRestjson1_serializeOpGetContentAssociation) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetContentAssociationInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListAIAgentVersionsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1718,49 +3369,52 @@ func (m *awsRestjson1_serializeOpGetContentAssociation) HandleSerialize(ctx cont span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetContentAssociationInput(v *GetContentAssociationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListAIAgentVersionsInput(v *ListAIAgentVersionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ContentAssociationId == nil || len(*v.ContentAssociationId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member contentAssociationId must not be empty")} + if v.AiAgentId == nil || len(*v.AiAgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiAgentId must not be empty")} } - if v.ContentAssociationId != nil { - if err := encoder.SetURI("contentAssociationId").String(*v.ContentAssociationId); err != nil { + if v.AiAgentId != nil { + if err := encoder.SetURI("aiAgentId").String(*v.AiAgentId); err != nil { return err } } - if v.ContentId == nil || len(*v.ContentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.ContentId != nil { - if err := encoder.SetURI("contentId").String(*v.ContentId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); 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.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { - return err - } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.Origin) > 0 { + encoder.SetQuery("origin").String(string(v.Origin)) } return nil } -type awsRestjson1_serializeOpGetContentSummary struct { +type awsRestjson1_serializeOpListAIPrompts struct { } -func (*awsRestjson1_serializeOpGetContentSummary) ID() string { +func (*awsRestjson1_serializeOpListAIPrompts) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetContentSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListAIPrompts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1772,13 +3426,13 @@ func (m *awsRestjson1_serializeOpGetContentSummary) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetContentSummaryInput) + input, ok := in.Parameters.(*ListAIPromptsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/summary") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiprompts") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1794,7 +3448,7 @@ func (m *awsRestjson1_serializeOpGetContentSummary) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetContentSummaryInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListAIPromptsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1807,40 +3461,43 @@ func (m *awsRestjson1_serializeOpGetContentSummary) HandleSerialize(ctx context. span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetContentSummaryInput(v *GetContentSummaryInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListAIPromptsInput(v *ListAIPromptsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ContentId == nil || len(*v.ContentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.ContentId != nil { - if err := encoder.SetURI("contentId").String(*v.ContentId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); 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.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { - return err - } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.Origin) > 0 { + encoder.SetQuery("origin").String(string(v.Origin)) } return nil } -type awsRestjson1_serializeOpGetImportJob struct { +type awsRestjson1_serializeOpListAIPromptVersions struct { } -func (*awsRestjson1_serializeOpGetImportJob) ID() string { +func (*awsRestjson1_serializeOpListAIPromptVersions) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetImportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListAIPromptVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1852,13 +3509,13 @@ func (m *awsRestjson1_serializeOpGetImportJob) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetImportJobInput) + input, ok := in.Parameters.(*ListAIPromptVersionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/importJobs/{importJobId}") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiprompts/{aiPromptId}/versions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1874,7 +3531,7 @@ func (m *awsRestjson1_serializeOpGetImportJob) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetImportJobInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListAIPromptVersionsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1887,40 +3544,52 @@ func (m *awsRestjson1_serializeOpGetImportJob) HandleSerialize(ctx context.Conte span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetImportJobInput(v *GetImportJobInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListAIPromptVersionsInput(v *ListAIPromptVersionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ImportJobId == nil || len(*v.ImportJobId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member importJobId must not be empty")} + if v.AiPromptId == nil || len(*v.AiPromptId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiPromptId must not be empty")} } - if v.ImportJobId != nil { - if err := encoder.SetURI("importJobId").String(*v.ImportJobId); err != nil { + if v.AiPromptId != nil { + if err := encoder.SetURI("aiPromptId").String(*v.AiPromptId); 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.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.Origin) > 0 { + encoder.SetQuery("origin").String(string(v.Origin)) + } + return nil } -type awsRestjson1_serializeOpGetKnowledgeBase struct { +type awsRestjson1_serializeOpListAssistantAssociations struct { } -func (*awsRestjson1_serializeOpGetKnowledgeBase) ID() string { +func (*awsRestjson1_serializeOpListAssistantAssociations) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListAssistantAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1932,13 +3601,13 @@ 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.(*ListAssistantAssociationsInput) _ = 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("/assistants/{assistantId}/associations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1954,7 +3623,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_serializeOpHttpBindingsListAssistantAssociationsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1967,31 +3636,39 @@ func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.C span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetKnowledgeBaseInput(v *GetKnowledgeBaseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListAssistantAssociationsInput(v *ListAssistantAssociationsInput, 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.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); 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_serializeOpGetQuickResponse struct { +type awsRestjson1_serializeOpListAssistants struct { } -func (*awsRestjson1_serializeOpGetQuickResponse) ID() string { +func (*awsRestjson1_serializeOpListAssistants) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetQuickResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListAssistants) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2003,13 +3680,13 @@ func (m *awsRestjson1_serializeOpGetQuickResponse) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetQuickResponseInput) + input, ok := in.Parameters.(*ListAssistantsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}") + opPath, opQuery := httpbinding.SplitURI("/assistants") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2025,7 +3702,7 @@ func (m *awsRestjson1_serializeOpGetQuickResponse) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetQuickResponseInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListAssistantsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2038,40 +3715,30 @@ func (m *awsRestjson1_serializeOpGetQuickResponse) HandleSerialize(ctx context.C span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetQuickResponseInput(v *GetQuickResponseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListAssistantsInput(v *ListAssistantsInput, 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 - } + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } - if v.QuickResponseId == nil || len(*v.QuickResponseId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member quickResponseId must not be empty")} - } - if v.QuickResponseId != nil { - if err := encoder.SetURI("quickResponseId").String(*v.QuickResponseId); err != nil { - return err - } + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } -type awsRestjson1_serializeOpGetRecommendations struct { +type awsRestjson1_serializeOpListContentAssociations struct { } -func (*awsRestjson1_serializeOpGetRecommendations) ID() string { +func (*awsRestjson1_serializeOpListContentAssociations) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetRecommendations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListContentAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2083,13 +3750,13 @@ func (m *awsRestjson1_serializeOpGetRecommendations) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetRecommendationsInput) + input, ok := in.Parameters.(*ListContentAssociationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}/recommendations") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/associations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2105,7 +3772,7 @@ func (m *awsRestjson1_serializeOpGetRecommendations) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetRecommendationsInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListContentAssociationsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2118,48 +3785,48 @@ func (m *awsRestjson1_serializeOpGetRecommendations) HandleSerialize(ctx context span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetRecommendationsInput(v *GetRecommendationsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListContentAssociationsInput(v *ListContentAssociationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssistantId == nil || len(*v.AssistantId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + if v.ContentId == nil || len(*v.ContentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} } - if v.AssistantId != nil { - if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + if v.ContentId != nil { + if err := encoder.SetURI("contentId").String(*v.ContentId); err != nil { return err } } - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.SessionId == nil || len(*v.SessionId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId 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.SessionId != nil { - if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil { + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { return err } } - if v.WaitTimeSeconds != 0 { - encoder.SetQuery("waitTimeSeconds").Integer(v.WaitTimeSeconds) + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } -type awsRestjson1_serializeOpGetSession struct { +type awsRestjson1_serializeOpListContents struct { } -func (*awsRestjson1_serializeOpGetSession) ID() string { +func (*awsRestjson1_serializeOpListContents) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListContents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2171,13 +3838,13 @@ func (m *awsRestjson1_serializeOpGetSession) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetSessionInput) + input, ok := in.Parameters.(*ListContentsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2193,7 +3860,7 @@ func (m *awsRestjson1_serializeOpGetSession) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetSessionInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListContentsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2206,40 +3873,39 @@ func (m *awsRestjson1_serializeOpGetSession) HandleSerialize(ctx context.Context span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetSessionInput(v *GetSessionInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListContentsInput(v *ListContentsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssistantId == nil || len(*v.AssistantId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId 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.AssistantId != nil { - if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { return err } } - if v.SessionId == nil || len(*v.SessionId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")} + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } - if v.SessionId != nil { - if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil { - return err - } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } -type awsRestjson1_serializeOpListAssistantAssociations struct { +type awsRestjson1_serializeOpListImportJobs struct { } -func (*awsRestjson1_serializeOpListAssistantAssociations) ID() string { +func (*awsRestjson1_serializeOpListImportJobs) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListAssistantAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListImportJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2251,13 +3917,13 @@ func (m *awsRestjson1_serializeOpListAssistantAssociations) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAssistantAssociationsInput) + input, ok := in.Parameters.(*ListImportJobsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/associations") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/importJobs") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2273,7 +3939,7 @@ func (m *awsRestjson1_serializeOpListAssistantAssociations) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListAssistantAssociationsInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListImportJobsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2286,16 +3952,16 @@ func (m *awsRestjson1_serializeOpListAssistantAssociations) HandleSerialize(ctx span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAssistantAssociationsInput(v *ListAssistantAssociationsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListImportJobsInput(v *ListImportJobsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssistantId == nil || len(*v.AssistantId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId 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.AssistantId != nil { - if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { return err } } @@ -2311,14 +3977,14 @@ func awsRestjson1_serializeOpHttpBindingsListAssistantAssociationsInput(v *ListA return nil } -type awsRestjson1_serializeOpListAssistants struct { +type awsRestjson1_serializeOpListKnowledgeBases struct { } -func (*awsRestjson1_serializeOpListAssistants) ID() string { +func (*awsRestjson1_serializeOpListKnowledgeBases) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListAssistants) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2330,13 +3996,13 @@ func (m *awsRestjson1_serializeOpListAssistants) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAssistantsInput) + 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("/assistants") + 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 = "GET" @@ -2352,7 +4018,7 @@ func (m *awsRestjson1_serializeOpListAssistants) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListAssistantsInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2365,7 +4031,7 @@ func (m *awsRestjson1_serializeOpListAssistants) HandleSerialize(ctx context.Con span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAssistantsInput(v *ListAssistantsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(v *ListKnowledgeBasesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2381,14 +4047,14 @@ func awsRestjson1_serializeOpHttpBindingsListAssistantsInput(v *ListAssistantsIn return nil } -type awsRestjson1_serializeOpListContentAssociations struct { +type awsRestjson1_serializeOpListQuickResponses struct { } -func (*awsRestjson1_serializeOpListContentAssociations) ID() string { +func (*awsRestjson1_serializeOpListQuickResponses) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListContentAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListQuickResponses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2400,13 +4066,13 @@ func (m *awsRestjson1_serializeOpListContentAssociations) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListContentAssociationsInput) + input, ok := in.Parameters.(*ListQuickResponsesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/associations") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2422,7 +4088,7 @@ func (m *awsRestjson1_serializeOpListContentAssociations) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListContentAssociationsInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListQuickResponsesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2435,20 +4101,11 @@ func (m *awsRestjson1_serializeOpListContentAssociations) HandleSerialize(ctx co span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListContentAssociationsInput(v *ListContentAssociationsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListQuickResponsesInput(v *ListQuickResponsesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ContentId == nil || len(*v.ContentId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} - } - if v.ContentId != nil { - if err := encoder.SetURI("contentId").String(*v.ContentId); 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")} } @@ -2469,14 +4126,14 @@ func awsRestjson1_serializeOpHttpBindingsListContentAssociationsInput(v *ListCon return nil } -type awsRestjson1_serializeOpListContents struct { +type awsRestjson1_serializeOpListTagsForResource struct { } -func (*awsRestjson1_serializeOpListContents) ID() string { +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListContents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2488,13 +4145,13 @@ func (m *awsRestjson1_serializeOpListContents) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListContentsInput) + 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("/knowledgeBases/{knowledgeBaseId}/contents") + 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" @@ -2510,7 +4167,7 @@ func (m *awsRestjson1_serializeOpListContents) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListContentsInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2523,39 +4180,31 @@ func (m *awsRestjson1_serializeOpListContents) HandleSerialize(ctx context.Conte span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListContentsInput(v *ListContentsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, 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.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); 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_serializeOpListImportJobs struct { +type awsRestjson1_serializeOpNotifyRecommendationsReceived struct { } -func (*awsRestjson1_serializeOpListImportJobs) ID() string { +func (*awsRestjson1_serializeOpNotifyRecommendationsReceived) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListImportJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpNotifyRecommendationsReceived) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2567,16 +4216,16 @@ func (m *awsRestjson1_serializeOpListImportJobs) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListImportJobsInput) + input, ok := in.Parameters.(*NotifyRecommendationsReceivedInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/importJobs") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}/recommendations/notify") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2589,7 +4238,18 @@ func (m *awsRestjson1_serializeOpListImportJobs) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListImportJobsInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsNotifyRecommendationsReceivedInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentNotifyRecommendationsReceivedInput(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} } @@ -2602,39 +4262,54 @@ func (m *awsRestjson1_serializeOpListImportJobs) HandleSerialize(ctx context.Con span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListImportJobsInput(v *ListImportJobsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsNotifyRecommendationsReceivedInput(v *NotifyRecommendationsReceivedInput, 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.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) + if v.SessionId == nil || len(*v.SessionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")} + } + if v.SessionId != nil { + if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil { + return err + } } - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) + return nil +} + +func awsRestjson1_serializeOpDocumentNotifyRecommendationsReceivedInput(v *NotifyRecommendationsReceivedInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RecommendationIds != nil { + ok := object.Key("recommendationIds") + if err := awsRestjson1_serializeDocumentRecommendationIdList(v.RecommendationIds, ok); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpListKnowledgeBases struct { +type awsRestjson1_serializeOpPutFeedback struct { } -func (*awsRestjson1_serializeOpListKnowledgeBases) ID() string { +func (*awsRestjson1_serializeOpPutFeedback) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpPutFeedback) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2646,16 +4321,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.(*PutFeedbackInput) _ = 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("/assistants/{assistantId}/feedback") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2668,43 +4343,79 @@ func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsPutFeedbackInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutFeedbackInput(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 + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutFeedbackInput(v *PutFeedbackInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } - endTimer() - span.End() - return next.HandleSerialize(ctx, in) + return nil } -func awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(v *ListKnowledgeBasesInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) + +func awsRestjson1_serializeOpDocumentPutFeedbackInput(v *PutFeedbackInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContentFeedback != nil { + ok := object.Key("contentFeedback") + if err := awsRestjson1_serializeDocumentContentFeedbackData(v.ContentFeedback, ok); err != nil { + return err + } } - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) + if v.TargetId != nil { + ok := object.Key("targetId") + ok.String(*v.TargetId) } - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) + if len(v.TargetType) > 0 { + ok := object.Key("targetType") + ok.String(string(v.TargetType)) } return nil } -type awsRestjson1_serializeOpListQuickResponses struct { +type awsRestjson1_serializeOpQueryAssistant struct { } -func (*awsRestjson1_serializeOpListQuickResponses) ID() string { +func (*awsRestjson1_serializeOpQueryAssistant) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListQuickResponses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpQueryAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2716,16 +4427,16 @@ func (m *awsRestjson1_serializeOpListQuickResponses) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListQuickResponsesInput) + input, ok := in.Parameters.(*QueryAssistantInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/query") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -2738,7 +4449,18 @@ func (m *awsRestjson1_serializeOpListQuickResponses) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListQuickResponsesInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsQueryAssistantInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentQueryAssistantInput(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} } @@ -2751,39 +4473,77 @@ func (m *awsRestjson1_serializeOpListQuickResponses) HandleSerialize(ctx context span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListQuickResponsesInput(v *ListQuickResponsesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsQueryAssistantInput(v *QueryAssistantInput, 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.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } + return nil +} + +func awsRestjson1_serializeOpDocumentQueryAssistantInput(v *QueryAssistantInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) } if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if len(v.OverrideKnowledgeBaseSearchType) > 0 { + ok := object.Key("overrideKnowledgeBaseSearchType") + ok.String(string(v.OverrideKnowledgeBaseSearchType)) + } + + if v.QueryCondition != nil { + ok := object.Key("queryCondition") + if err := awsRestjson1_serializeDocumentQueryConditionExpression(v.QueryCondition, ok); err != nil { + return err + } + } + + if v.QueryInputData != nil { + ok := object.Key("queryInputData") + if err := awsRestjson1_serializeDocumentQueryInputData(v.QueryInputData, ok); err != nil { + return err + } + } + + if v.QueryText != nil { + ok := object.Key("queryText") + ok.String(*v.QueryText) + } + + if v.SessionId != nil { + ok := object.Key("sessionId") + ok.String(*v.SessionId) } return nil } -type awsRestjson1_serializeOpListTagsForResource struct { +type awsRestjson1_serializeOpRemoveAssistantAIAgent struct { } -func (*awsRestjson1_serializeOpListTagsForResource) ID() string { +func (*awsRestjson1_serializeOpRemoveAssistantAIAgent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpRemoveAssistantAIAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2795,16 +4555,16 @@ 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.(*RemoveAssistantAIAgentInput) _ = 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("/assistants/{assistantId}/aiagentConfiguration") 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) @@ -2817,7 +4577,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_serializeOpHttpBindingsRemoveAssistantAIAgentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2830,16 +4590,20 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsRemoveAssistantAIAgentInput(v *RemoveAssistantAIAgentInput, 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 len(v.AiAgentType) > 0 { + encoder.SetQuery("aiAgentType").String(string(v.AiAgentType)) } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } @@ -2847,14 +4611,14 @@ func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsFor return nil } -type awsRestjson1_serializeOpNotifyRecommendationsReceived struct { +type awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri struct { } -func (*awsRestjson1_serializeOpNotifyRecommendationsReceived) ID() string { +func (*awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpNotifyRecommendationsReceived) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2866,16 +4630,16 @@ func (m *awsRestjson1_serializeOpNotifyRecommendationsReceived) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*NotifyRecommendationsReceivedInput) + input, ok := in.Parameters.(*RemoveKnowledgeBaseTemplateUriInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}/recommendations/notify") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/templateUri") 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) @@ -2888,18 +4652,7 @@ func (m *awsRestjson1_serializeOpNotifyRecommendationsReceived) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsNotifyRecommendationsReceivedInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentNotifyRecommendationsReceivedInput(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_serializeOpHttpBindingsRemoveKnowledgeBaseTemplateUriInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2912,39 +4665,16 @@ func (m *awsRestjson1_serializeOpNotifyRecommendationsReceived) HandleSerialize( span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsNotifyRecommendationsReceivedInput(v *NotifyRecommendationsReceivedInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsRemoveKnowledgeBaseTemplateUriInput(v *RemoveKnowledgeBaseTemplateUriInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssistantId == nil || len(*v.AssistantId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} - } - if v.AssistantId != nil { - if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { - return err - } - } - - if v.SessionId == nil || len(*v.SessionId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")} - } - if v.SessionId != nil { - if err := encoder.SetURI("sessionId").String(*v.SessionId); 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_serializeOpDocumentNotifyRecommendationsReceivedInput(v *NotifyRecommendationsReceivedInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.RecommendationIds != nil { - ok := object.Key("recommendationIds") - if err := awsRestjson1_serializeDocumentRecommendationIdList(v.RecommendationIds, ok); err != nil { + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { return err } } @@ -2952,14 +4682,14 @@ func awsRestjson1_serializeOpDocumentNotifyRecommendationsReceivedInput(v *Notif return nil } -type awsRestjson1_serializeOpPutFeedback struct { +type awsRestjson1_serializeOpSearchContent struct { } -func (*awsRestjson1_serializeOpPutFeedback) ID() string { +func (*awsRestjson1_serializeOpSearchContent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpPutFeedback) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpSearchContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2971,16 +4701,16 @@ func (m *awsRestjson1_serializeOpPutFeedback) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*PutFeedbackInput) + input, ok := in.Parameters.(*SearchContentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/feedback") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/search") 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) @@ -2993,14 +4723,14 @@ func (m *awsRestjson1_serializeOpPutFeedback) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsPutFeedbackInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsSearchContentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentPutFeedbackInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentSearchContentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3017,55 +4747,53 @@ func (m *awsRestjson1_serializeOpPutFeedback) HandleSerialize(ctx context.Contex span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsPutFeedbackInput(v *PutFeedbackInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsSearchContentInput(v *SearchContentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssistantId == nil || len(*v.AssistantId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId 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.AssistantId != nil { - if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); 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 } -func awsRestjson1_serializeOpDocumentPutFeedbackInput(v *PutFeedbackInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentSearchContentInput(v *SearchContentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.ContentFeedback != nil { - ok := object.Key("contentFeedback") - if err := awsRestjson1_serializeDocumentContentFeedbackData(v.ContentFeedback, ok); err != nil { + if v.SearchExpression != nil { + ok := object.Key("searchExpression") + if err := awsRestjson1_serializeDocumentSearchExpression(v.SearchExpression, ok); err != nil { return err } } - if v.TargetId != nil { - ok := object.Key("targetId") - ok.String(*v.TargetId) - } - - if len(v.TargetType) > 0 { - ok := object.Key("targetType") - ok.String(string(v.TargetType)) - } - return nil } -type awsRestjson1_serializeOpQueryAssistant struct { +type awsRestjson1_serializeOpSearchQuickResponses struct { } -func (*awsRestjson1_serializeOpQueryAssistant) ID() string { +func (*awsRestjson1_serializeOpSearchQuickResponses) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpQueryAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpSearchQuickResponses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3077,13 +4805,13 @@ func (m *awsRestjson1_serializeOpQueryAssistant) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*QueryAssistantInput) + input, ok := in.Parameters.(*SearchQuickResponsesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/query") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/search/quickResponses") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -3099,14 +4827,14 @@ func (m *awsRestjson1_serializeOpQueryAssistant) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsQueryAssistantInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsSearchQuickResponsesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentQueryAssistantInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentSearchQuickResponsesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3123,65 +4851,60 @@ func (m *awsRestjson1_serializeOpQueryAssistant) HandleSerialize(ctx context.Con span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsQueryAssistantInput(v *QueryAssistantInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsSearchQuickResponsesInput(v *SearchQuickResponsesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssistantId == nil || len(*v.AssistantId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId 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.AssistantId != nil { - if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); 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 } -func awsRestjson1_serializeOpDocumentQueryAssistantInput(v *QueryAssistantInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentSearchQuickResponsesInput(v *SearchQuickResponsesInput, 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.QueryCondition != nil { - ok := object.Key("queryCondition") - if err := awsRestjson1_serializeDocumentQueryConditionExpression(v.QueryCondition, ok); err != nil { + if v.Attributes != nil { + ok := object.Key("attributes") + if err := awsRestjson1_serializeDocumentContactAttributes(v.Attributes, ok); err != nil { return err } } - if v.QueryText != nil { - ok := object.Key("queryText") - ok.String(*v.QueryText) - } - - if v.SessionId != nil { - ok := object.Key("sessionId") - ok.String(*v.SessionId) + if v.SearchExpression != nil { + ok := object.Key("searchExpression") + if err := awsRestjson1_serializeDocumentQuickResponseSearchExpression(v.SearchExpression, ok); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri struct { +type awsRestjson1_serializeOpSearchSessions struct { } -func (*awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri) ID() string { +func (*awsRestjson1_serializeOpSearchSessions) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpSearchSessions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3193,16 +4916,16 @@ func (m *awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri) HandleSerialize return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*RemoveKnowledgeBaseTemplateUriInput) + input, ok := in.Parameters.(*SearchSessionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/templateUri") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/searchSessions") 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) @@ -3215,7 +4938,18 @@ func (m *awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri) HandleSerialize return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsRemoveKnowledgeBaseTemplateUriInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsSearchSessionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchSessionsInput(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} } @@ -3228,31 +4962,53 @@ func (m *awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri) HandleSerialize span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsRemoveKnowledgeBaseTemplateUriInput(v *RemoveKnowledgeBaseTemplateUriInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsSearchSessionsInput(v *SearchSessionsInput, 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.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); 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_serializeOpSearchContent struct { +func awsRestjson1_serializeOpDocumentSearchSessionsInput(v *SearchSessionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SearchExpression != nil { + ok := object.Key("searchExpression") + if err := awsRestjson1_serializeDocumentSearchExpression(v.SearchExpression, ok); err != nil { + return err + } + } + + return nil } -func (*awsRestjson1_serializeOpSearchContent) ID() string { +type awsRestjson1_serializeOpStartContentUpload struct { +} + +func (*awsRestjson1_serializeOpStartContentUpload) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpSearchContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpStartContentUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3264,13 +5020,13 @@ func (m *awsRestjson1_serializeOpSearchContent) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*SearchContentInput) + input, ok := in.Parameters.(*StartContentUploadInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/search") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/upload") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -3286,14 +5042,14 @@ func (m *awsRestjson1_serializeOpSearchContent) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsSearchContentInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsStartContentUploadInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentSearchContentInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentStartContentUploadInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3310,7 +5066,7 @@ func (m *awsRestjson1_serializeOpSearchContent) HandleSerialize(ctx context.Cont span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsSearchContentInput(v *SearchContentInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsStartContentUploadInput(v *StartContentUploadInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3324,39 +5080,34 @@ func awsRestjson1_serializeOpHttpBindingsSearchContentInput(v *SearchContentInpu } } - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - return nil } -func awsRestjson1_serializeOpDocumentSearchContentInput(v *SearchContentInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentStartContentUploadInput(v *StartContentUploadInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.SearchExpression != nil { - ok := object.Key("searchExpression") - if err := awsRestjson1_serializeDocumentSearchExpression(v.SearchExpression, ok); err != nil { - return err - } + if v.ContentType != nil { + ok := object.Key("contentType") + ok.String(*v.ContentType) + } + + if v.PresignedUrlTimeToLive != nil { + ok := object.Key("presignedUrlTimeToLive") + ok.Integer(*v.PresignedUrlTimeToLive) } return nil } -type awsRestjson1_serializeOpSearchQuickResponses struct { +type awsRestjson1_serializeOpStartImportJob struct { } -func (*awsRestjson1_serializeOpSearchQuickResponses) ID() string { +func (*awsRestjson1_serializeOpStartImportJob) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpSearchQuickResponses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpStartImportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3368,13 +5119,13 @@ func (m *awsRestjson1_serializeOpSearchQuickResponses) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*SearchQuickResponsesInput) + input, ok := in.Parameters.(*StartImportJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/search/quickResponses") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/importJobs") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -3390,14 +5141,14 @@ func (m *awsRestjson1_serializeOpSearchQuickResponses) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsSearchQuickResponsesInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsStartImportJobInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentSearchQuickResponsesInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentStartImportJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3414,7 +5165,7 @@ func (m *awsRestjson1_serializeOpSearchQuickResponses) HandleSerialize(ctx conte span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsSearchQuickResponsesInput(v *SearchQuickResponsesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsStartImportJobInput(v *StartImportJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3428,46 +5179,53 @@ func awsRestjson1_serializeOpHttpBindingsSearchQuickResponsesInput(v *SearchQuic } } - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - return nil } -func awsRestjson1_serializeOpDocumentSearchQuickResponsesInput(v *SearchQuickResponsesInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentStartImportJobInput(v *StartImportJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Attributes != nil { - ok := object.Key("attributes") - if err := awsRestjson1_serializeDocumentContactAttributes(v.Attributes, ok); err != nil { + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.ExternalSourceConfiguration != nil { + ok := object.Key("externalSourceConfiguration") + if err := awsRestjson1_serializeDocumentExternalSourceConfiguration(v.ExternalSourceConfiguration, ok); err != nil { return err } } - if v.SearchExpression != nil { - ok := object.Key("searchExpression") - if err := awsRestjson1_serializeDocumentQuickResponseSearchExpression(v.SearchExpression, ok); err != nil { + if len(v.ImportJobType) > 0 { + ok := object.Key("importJobType") + ok.String(string(v.ImportJobType)) + } + + if v.Metadata != nil { + ok := object.Key("metadata") + if err := awsRestjson1_serializeDocumentContentMetadata(v.Metadata, ok); err != nil { return err } } + if v.UploadId != nil { + ok := object.Key("uploadId") + ok.String(*v.UploadId) + } + return nil } -type awsRestjson1_serializeOpSearchSessions struct { +type awsRestjson1_serializeOpTagResource struct { } -func (*awsRestjson1_serializeOpSearchSessions) ID() string { +func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpSearchSessions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3479,13 +5237,13 @@ func (m *awsRestjson1_serializeOpSearchSessions) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*SearchSessionsInput) + 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("/assistants/{assistantId}/searchSessions") + 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" @@ -3501,14 +5259,14 @@ func (m *awsRestjson1_serializeOpSearchSessions) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsSearchSessionsInput(input, restEncoder); err != nil { + 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_serializeOpDocumentSearchSessionsInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3525,38 +5283,30 @@ func (m *awsRestjson1_serializeOpSearchSessions) HandleSerialize(ctx context.Con span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsSearchSessionsInput(v *SearchSessionsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssistantId == nil || len(*v.AssistantId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } - if v.AssistantId != nil { - if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); 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 } -func awsRestjson1_serializeOpDocumentSearchSessionsInput(v *SearchSessionsInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.SearchExpression != nil { - ok := object.Key("searchExpression") - if err := awsRestjson1_serializeDocumentSearchExpression(v.SearchExpression, ok); err != nil { + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { return err } } @@ -3564,14 +5314,14 @@ func awsRestjson1_serializeOpDocumentSearchSessionsInput(v *SearchSessionsInput, return nil } -type awsRestjson1_serializeOpStartContentUpload struct { +type awsRestjson1_serializeOpUntagResource struct { } -func (*awsRestjson1_serializeOpStartContentUpload) ID() string { +func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpStartContentUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3583,16 +5333,16 @@ func (m *awsRestjson1_serializeOpStartContentUpload) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartContentUploadInput) + 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("/knowledgeBases/{knowledgeBaseId}/upload") + 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" + request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -3605,18 +5355,7 @@ func (m *awsRestjson1_serializeOpStartContentUpload) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsStartContentUploadInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentStartContentUploadInput(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_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3629,48 +5368,37 @@ func (m *awsRestjson1_serializeOpStartContentUpload) HandleSerialize(ctx context span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsStartContentUploadInput(v *StartContentUploadInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, 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.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } - return nil -} - -func awsRestjson1_serializeOpDocumentStartContentUploadInput(v *StartContentUploadInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ContentType != nil { - ok := object.Key("contentType") - ok.String(*v.ContentType) - } - - if v.PresignedUrlTimeToLive != nil { - ok := object.Key("presignedUrlTimeToLive") - ok.Integer(*v.PresignedUrlTimeToLive) + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } } return nil } -type awsRestjson1_serializeOpStartImportJob struct { +type awsRestjson1_serializeOpUpdateAIAgent struct { } -func (*awsRestjson1_serializeOpStartImportJob) ID() string { +func (*awsRestjson1_serializeOpUpdateAIAgent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpStartImportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateAIAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3682,13 +5410,13 @@ func (m *awsRestjson1_serializeOpStartImportJob) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartImportJobInput) + input, ok := in.Parameters.(*UpdateAIAgentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/importJobs") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/aiagents/{aiAgentId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -3704,14 +5432,14 @@ func (m *awsRestjson1_serializeOpStartImportJob) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsStartImportJobInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsUpdateAIAgentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentStartImportJobInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentUpdateAIAgentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3728,16 +5456,25 @@ func (m *awsRestjson1_serializeOpStartImportJob) HandleSerialize(ctx context.Con span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsStartImportJobInput(v *StartImportJobInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateAIAgentInput(v *UpdateAIAgentInput, 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.AiAgentId == nil || len(*v.AiAgentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiAgentId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.AiAgentId != nil { + if err := encoder.SetURI("aiAgentId").String(*v.AiAgentId); err != nil { + return err + } + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } @@ -3745,7 +5482,7 @@ func awsRestjson1_serializeOpHttpBindingsStartImportJobInput(v *StartImportJobIn return nil } -func awsRestjson1_serializeOpDocumentStartImportJobInput(v *StartImportJobInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateAIAgentInput(v *UpdateAIAgentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3754,41 +5491,34 @@ func awsRestjson1_serializeOpDocumentStartImportJobInput(v *StartImportJobInput, ok.String(*v.ClientToken) } - if v.ExternalSourceConfiguration != nil { - ok := object.Key("externalSourceConfiguration") - if err := awsRestjson1_serializeDocumentExternalSourceConfiguration(v.ExternalSourceConfiguration, ok); err != nil { + if v.Configuration != nil { + ok := object.Key("configuration") + if err := awsRestjson1_serializeDocumentAIAgentConfiguration(v.Configuration, ok); err != nil { return err } } - if len(v.ImportJobType) > 0 { - ok := object.Key("importJobType") - ok.String(string(v.ImportJobType)) - } - - if v.Metadata != nil { - ok := object.Key("metadata") - if err := awsRestjson1_serializeDocumentContentMetadata(v.Metadata, ok); err != nil { - return err - } + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) } - if v.UploadId != nil { - ok := object.Key("uploadId") - ok.String(*v.UploadId) + if len(v.VisibilityStatus) > 0 { + ok := object.Key("visibilityStatus") + ok.String(string(v.VisibilityStatus)) } return nil } -type awsRestjson1_serializeOpTagResource struct { +type awsRestjson1_serializeOpUpdateAIPrompt struct { } -func (*awsRestjson1_serializeOpTagResource) ID() string { +func (*awsRestjson1_serializeOpUpdateAIPrompt) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateAIPrompt) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3800,13 +5530,13 @@ 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.(*UpdateAIPromptInput) _ = 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("/assistants/{assistantId}/aiprompts/{aiPromptId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -3822,14 +5552,14 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsUpdateAIPromptInput(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 { + if err := awsRestjson1_serializeOpDocumentUpdateAIPromptInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3846,16 +5576,25 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateAIPromptInput(v *UpdateAIPromptInput, 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.AiPromptId == nil || len(*v.AiPromptId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member aiPromptId must not be empty")} } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + if v.AiPromptId != nil { + if err := encoder.SetURI("aiPromptId").String(*v.AiPromptId); err != nil { + return err + } + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } @@ -3863,28 +5602,43 @@ func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, e return nil } -func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateAIPromptInput(v *UpdateAIPromptInput, 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 { + 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.TemplateConfiguration != nil { + ok := object.Key("templateConfiguration") + if err := awsRestjson1_serializeDocumentAIPromptTemplateConfiguration(v.TemplateConfiguration, ok); err != nil { return err } } + if len(v.VisibilityStatus) > 0 { + ok := object.Key("visibilityStatus") + ok.String(string(v.VisibilityStatus)) + } + return nil } -type awsRestjson1_serializeOpUntagResource struct { +type awsRestjson1_serializeOpUpdateAssistantAIAgent struct { } -func (*awsRestjson1_serializeOpUntagResource) ID() string { +func (*awsRestjson1_serializeOpUpdateAssistantAIAgent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateAssistantAIAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3896,16 +5650,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.(*UpdateAssistantAIAgentInput) _ = 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("/assistants/{assistantId}/aiagentConfiguration") 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) @@ -3918,7 +5672,18 @@ 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_serializeOpHttpBindingsUpdateAssistantAIAgentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateAssistantAIAgentInput(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} } @@ -3931,23 +5696,36 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateAssistantAIAgentInput(v *UpdateAssistantAIAgentInput, 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.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { return err } } - if v.TagKeys != nil { - for i := range v.TagKeys { - encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateAssistantAIAgentInput(v *UpdateAssistantAIAgentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AiAgentType) > 0 { + ok := object.Key("aiAgentType") + ok.String(string(v.AiAgentType)) + } + + if v.Configuration != nil { + ok := object.Key("configuration") + if err := awsRestjson1_serializeDocumentAIAgentConfigurationData(v.Configuration, ok); err != nil { + return err } } @@ -4342,14 +6120,131 @@ func awsRestjson1_serializeOpDocumentUpdateQuickResponseInput(v *UpdateQuickResp return nil } -type awsRestjson1_serializeOpUpdateSession struct { +type awsRestjson1_serializeOpUpdateSession struct { +} + +func (*awsRestjson1_serializeOpUpdateSession) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateSessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}") + 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_serializeOpHttpBindingsUpdateSessionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSessionInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateSessionInput(v *UpdateSessionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + if v.SessionId == nil || len(*v.SessionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")} + } + if v.SessionId != nil { + if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSessionInput(v *UpdateSessionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AiAgentConfiguration != nil { + ok := object.Key("aiAgentConfiguration") + if err := awsRestjson1_serializeDocumentAIAgentConfigurationMap(v.AiAgentConfiguration, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.TagFilter != nil { + ok := object.Key("tagFilter") + if err := awsRestjson1_serializeDocumentTagFilter(v.TagFilter, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateSessionData struct { } -func (*awsRestjson1_serializeOpUpdateSession) ID() string { +func (*awsRestjson1_serializeOpUpdateSessionData) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateSessionData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -4361,16 +6256,16 @@ func (m *awsRestjson1_serializeOpUpdateSession) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateSessionInput) + input, ok := in.Parameters.(*UpdateSessionDataInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}") + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}/data") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "PATCH" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -4383,14 +6278,14 @@ func (m *awsRestjson1_serializeOpUpdateSession) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateSessionInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsUpdateSessionDataInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateSessionInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentUpdateSessionDataInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -4407,7 +6302,7 @@ func (m *awsRestjson1_serializeOpUpdateSession) HandleSerialize(ctx context.Cont span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateSessionInput(v *UpdateSessionInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateSessionDataInput(v *UpdateSessionDataInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -4433,22 +6328,90 @@ func awsRestjson1_serializeOpHttpBindingsUpdateSessionInput(v *UpdateSessionInpu return nil } -func awsRestjson1_serializeOpDocumentUpdateSessionInput(v *UpdateSessionInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateSessionDataInput(v *UpdateSessionDataInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) + if v.Data != nil { + ok := object.Key("data") + if err := awsRestjson1_serializeDocumentRuntimeSessionDataList(v.Data, ok); err != nil { + return err + } } - if v.TagFilter != nil { - ok := object.Key("tagFilter") - if err := awsRestjson1_serializeDocumentTagFilter(v.TagFilter, ok); err != nil { + if len(v.Namespace) > 0 { + ok := object.Key("namespace") + ok.String(string(v.Namespace)) + } + + return nil +} + +func awsRestjson1_serializeDocumentAIAgentConfiguration(v types.AIAgentConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.AIAgentConfigurationMemberAnswerRecommendationAIAgentConfiguration: + av := object.Key("answerRecommendationAIAgentConfiguration") + if err := awsRestjson1_serializeDocumentAnswerRecommendationAIAgentConfiguration(&uv.Value, av); err != nil { + return err + } + + case *types.AIAgentConfigurationMemberManualSearchAIAgentConfiguration: + av := object.Key("manualSearchAIAgentConfiguration") + if err := awsRestjson1_serializeDocumentManualSearchAIAgentConfiguration(&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_serializeDocumentAIAgentConfigurationData(v *types.AIAgentConfigurationData, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AiAgentId != nil { + ok := object.Key("aiAgentId") + ok.String(*v.AiAgentId) + } + + return nil +} + +func awsRestjson1_serializeDocumentAIAgentConfigurationMap(v map[string]types.AIAgentConfigurationData, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + mapVar := v[key] + if err := awsRestjson1_serializeDocumentAIAgentConfigurationData(&mapVar, om); err != nil { return err } } + return nil +} + +func awsRestjson1_serializeDocumentAIPromptTemplateConfiguration(v types.AIPromptTemplateConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.AIPromptTemplateConfigurationMemberTextFullAIPromptEditTemplateConfiguration: + av := object.Key("textFullAIPromptEditTemplateConfiguration") + if err := awsRestjson1_serializeDocumentTextFullAIPromptEditTemplateConfiguration(&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 } @@ -4477,6 +6440,35 @@ func awsRestjson1_serializeDocumentAndConditions(v []types.TagCondition, value s return nil } +func awsRestjson1_serializeDocumentAnswerRecommendationAIAgentConfiguration(v *types.AnswerRecommendationAIAgentConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnswerGenerationAIPromptId != nil { + ok := object.Key("answerGenerationAIPromptId") + ok.String(*v.AnswerGenerationAIPromptId) + } + + if v.AssociationConfigurations != nil { + ok := object.Key("associationConfigurations") + if err := awsRestjson1_serializeDocumentAssociationConfigurationList(v.AssociationConfigurations, ok); err != nil { + return err + } + } + + if v.IntentLabelingGenerationAIPromptId != nil { + ok := object.Key("intentLabelingGenerationAIPromptId") + ok.String(*v.IntentLabelingGenerationAIPromptId) + } + + if v.QueryReformulationAIPromptId != nil { + ok := object.Key("queryReformulationAIPromptId") + ok.String(*v.QueryReformulationAIPromptId) + } + + return nil +} + func awsRestjson1_serializeDocumentAppIntegrationsConfiguration(v *types.AppIntegrationsConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4512,6 +6504,80 @@ func awsRestjson1_serializeDocumentAssistantAssociationInputData(v types.Assista return nil } +func awsRestjson1_serializeDocumentAssociationConfiguration(v *types.AssociationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssociationConfigurationData != nil { + ok := object.Key("associationConfigurationData") + if err := awsRestjson1_serializeDocumentAssociationConfigurationData(v.AssociationConfigurationData, ok); err != nil { + return err + } + } + + if v.AssociationId != nil { + ok := object.Key("associationId") + ok.String(*v.AssociationId) + } + + if len(v.AssociationType) > 0 { + ok := object.Key("associationType") + ok.String(string(v.AssociationType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentAssociationConfigurationData(v types.AssociationConfigurationData, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.AssociationConfigurationDataMemberKnowledgeBaseAssociationConfigurationData: + av := object.Key("knowledgeBaseAssociationConfigurationData") + if err := awsRestjson1_serializeDocumentKnowledgeBaseAssociationConfigurationData(&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_serializeDocumentAssociationConfigurationList(v []types.AssociationConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAssociationConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentBedrockFoundationModelConfigurationForParsing(v *types.BedrockFoundationModelConfigurationForParsing, 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_serializeDocumentChannels(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -4523,6 +6589,39 @@ func awsRestjson1_serializeDocumentChannels(v []string, value smithyjson.Value) 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_serializeDocumentConfiguration(v types.Configuration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4630,80 +6729,214 @@ func awsRestjson1_serializeDocumentExternalSourceConfiguration(v *types.External return nil } -func awsRestjson1_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Field) > 0 { + ok := object.Key("field") + ok.String(string(v.Field)) + } + + if len(v.Operator) > 0 { + ok := object.Key("operator") + ok.String(string(v.Operator)) + } + + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentFilterList(v []types.Filter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFilter(&v[i], av); err != nil { + return err + } + } + 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_serializeDocumentGenerativeContentFeedbackData(v *types.GenerativeContentFeedbackData, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Relevance) > 0 { + ok := object.Key("relevance") + ok.String(string(v.Relevance)) + } + + return nil +} + +func awsRestjson1_serializeDocumentGroupingConfiguration(v *types.GroupingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Criteria != nil { + ok := object.Key("criteria") + ok.String(*v.Criteria) + } + + if v.Values != nil { + ok := object.Key("values") + if err := awsRestjson1_serializeDocumentGroupingValues(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentGroupingValues(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_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 len(v.Field) > 0 { - ok := object.Key("field") - ok.String(string(v.Field)) - } - - if len(v.Operator) > 0 { - ok := object.Key("operator") - ok.String(string(v.Operator)) - } - - if v.Value != nil { - ok := object.Key("value") - ok.String(*v.Value) + if v.MaxTokens != nil { + ok := object.Key("maxTokens") + ok.Integer(*v.MaxTokens) } return nil } -func awsRestjson1_serializeDocumentFilterList(v []types.Filter, value smithyjson.Value) error { +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_serializeDocumentFilter(&v[i], av); err != nil { + if err := awsRestjson1_serializeDocumentHierarchicalChunkingLevelConfiguration(&v[i], av); err != nil { return err } } return nil } -func awsRestjson1_serializeDocumentGenerativeContentFeedbackData(v *types.GenerativeContentFeedbackData, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentIntentInputData(v *types.IntentInputData, value smithyjson.Value) error { object := value.Object() defer object.Close() - if len(v.Relevance) > 0 { - ok := object.Key("relevance") - ok.String(string(v.Relevance)) + if v.IntentId != nil { + ok := object.Key("intentId") + ok.String(*v.IntentId) } return nil } -func awsRestjson1_serializeDocumentGroupingConfiguration(v *types.GroupingConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentKnowledgeBaseAssociationConfigurationData(v *types.KnowledgeBaseAssociationConfigurationData, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Criteria != nil { - ok := object.Key("criteria") - ok.String(*v.Criteria) + if v.ContentTagFilter != nil { + ok := object.Key("contentTagFilter") + if err := awsRestjson1_serializeDocumentTagFilter(v.ContentTagFilter, ok); err != nil { + return err + } } - if v.Values != nil { - ok := object.Key("values") - if err := awsRestjson1_serializeDocumentGroupingValues(v.Values, ok); err != nil { + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if len(v.OverrideKnowledgeBaseSearchType) > 0 { + ok := object.Key("overrideKnowledgeBaseSearchType") + ok.String(string(v.OverrideKnowledgeBaseSearchType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentManagedSourceConfiguration(v types.ManagedSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ManagedSourceConfigurationMemberWebCrawlerConfiguration: + av := object.Key("webCrawlerConfiguration") + if err := awsRestjson1_serializeDocumentWebCrawlerConfiguration(&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_serializeDocumentGroupingValues(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() +func awsRestjson1_serializeDocumentManualSearchAIAgentConfiguration(v *types.ManualSearchAIAgentConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - for i := range v { - av := array.Value() - av.String(v[i]) + if v.AnswerGenerationAIPromptId != nil { + ok := object.Key("answerGenerationAIPromptId") + ok.String(*v.AnswerGenerationAIPromptId) + } + + if v.AssociationConfigurations != nil { + ok := object.Key("associationConfigurations") + if err := awsRestjson1_serializeDocumentAssociationConfigurationList(v.AssociationConfigurations, ok); err != nil { + return err + } } + return nil } @@ -4758,6 +6991,37 @@ func awsRestjson1_serializeDocumentOrConditions(v []types.OrCondition, value smi 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_serializeDocumentBedrockFoundationModelConfigurationForParsing(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_serializeDocumentQueryCondition(v types.QueryCondition, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4814,6 +7078,42 @@ func awsRestjson1_serializeDocumentQueryConditionItem(v *types.QueryConditionIte return nil } +func awsRestjson1_serializeDocumentQueryInputData(v types.QueryInputData, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.QueryInputDataMemberIntentInputData: + av := object.Key("intentInputData") + if err := awsRestjson1_serializeDocumentIntentInputData(&uv.Value, av); err != nil { + return err + } + + case *types.QueryInputDataMemberQueryTextInputData: + av := object.Key("queryTextInputData") + if err := awsRestjson1_serializeDocumentQueryTextInputData(&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_serializeDocumentQueryTextInputData(v *types.QueryTextInputData, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Text != nil { + ok := object.Key("text") + ok.String(*v.Text) + } + + return nil +} + func awsRestjson1_serializeDocumentQuickResponseDataProvider(v types.QuickResponseDataProvider, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5009,6 +7309,54 @@ func awsRestjson1_serializeDocumentRenderingConfiguration(v *types.RenderingConf return nil } +func awsRestjson1_serializeDocumentRuntimeSessionData(v *types.RuntimeSessionData, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("value") + if err := awsRestjson1_serializeDocumentRuntimeSessionDataValue(v.Value, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRuntimeSessionDataList(v []types.RuntimeSessionData, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRuntimeSessionData(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRuntimeSessionDataValue(v types.RuntimeSessionDataValue, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.RuntimeSessionDataValueMemberStringValue: + av := object.Key("stringValue") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + func awsRestjson1_serializeDocumentSearchExpression(v *types.SearchExpression, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5023,6 +7371,53 @@ func awsRestjson1_serializeDocumentSearchExpression(v *types.SearchExpression, v return nil } +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_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.BreakpointPercentileThreshold != nil { + ok := object.Key("breakpointPercentileThreshold") + ok.Integer(*v.BreakpointPercentileThreshold) + } + + if v.BufferSize != nil { + ok := object.Key("bufferSize") + ok.Integer(*v.BufferSize) + } + + if v.MaxTokens != nil { + ok := object.Key("maxTokens") + ok.Integer(*v.MaxTokens) + } + + return nil +} + func awsRestjson1_serializeDocumentServerSideEncryptionConfiguration(v *types.ServerSideEncryptionConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5046,6 +7441,12 @@ func awsRestjson1_serializeDocumentSourceConfiguration(v types.SourceConfigurati return err } + case *types.SourceConfigurationMemberManagedSourceConfiguration: + av := object.Key("managedSourceConfiguration") + if err := awsRestjson1_serializeDocumentManagedSourceConfiguration(uv.Value, av); err != nil { + return err + } + default: return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) @@ -5110,3 +7511,113 @@ func awsRestjson1_serializeDocumentTags(v map[string]string, value smithyjson.Va } return nil } + +func awsRestjson1_serializeDocumentTextFullAIPromptEditTemplateConfiguration(v *types.TextFullAIPromptEditTemplateConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Text != nil { + ok := object.Key("text") + ok.String(*v.Text) + } + + 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_serializeDocumentUrlFilterList(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_serializeDocumentVectorIngestionConfiguration(v *types.VectorIngestionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChunkingConfiguration != nil { + ok := object.Key("chunkingConfiguration") + if err := awsRestjson1_serializeDocumentChunkingConfiguration(v.ChunkingConfiguration, 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 +} + +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_serializeDocumentUrlFilterList(v.ExclusionFilters, ok); err != nil { + return err + } + } + + if v.InclusionFilters != nil { + ok := object.Key("inclusionFilters") + if err := awsRestjson1_serializeDocumentUrlFilterList(v.InclusionFilters, ok); err != nil { + return err + } + } + + if len(v.Scope) > 0 { + ok := object.Key("scope") + ok.String(string(v.Scope)) + } + + if v.UrlConfiguration != nil { + ok := object.Key("urlConfiguration") + if err := awsRestjson1_serializeDocumentUrlConfiguration(v.UrlConfiguration, ok); err != nil { + return err + } + } + + 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 +} diff --git a/service/qconnect/snapshot/api_op_CreateAIAgent.go.snap b/service/qconnect/snapshot/api_op_CreateAIAgent.go.snap new file mode 100644 index 00000000000..9819df059a3 --- /dev/null +++ b/service/qconnect/snapshot/api_op_CreateAIAgent.go.snap @@ -0,0 +1,42 @@ +CreateAIAgent + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_CreateAIAgentVersion.go.snap b/service/qconnect/snapshot/api_op_CreateAIAgentVersion.go.snap new file mode 100644 index 00000000000..c3317912d28 --- /dev/null +++ b/service/qconnect/snapshot/api_op_CreateAIAgentVersion.go.snap @@ -0,0 +1,42 @@ +CreateAIAgentVersion + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_CreateAIPrompt.go.snap b/service/qconnect/snapshot/api_op_CreateAIPrompt.go.snap new file mode 100644 index 00000000000..92a8ab5eb84 --- /dev/null +++ b/service/qconnect/snapshot/api_op_CreateAIPrompt.go.snap @@ -0,0 +1,42 @@ +CreateAIPrompt + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_CreateAIPromptVersion.go.snap b/service/qconnect/snapshot/api_op_CreateAIPromptVersion.go.snap new file mode 100644 index 00000000000..372ce8a1d12 --- /dev/null +++ b/service/qconnect/snapshot/api_op_CreateAIPromptVersion.go.snap @@ -0,0 +1,42 @@ +CreateAIPromptVersion + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_DeleteAIAgent.go.snap b/service/qconnect/snapshot/api_op_DeleteAIAgent.go.snap new file mode 100644 index 00000000000..95cafc70ed9 --- /dev/null +++ b/service/qconnect/snapshot/api_op_DeleteAIAgent.go.snap @@ -0,0 +1,41 @@ +DeleteAIAgent + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_DeleteAIAgentVersion.go.snap b/service/qconnect/snapshot/api_op_DeleteAIAgentVersion.go.snap new file mode 100644 index 00000000000..69195f16a68 --- /dev/null +++ b/service/qconnect/snapshot/api_op_DeleteAIAgentVersion.go.snap @@ -0,0 +1,41 @@ +DeleteAIAgentVersion + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_DeleteAIPrompt.go.snap b/service/qconnect/snapshot/api_op_DeleteAIPrompt.go.snap new file mode 100644 index 00000000000..783209a5846 --- /dev/null +++ b/service/qconnect/snapshot/api_op_DeleteAIPrompt.go.snap @@ -0,0 +1,41 @@ +DeleteAIPrompt + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_DeleteAIPromptVersion.go.snap b/service/qconnect/snapshot/api_op_DeleteAIPromptVersion.go.snap new file mode 100644 index 00000000000..78470e05ef9 --- /dev/null +++ b/service/qconnect/snapshot/api_op_DeleteAIPromptVersion.go.snap @@ -0,0 +1,41 @@ +DeleteAIPromptVersion + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_GetAIAgent.go.snap b/service/qconnect/snapshot/api_op_GetAIAgent.go.snap new file mode 100644 index 00000000000..1f5f71fe760 --- /dev/null +++ b/service/qconnect/snapshot/api_op_GetAIAgent.go.snap @@ -0,0 +1,41 @@ +GetAIAgent + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_GetAIPrompt.go.snap b/service/qconnect/snapshot/api_op_GetAIPrompt.go.snap new file mode 100644 index 00000000000..7ae9e2dfe12 --- /dev/null +++ b/service/qconnect/snapshot/api_op_GetAIPrompt.go.snap @@ -0,0 +1,41 @@ +GetAIPrompt + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_ListAIAgentVersions.go.snap b/service/qconnect/snapshot/api_op_ListAIAgentVersions.go.snap new file mode 100644 index 00000000000..6eb68a539e9 --- /dev/null +++ b/service/qconnect/snapshot/api_op_ListAIAgentVersions.go.snap @@ -0,0 +1,41 @@ +ListAIAgentVersions + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_ListAIAgents.go.snap b/service/qconnect/snapshot/api_op_ListAIAgents.go.snap new file mode 100644 index 00000000000..b26da919755 --- /dev/null +++ b/service/qconnect/snapshot/api_op_ListAIAgents.go.snap @@ -0,0 +1,41 @@ +ListAIAgents + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_ListAIPromptVersions.go.snap b/service/qconnect/snapshot/api_op_ListAIPromptVersions.go.snap new file mode 100644 index 00000000000..a06488b0c98 --- /dev/null +++ b/service/qconnect/snapshot/api_op_ListAIPromptVersions.go.snap @@ -0,0 +1,41 @@ +ListAIPromptVersions + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_ListAIPrompts.go.snap b/service/qconnect/snapshot/api_op_ListAIPrompts.go.snap new file mode 100644 index 00000000000..7f904a2f0d7 --- /dev/null +++ b/service/qconnect/snapshot/api_op_ListAIPrompts.go.snap @@ -0,0 +1,41 @@ +ListAIPrompts + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_RemoveAssistantAIAgent.go.snap b/service/qconnect/snapshot/api_op_RemoveAssistantAIAgent.go.snap new file mode 100644 index 00000000000..b464256af05 --- /dev/null +++ b/service/qconnect/snapshot/api_op_RemoveAssistantAIAgent.go.snap @@ -0,0 +1,41 @@ +RemoveAssistantAIAgent + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_UpdateAIAgent.go.snap b/service/qconnect/snapshot/api_op_UpdateAIAgent.go.snap new file mode 100644 index 00000000000..eddc0d93a9f --- /dev/null +++ b/service/qconnect/snapshot/api_op_UpdateAIAgent.go.snap @@ -0,0 +1,42 @@ +UpdateAIAgent + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_UpdateAIPrompt.go.snap b/service/qconnect/snapshot/api_op_UpdateAIPrompt.go.snap new file mode 100644 index 00000000000..dfa2f8390bd --- /dev/null +++ b/service/qconnect/snapshot/api_op_UpdateAIPrompt.go.snap @@ -0,0 +1,42 @@ +UpdateAIPrompt + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_UpdateAssistantAIAgent.go.snap b/service/qconnect/snapshot/api_op_UpdateAssistantAIAgent.go.snap new file mode 100644 index 00000000000..74f39f9d46a --- /dev/null +++ b/service/qconnect/snapshot/api_op_UpdateAssistantAIAgent.go.snap @@ -0,0 +1,41 @@ +UpdateAssistantAIAgent + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot/api_op_UpdateSessionData.go.snap b/service/qconnect/snapshot/api_op_UpdateSessionData.go.snap new file mode 100644 index 00000000000..d28323d1a5a --- /dev/null +++ b/service/qconnect/snapshot/api_op_UpdateSessionData.go.snap @@ -0,0 +1,41 @@ +UpdateSessionData + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qconnect/snapshot_test.go b/service/qconnect/snapshot_test.go index fa6ace04c2c..f2d71f928e4 100644 --- a/service/qconnect/snapshot_test.go +++ b/service/qconnect/snapshot_test.go @@ -62,6 +62,54 @@ func testSnapshot(stack *middleware.Stack, operation string) error { } return snapshotOK{} } +func TestCheckSnapshot_CreateAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_CreateAIAgentVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateAIAgentVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateAIAgentVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_CreateAIPrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateAIPrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateAIPrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_CreateAIPromptVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateAIPromptVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateAIPromptVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateAssistant(t *testing.T) { svc := New(Options{}) _, err := svc.CreateAssistant(context.Background(), nil, func(o *Options) { @@ -146,6 +194,54 @@ func TestCheckSnapshot_CreateSession(t *testing.T) { } } +func TestCheckSnapshot_DeleteAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteAIAgentVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteAIAgentVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteAIAgentVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteAIPrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteAIPrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteAIPrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteAIPromptVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteAIPromptVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteAIPromptVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteAssistant(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteAssistant(context.Background(), nil, func(o *Options) { @@ -230,6 +326,30 @@ func TestCheckSnapshot_DeleteQuickResponse(t *testing.T) { } } +func TestCheckSnapshot_GetAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetAIPrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetAIPrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetAIPrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetAssistant(t *testing.T) { svc := New(Options{}) _, err := svc.GetAssistant(context.Background(), nil, func(o *Options) { @@ -350,6 +470,54 @@ func TestCheckSnapshot_GetSession(t *testing.T) { } } +func TestCheckSnapshot_ListAIAgents(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAIAgents(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListAIAgents") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListAIAgentVersions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAIAgentVersions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListAIAgentVersions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListAIPrompts(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAIPrompts(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListAIPrompts") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListAIPromptVersions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAIPromptVersions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListAIPromptVersions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListAssistantAssociations(t *testing.T) { svc := New(Options{}) _, err := svc.ListAssistantAssociations(context.Background(), nil, func(o *Options) { @@ -482,6 +650,18 @@ func TestCheckSnapshot_QueryAssistant(t *testing.T) { } } +func TestCheckSnapshot_RemoveAssistantAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.RemoveAssistantAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "RemoveAssistantAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_RemoveKnowledgeBaseTemplateUri(t *testing.T) { svc := New(Options{}) _, err := svc.RemoveKnowledgeBaseTemplateUri(context.Background(), nil, func(o *Options) { @@ -578,6 +758,42 @@ func TestCheckSnapshot_UntagResource(t *testing.T) { } } +func TestCheckSnapshot_UpdateAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateAIPrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateAIPrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateAIPrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateAssistantAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateAssistantAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateAssistantAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateContent(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateContent(context.Background(), nil, func(o *Options) { @@ -625,6 +841,66 @@ func TestCheckSnapshot_UpdateSession(t *testing.T) { t.Fatal(err) } } + +func TestCheckSnapshot_UpdateSessionData(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateSessionData(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateSessionData") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} +func TestUpdateSnapshot_CreateAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_CreateAIAgentVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateAIAgentVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateAIAgentVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_CreateAIPrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateAIPrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateAIPrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_CreateAIPromptVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateAIPromptVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateAIPromptVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateAssistant(t *testing.T) { svc := New(Options{}) _, err := svc.CreateAssistant(context.Background(), nil, func(o *Options) { @@ -709,6 +985,54 @@ func TestUpdateSnapshot_CreateSession(t *testing.T) { } } +func TestUpdateSnapshot_DeleteAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteAIAgentVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteAIAgentVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteAIAgentVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteAIPrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteAIPrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteAIPrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteAIPromptVersion(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteAIPromptVersion(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteAIPromptVersion") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteAssistant(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteAssistant(context.Background(), nil, func(o *Options) { @@ -793,6 +1117,30 @@ func TestUpdateSnapshot_DeleteQuickResponse(t *testing.T) { } } +func TestUpdateSnapshot_GetAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetAIPrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetAIPrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetAIPrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetAssistant(t *testing.T) { svc := New(Options{}) _, err := svc.GetAssistant(context.Background(), nil, func(o *Options) { @@ -913,6 +1261,54 @@ func TestUpdateSnapshot_GetSession(t *testing.T) { } } +func TestUpdateSnapshot_ListAIAgents(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAIAgents(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListAIAgents") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListAIAgentVersions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAIAgentVersions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListAIAgentVersions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListAIPrompts(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAIPrompts(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListAIPrompts") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListAIPromptVersions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAIPromptVersions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListAIPromptVersions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListAssistantAssociations(t *testing.T) { svc := New(Options{}) _, err := svc.ListAssistantAssociations(context.Background(), nil, func(o *Options) { @@ -1045,6 +1441,18 @@ func TestUpdateSnapshot_QueryAssistant(t *testing.T) { } } +func TestUpdateSnapshot_RemoveAssistantAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.RemoveAssistantAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "RemoveAssistantAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_RemoveKnowledgeBaseTemplateUri(t *testing.T) { svc := New(Options{}) _, err := svc.RemoveKnowledgeBaseTemplateUri(context.Background(), nil, func(o *Options) { @@ -1141,6 +1549,42 @@ func TestUpdateSnapshot_UntagResource(t *testing.T) { } } +func TestUpdateSnapshot_UpdateAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateAIPrompt(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateAIPrompt(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateAIPrompt") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateAssistantAIAgent(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateAssistantAIAgent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateAssistantAIAgent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateContent(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateContent(context.Background(), nil, func(o *Options) { @@ -1188,3 +1632,15 @@ func TestUpdateSnapshot_UpdateSession(t *testing.T) { t.Fatal(err) } } + +func TestUpdateSnapshot_UpdateSessionData(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateSessionData(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateSessionData") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/qconnect/types/enums.go b/service/qconnect/types/enums.go index 5eea28445b9..7ef8e3cb78e 100644 --- a/service/qconnect/types/enums.go +++ b/service/qconnect/types/enums.go @@ -2,6 +2,100 @@ package types +type AIAgentAssociationConfigurationType string + +// Enum values for AIAgentAssociationConfigurationType +const ( + AIAgentAssociationConfigurationTypeKnowledgeBase AIAgentAssociationConfigurationType = "KNOWLEDGE_BASE" +) + +// Values returns all known values for AIAgentAssociationConfigurationType. 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 (AIAgentAssociationConfigurationType) Values() []AIAgentAssociationConfigurationType { + return []AIAgentAssociationConfigurationType{ + "KNOWLEDGE_BASE", + } +} + +type AIAgentType string + +// Enum values for AIAgentType +const ( + AIAgentTypeManualSearch AIAgentType = "MANUAL_SEARCH" + AIAgentTypeAnswerRecommendation AIAgentType = "ANSWER_RECOMMENDATION" +) + +// Values returns all known values for AIAgentType. 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 (AIAgentType) Values() []AIAgentType { + return []AIAgentType{ + "MANUAL_SEARCH", + "ANSWER_RECOMMENDATION", + } +} + +type AIPromptAPIFormat string + +// Enum values for AIPromptAPIFormat +const ( + AIPromptAPIFormatAnthropicClaudeMessages AIPromptAPIFormat = "ANTHROPIC_CLAUDE_MESSAGES" + AIPromptAPIFormatAnthropicClaudeTextCompletions AIPromptAPIFormat = "ANTHROPIC_CLAUDE_TEXT_COMPLETIONS" +) + +// Values returns all known values for AIPromptAPIFormat. 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 (AIPromptAPIFormat) Values() []AIPromptAPIFormat { + return []AIPromptAPIFormat{ + "ANTHROPIC_CLAUDE_MESSAGES", + "ANTHROPIC_CLAUDE_TEXT_COMPLETIONS", + } +} + +type AIPromptTemplateType string + +// Enum values for AIPromptTemplateType +const ( + AIPromptTemplateTypeText AIPromptTemplateType = "TEXT" +) + +// Values returns all known values for AIPromptTemplateType. 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 (AIPromptTemplateType) Values() []AIPromptTemplateType { + return []AIPromptTemplateType{ + "TEXT", + } +} + +type AIPromptType string + +// Enum values for AIPromptType +const ( + AIPromptTypeAnswerGeneration AIPromptType = "ANSWER_GENERATION" + AIPromptTypeIntentLabelingGeneration AIPromptType = "INTENT_LABELING_GENERATION" + AIPromptTypeQueryReformulation AIPromptType = "QUERY_REFORMULATION" +) + +// Values returns all known values for AIPromptType. 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 (AIPromptType) Values() []AIPromptType { + return []AIPromptType{ + "ANSWER_GENERATION", + "INTENT_LABELING_GENERATION", + "QUERY_REFORMULATION", + } +} + type AssistantCapabilityType string // Enum values for AssistantCapabilityType @@ -82,6 +176,29 @@ func (AssociationType) Values() []AssociationType { } } +type ChunkingStrategy string + +// Enum values for ChunkingStrategy +const ( + 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 +// 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 (ChunkingStrategy) Values() []ChunkingStrategy { + return []ChunkingStrategy{ + "FIXED_SIZE", + "NONE", + "HIERARCHICAL", + "SEMANTIC", + } +} + type ContentAssociationType string // Enum values for ContentAssociationType @@ -223,6 +340,25 @@ func (ImportJobType) Values() []ImportJobType { } } +type KnowledgeBaseSearchType string + +// Enum values for KnowledgeBaseSearchType +const ( + KnowledgeBaseSearchTypeHybrid KnowledgeBaseSearchType = "HYBRID" + KnowledgeBaseSearchTypeSemantic KnowledgeBaseSearchType = "SEMANTIC" +) + +// Values returns all known values for KnowledgeBaseSearchType. 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 (KnowledgeBaseSearchType) Values() []KnowledgeBaseSearchType { + return []KnowledgeBaseSearchType{ + "HYBRID", + "SEMANTIC", + } +} + type KnowledgeBaseStatus string // Enum values for KnowledgeBaseStatus @@ -254,9 +390,11 @@ type KnowledgeBaseType string // Enum values for KnowledgeBaseType const ( - KnowledgeBaseTypeExternal KnowledgeBaseType = "EXTERNAL" - KnowledgeBaseTypeCustom KnowledgeBaseType = "CUSTOM" - KnowledgeBaseTypeQuickResponses KnowledgeBaseType = "QUICK_RESPONSES" + KnowledgeBaseTypeExternal KnowledgeBaseType = "EXTERNAL" + KnowledgeBaseTypeCustom KnowledgeBaseType = "CUSTOM" + KnowledgeBaseTypeQuickResponses KnowledgeBaseType = "QUICK_RESPONSES" + KnowledgeBaseTypeMessageTemplates KnowledgeBaseType = "MESSAGE_TEMPLATES" + KnowledgeBaseTypeManaged KnowledgeBaseType = "MANAGED" ) // Values returns all known values for KnowledgeBaseType. Note that this can be @@ -268,6 +406,8 @@ func (KnowledgeBaseType) Values() []KnowledgeBaseType { "EXTERNAL", "CUSTOM", "QUICK_RESPONSES", + "MESSAGE_TEMPLATES", + "MANAGED", } } @@ -290,6 +430,42 @@ func (Order) Values() []Order { } } +type Origin string + +// Enum values for Origin +const ( + OriginSystem Origin = "SYSTEM" + OriginCustomer Origin = "CUSTOMER" +) + +// Values returns all known values for Origin. 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 (Origin) Values() []Origin { + return []Origin{ + "SYSTEM", + "CUSTOMER", + } +} + +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 Priority string // Enum values for Priority @@ -351,6 +527,7 @@ type QueryResultType string // Enum values for QueryResultType const ( QueryResultTypeKnowledgeContent QueryResultType = "KNOWLEDGE_CONTENT" + QueryResultTypeIntentAnswer QueryResultType = "INTENT_ANSWER" QueryResultTypeGenerativeAnswer QueryResultType = "GENERATIVE_ANSWER" ) @@ -361,6 +538,7 @@ const ( func (QueryResultType) Values() []QueryResultType { return []QueryResultType{ "KNOWLEDGE_CONTENT", + "INTENT_ANSWER", "GENERATIVE_ANSWER", } } @@ -481,6 +659,7 @@ const ( RecommendationTypeKnowledgeContent RecommendationType = "KNOWLEDGE_CONTENT" RecommendationTypeGenerativeResponse RecommendationType = "GENERATIVE_RESPONSE" RecommendationTypeGenerativeAnswer RecommendationType = "GENERATIVE_ANSWER" + RecommendationTypeDetectedIntent RecommendationType = "DETECTED_INTENT" ) // Values returns all known values for RecommendationType. Note that this can be @@ -492,6 +671,26 @@ func (RecommendationType) Values() []RecommendationType { "KNOWLEDGE_CONTENT", "GENERATIVE_RESPONSE", "GENERATIVE_ANSWER", + "DETECTED_INTENT", + } +} + +type ReferenceType string + +// Enum values for ReferenceType +const ( + ReferenceTypeWebCrawler ReferenceType = "WEB_CRAWLER" + ReferenceTypeKnowledgeBase ReferenceType = "KNOWLEDGE_BASE" +) + +// Values returns all known values for ReferenceType. 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 (ReferenceType) Values() []ReferenceType { + return []ReferenceType{ + "WEB_CRAWLER", + "KNOWLEDGE_BASE", } } @@ -535,6 +734,23 @@ func (RelevanceLevel) Values() []RelevanceLevel { } } +type SessionDataNamespace string + +// Enum values for SessionDataNamespace +const ( + SessionDataNamespaceCustom SessionDataNamespace = "Custom" +) + +// Values returns all known values for SessionDataNamespace. 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 (SessionDataNamespace) Values() []SessionDataNamespace { + return []SessionDataNamespace{ + "Custom", + } +} + type SourceContentType string // Enum values for SourceContentType @@ -552,6 +768,56 @@ func (SourceContentType) Values() []SourceContentType { } } +type Status string + +// Enum values for Status +const ( + StatusCreateInProgress Status = "CREATE_IN_PROGRESS" + StatusCreateFailed Status = "CREATE_FAILED" + StatusActive Status = "ACTIVE" + StatusDeleteInProgress Status = "DELETE_IN_PROGRESS" + StatusDeleteFailed Status = "DELETE_FAILED" + StatusDeleted Status = "DELETED" +) + +// Values returns all known values for Status. 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 (Status) Values() []Status { + return []Status{ + "CREATE_IN_PROGRESS", + "CREATE_FAILED", + "ACTIVE", + "DELETE_IN_PROGRESS", + "DELETE_FAILED", + "DELETED", + } +} + +type SyncStatus string + +// Enum values for SyncStatus +const ( + SyncStatusSyncFailed SyncStatus = "SYNC_FAILED" + SyncStatusSyncingInProgress SyncStatus = "SYNCING_IN_PROGRESS" + SyncStatusSyncSuccess SyncStatus = "SYNC_SUCCESS" + SyncStatusCreateInProgress SyncStatus = "CREATE_IN_PROGRESS" +) + +// Values returns all known values for SyncStatus. 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 (SyncStatus) Values() []SyncStatus { + return []SyncStatus{ + "SYNC_FAILED", + "SYNCING_IN_PROGRESS", + "SYNC_SUCCESS", + "CREATE_IN_PROGRESS", + } +} + type TargetType string // Enum values for TargetType @@ -570,3 +836,41 @@ func (TargetType) Values() []TargetType { "RESULT", } } + +type VisibilityStatus string + +// Enum values for VisibilityStatus +const ( + VisibilityStatusSaved VisibilityStatus = "SAVED" + VisibilityStatusPublished VisibilityStatus = "PUBLISHED" +) + +// Values returns all known values for VisibilityStatus. 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 (VisibilityStatus) Values() []VisibilityStatus { + return []VisibilityStatus{ + "SAVED", + "PUBLISHED", + } +} + +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/qconnect/types/types.go b/service/qconnect/types/types.go index 568901f1d66..2be0b21e00f 100644 --- a/service/qconnect/types/types.go +++ b/service/qconnect/types/types.go @@ -7,6 +7,371 @@ import ( "time" ) +// A typed union that specifies the configuration based on the type of AI Agent. +// +// The following types satisfy this interface: +// +// AIAgentConfigurationMemberAnswerRecommendationAIAgentConfiguration +// AIAgentConfigurationMemberManualSearchAIAgentConfiguration +type AIAgentConfiguration interface { + isAIAgentConfiguration() +} + +// The configuration for AI Agents of type ANSWER_RECOMMENDATION . +type AIAgentConfigurationMemberAnswerRecommendationAIAgentConfiguration struct { + Value AnswerRecommendationAIAgentConfiguration + + noSmithyDocumentSerde +} + +func (*AIAgentConfigurationMemberAnswerRecommendationAIAgentConfiguration) isAIAgentConfiguration() {} + +// The configuration for AI Agents of type MANUAL_SEARCH . +type AIAgentConfigurationMemberManualSearchAIAgentConfiguration struct { + Value ManualSearchAIAgentConfiguration + + noSmithyDocumentSerde +} + +func (*AIAgentConfigurationMemberManualSearchAIAgentConfiguration) isAIAgentConfiguration() {} + +// A type that specifies the AI Agent ID configuration data when mapping an AI +// Agents to be used for an AI Agent type on a session or assistant. +type AIAgentConfigurationData struct { + + // The ID of the AI Agent to be configured. + // + // This member is required. + AiAgentId *string + + noSmithyDocumentSerde +} + +// The data for the AI Agent. +type AIAgentData struct { + + // The Amazon Resource Name (ARN) of the AI agent. + // + // This member is required. + AiAgentArn *string + + // The identifier of the AI Agent. + // + // This member is required. + AiAgentId *string + + // The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant. + // + // This member is required. + AssistantArn *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // Configuration for the AI Agent. + // + // This member is required. + Configuration AIAgentConfiguration + + // The name of the AI Agent. + // + // This member is required. + Name *string + + // The type of the AI Agent. + // + // This member is required. + Type AIAgentType + + // The visibility status of the AI Agent. + // + // This member is required. + VisibilityStatus VisibilityStatus + + // The description of the AI Agent. + Description *string + + // The time the AI Agent was last modified. + ModifiedTime *time.Time + + // Specifies the origin of the AI Agent. SYSTEM for a default AI Agent created by + // Q in Connect or CUSTOMER for an AI Agent created by calling AI Agent creation + // APIs. + Origin Origin + + // The status of the AI Agent. + Status Status + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// The summary of the AI Agent. +type AIAgentSummary struct { + + // The Amazon Resource Name (ARN) of the AI agent. + // + // This member is required. + AiAgentArn *string + + // The identifier of the AI Agent. + // + // This member is required. + AiAgentId *string + + // The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant. + // + // This member is required. + AssistantArn *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The name of the AI Agent. + // + // This member is required. + Name *string + + // The type of the AI Agent. + // + // This member is required. + Type AIAgentType + + // The visibility status of the AI Agent. + // + // This member is required. + VisibilityStatus VisibilityStatus + + // The configuration for the AI Agent. + Configuration AIAgentConfiguration + + // The description of the AI Agent. + Description *string + + // The time the AI Agent was last modified. + ModifiedTime *time.Time + + // The origin of the AI Agent. SYSTEM for a default AI Agent created by Q in + // Connect or CUSTOMER for an AI Agent created by calling AI Agent creation APIs. + Origin Origin + + // The status of the AI Agent. + Status Status + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// The summary of the AI Agent version. +type AIAgentVersionSummary struct { + + // The data for the summary of the AI Agent version. + AiAgentSummary *AIAgentSummary + + // The version number for this AI Agent version. + VersionNumber *int64 + + noSmithyDocumentSerde +} + +// The data for the AI Prompt +type AIPromptData struct { + + // The Amazon Resource Name (ARN) of the AI Prompt. + // + // This member is required. + AiPromptArn *string + + // The identifier of the Amazon Q in Connect AI prompt. + // + // This member is required. + AiPromptId *string + + // The API format used for this AI Prompt. + // + // This member is required. + ApiFormat AIPromptAPIFormat + + // The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant. + // + // This member is required. + AssistantArn *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The identifier of the model used for this AI Prompt. Model Ids supported are: + // CLAUDE_3_HAIKU_20240307_V1 . + // + // This member is required. + ModelId *string + + // The name of the AI Prompt + // + // This member is required. + Name *string + + // The configuration of the prompt template for this AI Prompt. + // + // This member is required. + TemplateConfiguration AIPromptTemplateConfiguration + + // The type of the prompt template for this AI Prompt. + // + // This member is required. + TemplateType AIPromptTemplateType + + // The type of this AI Prompt. + // + // This member is required. + Type AIPromptType + + // The visibility status of the AI Prompt. + // + // This member is required. + VisibilityStatus VisibilityStatus + + // The description of the AI Prompt. + Description *string + + // The time the AI Prompt was last modified. + ModifiedTime *time.Time + + // The origin of the AI Prompt. SYSTEM for a default AI Prompt created by Q in + // Connect or CUSTOMER for an AI Prompt created by calling AI Prompt creation + // APIs. + Origin Origin + + // The status of the AI Prompt. + Status Status + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// The summary of the AI Prompt. +type AIPromptSummary struct { + + // The Amazon Resource Name (ARN) of the AI Prompt. + // + // This member is required. + AiPromptArn *string + + // The identifier of the Amazon Q in Connect AI prompt. + // + // This member is required. + AiPromptId *string + + // The API format used for this AI Prompt. + // + // This member is required. + ApiFormat AIPromptAPIFormat + + // The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant. + // + // This member is required. + AssistantArn *string + + // The identifier of the Amazon Q in Connect assistant. Can be either the ID or + // the ARN. URLs cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The identifier of the model used for this AI Prompt. Model Ids supported are: + // CLAUDE_3_HAIKU_20240307_V1 . + // + // This member is required. + ModelId *string + + // The name of the AI Prompt. + // + // This member is required. + Name *string + + // The type of the prompt template for this AI Prompt. + // + // This member is required. + TemplateType AIPromptTemplateType + + // The type of this AI Prompt. + // + // This member is required. + Type AIPromptType + + // The visibility status of the AI Prompt. + // + // This member is required. + VisibilityStatus VisibilityStatus + + // The description of the AI Prompt. + Description *string + + // The time the AI Prompt was last modified. + ModifiedTime *time.Time + + // The origin of the AI Prompt. SYSTEM for a default AI Prompt created by Q in + // Connect or CUSTOMER for an AI Prompt created by calling AI Prompt creation + // APIs. + Origin Origin + + // The status of the AI Prompt. + Status Status + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// A typed union that specifies the configuration for a prompt template based on +// its type. +// +// The following types satisfy this interface: +// +// AIPromptTemplateConfigurationMemberTextFullAIPromptEditTemplateConfiguration +type AIPromptTemplateConfiguration interface { + isAIPromptTemplateConfiguration() +} + +// The configuration for a prompt template that supports full textual prompt +// configuration using a YAML prompt. +type AIPromptTemplateConfigurationMemberTextFullAIPromptEditTemplateConfiguration struct { + Value TextFullAIPromptEditTemplateConfiguration + + noSmithyDocumentSerde +} + +func (*AIPromptTemplateConfigurationMemberTextFullAIPromptEditTemplateConfiguration) isAIPromptTemplateConfiguration() { +} + +// The summary of the AI Prompt version. +type AIPromptVersionSummary struct { + + // The date for the summary of the AI Prompt version. + AiPromptSummary *AIPromptSummary + + // The version number for this AI Prompt version. + VersionNumber *int64 + + noSmithyDocumentSerde +} + // Content association data for a [step-by-step guide]. // // [step-by-step guide]: https://docs.aws.amazon.com/connect/latest/adminguide/step-by-step-guided-experiences.html @@ -19,6 +384,27 @@ type AmazonConnectGuideAssociationData struct { noSmithyDocumentSerde } +// The configuration for the ANSWER_RECOMMENDATION AI Agent type. +type AnswerRecommendationAIAgentConfiguration struct { + + // The AI Prompt identifier for the Answer Generation prompt used by the + // ANSWER_RECOMMENDATION AI Agent. + AnswerGenerationAIPromptId *string + + // The association configurations for overriding behavior on this AI Agent. + AssociationConfigurations []AssociationConfiguration + + // The AI Prompt identifier for the Intent Labeling prompt used by the + // ANSWER_RECOMMENDATION AI Agent. + IntentLabelingGenerationAIPromptId *string + + // The AI Prompt identifier for the Query Reformulation prompt used by the + // ANSWER_RECOMMENDATION AI Agent. + QueryReformulationAIPromptId *string + + noSmithyDocumentSerde +} + // Configuration information for Amazon AppIntegrations to automatically ingest // content. type AppIntegrationsConfiguration struct { @@ -51,7 +437,7 @@ type AppIntegrationsConfiguration struct { // s3:GetObject , and s3:GetBucketLocation against the bucket. // // [ServiceNow]: https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/knowledge-management-api - // [Amazon S3]: https://aws.amazon.com/s3/ + // [Amazon S3]: http://aws.amazon.com/s3/ // [Zendesk]: https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/ // [SharePoint]: https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/sharepoint-net-server-csom-jsom-and-rest-api-index // [Salesforce]: https://developer.salesforce.com/docs/atlas.en-us.knowledge_dev.meta/knowledge_dev/sforce_api_objects_knowledge__kav.htm @@ -236,6 +622,10 @@ type AssistantData struct { // This member is required. Type AssistantType + // The configuration of the AI Agents (mapped by AI Agent Type to AI Agent + // version) that is set on the Amazon Q in Connect Assistant. + AiAgentConfiguration map[string]AIAgentConfigurationData + // The configuration information for the Amazon Q in Connect assistant capability. CapabilityConfiguration *AssistantCapabilityConfiguration @@ -303,6 +693,10 @@ type AssistantSummary struct { // This member is required. Type AssistantType + // The configuration of the AI Agents (mapped by AI Agent Type to AI Agent + // version) that is set on the Amazon Q in Connect Assistant. + AiAgentConfiguration map[string]AIAgentConfigurationData + // The configuration information for the Amazon Q in Connect assistant capability. CapabilityConfiguration *AssistantCapabilityConfiguration @@ -332,6 +726,101 @@ type AssistantSummary struct { noSmithyDocumentSerde } +// The configuration for an Amazon Q in Connect Assistant Association. +type AssociationConfiguration struct { + + // The data of the configuration for an Amazon Q in Connect Assistant Association. + AssociationConfigurationData AssociationConfigurationData + + // The identifier of the association for this Association Configuration. + AssociationId *string + + // The type of the association for this Association Configuration. + AssociationType AIAgentAssociationConfigurationType + + noSmithyDocumentSerde +} + +// A typed union of the data of the configuration for an Amazon Q in Connect +// Assistant Association. +// +// The following types satisfy this interface: +// +// AssociationConfigurationDataMemberKnowledgeBaseAssociationConfigurationData +type AssociationConfigurationData interface { + isAssociationConfigurationData() +} + +// The data of the configuration for a KNOWLEDGE_BASE type Amazon Q in Connect +// Assistant Association. +type AssociationConfigurationDataMemberKnowledgeBaseAssociationConfigurationData struct { + Value KnowledgeBaseAssociationConfigurationData + + noSmithyDocumentSerde +} + +func (*AssociationConfigurationDataMemberKnowledgeBaseAssociationConfigurationData) isAssociationConfigurationData() { +} + +// Settings for a foundation model used to parse documents for a data source. +type BedrockFoundationModelConfigurationForParsing struct { + + // The ARN of the foundation model. + // + // 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. +type ChunkingConfiguration struct { + + // Knowledge base can split your source data into chunks. A chunk refers to an + // excerpt from a data source that is returned when the knowledge base that it + // belongs to is queried. You have the following options for chunking your data. If + // you opt for NONE , then you may want to pre-process your files by splitting them + // up such that each file corresponds to a chunk. + // + // This member is required. + ChunkingStrategy ChunkingStrategy + + // Configurations for when you choose fixed-size chunking. If you set the + // 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 smaller documents based on groups of similar content + // derived from the text with natural language processing. + SemanticChunkingConfiguration *SemanticChunkingConfiguration + + noSmithyDocumentSerde +} + +// Contains information about where the text with a citation begins and ends in +// the generated output. +type CitationSpan struct { + + // Where the text with a citation starts in the generated output. + BeginOffsetInclusive int32 + + // Where the text with a citation ends in the generated output. + EndOffsetExclusive int32 + + noSmithyDocumentSerde +} + // The configuration information of the external data source. // // The following types satisfy this interface: @@ -604,6 +1093,12 @@ type ContentReference struct { // knowledge base. KnowledgeBaseId *string + // The type of reference content. + ReferenceType ReferenceType + + // The web URL of the source content. + SourceURL *string + noSmithyDocumentSerde } @@ -676,6 +1171,7 @@ type ContentSummary struct { // // DataDetailsMemberContentData // DataDetailsMemberGenerativeData +// DataDetailsMemberIntentDetectedData // DataDetailsMemberSourceContentData type DataDetails interface { isDataDetails() @@ -699,6 +1195,15 @@ type DataDetailsMemberGenerativeData struct { func (*DataDetailsMemberGenerativeData) isDataDetails() {} +// Details about the intent data. +type DataDetailsMemberIntentDetectedData struct { + Value IntentDetectedDataDetails + + noSmithyDocumentSerde +} + +func (*DataDetailsMemberIntentDetectedData) isDataDetails() {} + // Details about the content data. type DataDetailsMemberSourceContentData struct { Value SourceContentDataDetails @@ -818,6 +1323,23 @@ type Filter struct { noSmithyDocumentSerde } +// Configurations for when you choose fixed-size chunking. If you set the +// chunkingStrategy as NONE , exclude this field. +type FixedSizeChunkingConfiguration struct { + + // The maximum number of tokens to include in a chunk. + // + // This member is required. + MaxTokens *int32 + + // The percentage of overlap between adjacent chunks of a data source. + // + // This member is required. + OverlapPercentage *int32 + + noSmithyDocumentSerde +} + // The feedback information for a generative target type. type GenerativeContentFeedbackData struct { @@ -888,6 +1410,36 @@ type GroupingConfiguration struct { 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. +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 each layer. +type HierarchicalChunkingLevelConfiguration struct { + + // The maximum number of tokens that a chunk can contain in this layer. + // + // This member is required. + MaxTokens *int32 + + noSmithyDocumentSerde +} + // Offset specification to describe highlighting of document excerpts for // rendering search results and recommendations. type Highlight struct { @@ -1024,6 +1576,51 @@ type ImportJobSummary struct { noSmithyDocumentSerde } +// Details about the detected intent. +type IntentDetectedDataDetails struct { + + // The detected intent. + // + // This member is required. + Intent *string + + // The identifier of the detected intent. + // + // This member is required. + IntentId *string + + noSmithyDocumentSerde +} + +// Information about the Amazon Q intent. +type IntentInputData struct { + + // The identifier of the Amazon Q intent. + // + // This member is required. + IntentId *string + + noSmithyDocumentSerde +} + +// The data of the configuration for a KNOWLEDGE_BASE type Amazon Q in Connect +// Assistant Association. +type KnowledgeBaseAssociationConfigurationData struct { + + // An object that can be used to specify Tag conditions. + ContentTagFilter TagFilter + + // The maximum number of results to return per page. + MaxResults *int32 + + // The search type to be used against the Knowledge Base for this request. The + // values can be SEMANTIC which uses vector embeddings or HYBRID which use vector + // embeddings and raw text + OverrideKnowledgeBaseSearchType KnowledgeBaseSearchType + + noSmithyDocumentSerde +} + // Association information about the knowledge base. type KnowledgeBaseAssociationData struct { @@ -1067,6 +1664,12 @@ type KnowledgeBaseData struct { // The description. Description *string + // List of failure reasons on ingestion per file. + IngestionFailureReasons []string + + // Status of ingestion on data source. + IngestionStatus SyncStatus + // An epoch timestamp indicating the most recent content modification inside the // knowledge base. If no content exists in a knowledge base, this value is unset. LastContentModificationTime *time.Time @@ -1092,6 +1695,9 @@ type KnowledgeBaseData struct { // The tags used to organize, track, or control access for this resource. Tags map[string]string + // Contains details about how to ingest the documents in a data source. + VectorIngestionConfiguration *VectorIngestionConfiguration + noSmithyDocumentSerde } @@ -1147,6 +1753,40 @@ type KnowledgeBaseSummary struct { // The tags used to organize, track, or control access for this resource. Tags map[string]string + // Contains details about how to ingest the documents in a data source. + VectorIngestionConfiguration *VectorIngestionConfiguration + + noSmithyDocumentSerde +} + +// Source configuration for managed resources. +// +// The following types satisfy this interface: +// +// ManagedSourceConfigurationMemberWebCrawlerConfiguration +type ManagedSourceConfiguration interface { + isManagedSourceConfiguration() +} + +// Configuration data for web crawler data source. +type ManagedSourceConfigurationMemberWebCrawlerConfiguration struct { + Value WebCrawlerConfiguration + + noSmithyDocumentSerde +} + +func (*ManagedSourceConfigurationMemberWebCrawlerConfiguration) isManagedSourceConfiguration() {} + +// The configuration for the MANUAL_SEARCH AI Agent type. +type ManualSearchAIAgentConfiguration struct { + + // The AI Prompt identifier for the Answer Generation prompt used by the + // MANUAL_SEARCH AI Agent. + AnswerGenerationAIPromptId *string + + // The association configurations for overriding behavior on this AI Agent. + AssociationConfigurations []AssociationConfiguration + noSmithyDocumentSerde } @@ -1190,6 +1830,35 @@ type OrConditionMemberTagCondition struct { func (*OrConditionMemberTagCondition) isOrCondition() {} +// 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. +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 *BedrockFoundationModelConfigurationForParsing + + 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 +} + // Information about how to query content. // // The following types satisfy this interface: @@ -1229,6 +1898,34 @@ type QueryConditionItem struct { noSmithyDocumentSerde } +// Input information for the query. +// +// The following types satisfy this interface: +// +// QueryInputDataMemberIntentInputData +// QueryInputDataMemberQueryTextInputData +type QueryInputData interface { + isQueryInputData() +} + +// Input information for the intent. +type QueryInputDataMemberIntentInputData struct { + Value IntentInputData + + noSmithyDocumentSerde +} + +func (*QueryInputDataMemberIntentInputData) isQueryInputData() {} + +// Input information for the query. +type QueryInputDataMemberQueryTextInputData struct { + Value QueryTextInputData + + noSmithyDocumentSerde +} + +func (*QueryInputDataMemberQueryTextInputData) isQueryInputData() {} + // Data associated with the QUERY RecommendationTriggerType. type QueryRecommendationTriggerData struct { @@ -1238,6 +1935,17 @@ type QueryRecommendationTriggerData struct { noSmithyDocumentSerde } +// Information about the text to search for. +type QueryTextInputData struct { + + // The text to search for. + // + // This member is required. + Text *string + + noSmithyDocumentSerde +} + // The container quick response content. // // The following types satisfy this interface: @@ -1835,6 +2543,40 @@ type ResultData struct { noSmithyDocumentSerde } +// The list of key-value pairs that are stored on the session. +type RuntimeSessionData struct { + + // The key of the data stored on the session. + // + // This member is required. + Key *string + + // The value of the data stored on the session. + // + // This member is required. + Value RuntimeSessionDataValue + + noSmithyDocumentSerde +} + +// A union type that specifies the data stored on the session. +// +// The following types satisfy this interface: +// +// RuntimeSessionDataValueMemberStringValue +type RuntimeSessionDataValue interface { + isRuntimeSessionDataValue() +} + +// The string value of the data stored on the session. +type RuntimeSessionDataValueMemberStringValue struct { + Value string + + noSmithyDocumentSerde +} + +func (*RuntimeSessionDataValueMemberStringValue) isRuntimeSessionDataValue() {} + // The search expression. type SearchExpression struct { @@ -1846,6 +2588,38 @@ type SearchExpression struct { noSmithyDocumentSerde } +// A URL for crawling. +type SeedUrl struct { + + // URL for crawling + Url *string + + noSmithyDocumentSerde +} + +// Settings for semantic document chunking for a data source. Semantic chunking +// splits a document into smaller documents based on groups of similar content +// derived from the text with natural language processing. +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 +} + // The configuration information for the customer managed key used for encryption. type ServerSideEncryptionConfiguration struct { @@ -1878,6 +2652,10 @@ type SessionData struct { // This member is required. SessionId *string + // The configuration of the AI Agents (mapped by AI Agent Type to AI Agent + // version) that should be used by Amazon Q in Connect for this Session. + AiAgentConfiguration map[string]AIAgentConfigurationData + // The description of the session. Description *string @@ -1934,6 +2712,7 @@ type SessionSummary struct { // The following types satisfy this interface: // // SourceConfigurationMemberAppIntegrations +// SourceConfigurationMemberManagedSourceConfiguration type SourceConfiguration interface { isSourceConfiguration() } @@ -1948,6 +2727,15 @@ type SourceConfigurationMemberAppIntegrations struct { func (*SourceConfigurationMemberAppIntegrations) isSourceConfiguration() {} +// Source configuration for managed resources. +type SourceConfigurationMemberManagedSourceConfiguration struct { + Value ManagedSourceConfiguration + + noSmithyDocumentSerde +} + +func (*SourceConfigurationMemberManagedSourceConfiguration) isSourceConfiguration() {} + // Details about the source content data. type SourceContentDataDetails struct { @@ -1971,6 +2759,10 @@ type SourceContentDataDetails struct { // This member is required. Type SourceContentType + // Contains information about where the text with a citation begins and ends in + // the generated output. + CitationSpan *CitationSpan + noSmithyDocumentSerde } @@ -2038,6 +2830,87 @@ type TextData struct { noSmithyDocumentSerde } +// The configuration for a prompt template that supports full textual prompt +// configuration using a YAML prompt. +type TextFullAIPromptEditTemplateConfiguration struct { + + // The YAML text for the AI Prompt template. + // + // This member is required. + Text *string + + 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 UrlConfiguration struct { + + // List of URLs for crawling. + SeedUrls []SeedUrl + + noSmithyDocumentSerde +} + +// Contains details about how to ingest the documents in a data source. +type VectorIngestionConfiguration struct { + + // 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. + ChunkingConfiguration *ChunkingConfiguration + + // A custom parser for data source documents. + ParsingConfiguration *ParsingConfiguration + + noSmithyDocumentSerde +} + +// The configuration details for the web data source. +type WebCrawlerConfiguration struct { + + // The configuration of the URL/URLs for the web content that you want to crawl. + // You should be authorized to crawl the URLs. + // + // This member is required. + UrlConfiguration *UrlConfiguration + + // 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 configuration of crawl limits for the web URLs. +type WebCrawlerLimits struct { + + // Rate of web URLs retrieved per minute. + RateLimit *int32 + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde // UnknownUnionMember is returned when a union member is returned over the wire, @@ -2049,17 +2922,23 @@ type UnknownUnionMember struct { noSmithyDocumentSerde } +func (*UnknownUnionMember) isAIAgentConfiguration() {} +func (*UnknownUnionMember) isAIPromptTemplateConfiguration() {} func (*UnknownUnionMember) isAssistantAssociationInputData() {} func (*UnknownUnionMember) isAssistantAssociationOutputData() {} +func (*UnknownUnionMember) isAssociationConfigurationData() {} func (*UnknownUnionMember) isConfiguration() {} func (*UnknownUnionMember) isContentAssociationContents() {} func (*UnknownUnionMember) isContentFeedbackData() {} func (*UnknownUnionMember) isDataDetails() {} func (*UnknownUnionMember) isDataReference() {} +func (*UnknownUnionMember) isManagedSourceConfiguration() {} func (*UnknownUnionMember) isOrCondition() {} func (*UnknownUnionMember) isQueryCondition() {} +func (*UnknownUnionMember) isQueryInputData() {} func (*UnknownUnionMember) isQuickResponseContentProvider() {} func (*UnknownUnionMember) isQuickResponseDataProvider() {} func (*UnknownUnionMember) isRecommendationTriggerData() {} +func (*UnknownUnionMember) isRuntimeSessionDataValue() {} func (*UnknownUnionMember) isSourceConfiguration() {} func (*UnknownUnionMember) isTagFilter() {} diff --git a/service/qconnect/types/types_exported_test.go b/service/qconnect/types/types_exported_test.go index ff0446e55ff..8ac0c59a389 100644 --- a/service/qconnect/types/types_exported_test.go +++ b/service/qconnect/types/types_exported_test.go @@ -7,6 +7,46 @@ import ( "github.com/aws/aws-sdk-go-v2/service/qconnect/types" ) +func ExampleAIAgentConfiguration_outputUsage() { + var union types.AIAgentConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.AIAgentConfigurationMemberAnswerRecommendationAIAgentConfiguration: + _ = v.Value // Value is types.AnswerRecommendationAIAgentConfiguration + + case *types.AIAgentConfigurationMemberManualSearchAIAgentConfiguration: + _ = v.Value // Value is types.ManualSearchAIAgentConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.ManualSearchAIAgentConfiguration +var _ *types.AnswerRecommendationAIAgentConfiguration + +func ExampleAIPromptTemplateConfiguration_outputUsage() { + var union types.AIPromptTemplateConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.AIPromptTemplateConfigurationMemberTextFullAIPromptEditTemplateConfiguration: + _ = v.Value // Value is types.TextFullAIPromptEditTemplateConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.TextFullAIPromptEditTemplateConfiguration + func ExampleAssistantAssociationInputData_outputUsage() { var union types.AssistantAssociationInputData // type switches can be used to check the union value @@ -43,6 +83,24 @@ func ExampleAssistantAssociationOutputData_outputUsage() { var _ *types.KnowledgeBaseAssociationData +func ExampleAssociationConfigurationData_outputUsage() { + var union types.AssociationConfigurationData + // type switches can be used to check the union value + switch v := union.(type) { + case *types.AssociationConfigurationDataMemberKnowledgeBaseAssociationConfigurationData: + _ = v.Value // Value is types.KnowledgeBaseAssociationConfigurationData + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.KnowledgeBaseAssociationConfigurationData + func ExampleConfiguration_outputUsage() { var union types.Configuration // type switches can be used to check the union value @@ -107,6 +165,9 @@ func ExampleDataDetails_outputUsage() { case *types.DataDetailsMemberGenerativeData: _ = v.Value // Value is types.GenerativeDataDetails + case *types.DataDetailsMemberIntentDetectedData: + _ = v.Value // Value is types.IntentDetectedDataDetails + case *types.DataDetailsMemberSourceContentData: _ = v.Value // Value is types.SourceContentDataDetails @@ -120,6 +181,7 @@ func ExampleDataDetails_outputUsage() { } var _ *types.ContentDataDetails +var _ *types.IntentDetectedDataDetails var _ *types.GenerativeDataDetails var _ *types.SourceContentDataDetails @@ -145,6 +207,24 @@ func ExampleDataReference_outputUsage() { var _ *types.GenerativeReference var _ *types.ContentReference +func ExampleManagedSourceConfiguration_outputUsage() { + var union types.ManagedSourceConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ManagedSourceConfigurationMemberWebCrawlerConfiguration: + _ = v.Value // Value is types.WebCrawlerConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.WebCrawlerConfiguration + func ExampleOrCondition_outputUsage() { var union types.OrCondition // type switches can be used to check the union value @@ -185,6 +265,28 @@ func ExampleQueryCondition_outputUsage() { var _ *types.QueryConditionItem +func ExampleQueryInputData_outputUsage() { + var union types.QueryInputData + // type switches can be used to check the union value + switch v := union.(type) { + case *types.QueryInputDataMemberIntentInputData: + _ = v.Value // Value is types.IntentInputData + + case *types.QueryInputDataMemberQueryTextInputData: + _ = v.Value // Value is types.QueryTextInputData + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.QueryTextInputData +var _ *types.IntentInputData + func ExampleQuickResponseContentProvider_outputUsage() { var union types.QuickResponseContentProvider // type switches can be used to check the union value @@ -239,6 +341,24 @@ func ExampleRecommendationTriggerData_outputUsage() { var _ *types.QueryRecommendationTriggerData +func ExampleRuntimeSessionDataValue_outputUsage() { + var union types.RuntimeSessionDataValue + // type switches can be used to check the union value + switch v := union.(type) { + case *types.RuntimeSessionDataValueMemberStringValue: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string + func ExampleSourceConfiguration_outputUsage() { var union types.SourceConfiguration // type switches can be used to check the union value @@ -246,6 +366,9 @@ func ExampleSourceConfiguration_outputUsage() { case *types.SourceConfigurationMemberAppIntegrations: _ = v.Value // Value is types.AppIntegrationsConfiguration + case *types.SourceConfigurationMemberManagedSourceConfiguration: + _ = v.Value // Value is types.ManagedSourceConfiguration + case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) @@ -256,6 +379,7 @@ func ExampleSourceConfiguration_outputUsage() { } var _ *types.AppIntegrationsConfiguration +var _ types.ManagedSourceConfiguration func ExampleTagFilter_outputUsage() { var union types.TagFilter diff --git a/service/qconnect/validators.go b/service/qconnect/validators.go index 4d604b577ba..8d26bc02edd 100644 --- a/service/qconnect/validators.go +++ b/service/qconnect/validators.go @@ -10,6 +10,86 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpCreateAIAgent struct { +} + +func (*validateOpCreateAIAgent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAIAgent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAIAgentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAIAgentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateAIAgentVersion struct { +} + +func (*validateOpCreateAIAgentVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAIAgentVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAIAgentVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAIAgentVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateAIPrompt struct { +} + +func (*validateOpCreateAIPrompt) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAIPrompt) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAIPromptInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAIPromptInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateAIPromptVersion struct { +} + +func (*validateOpCreateAIPromptVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAIPromptVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAIPromptVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAIPromptVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateAssistantAssociation struct { } @@ -150,6 +230,86 @@ func (m *validateOpCreateSession) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDeleteAIAgent struct { +} + +func (*validateOpDeleteAIAgent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAIAgent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAIAgentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAIAgentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAIAgentVersion struct { +} + +func (*validateOpDeleteAIAgentVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAIAgentVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAIAgentVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAIAgentVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAIPrompt struct { +} + +func (*validateOpDeleteAIPrompt) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAIPrompt) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAIPromptInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAIPromptInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAIPromptVersion struct { +} + +func (*validateOpDeleteAIPromptVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAIPromptVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAIPromptVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAIPromptVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteAssistantAssociation struct { } @@ -290,6 +450,46 @@ func (m *validateOpDeleteQuickResponse) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpGetAIAgent struct { +} + +func (*validateOpGetAIAgent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAIAgent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAIAgentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAIAgentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAIPrompt struct { +} + +func (*validateOpGetAIPrompt) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAIPrompt) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAIPromptInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAIPromptInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetAssistantAssociation struct { } @@ -490,6 +690,86 @@ func (m *validateOpGetSession) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpListAIAgents struct { +} + +func (*validateOpListAIAgents) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAIAgents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAIAgentsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAIAgentsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAIAgentVersions struct { +} + +func (*validateOpListAIAgentVersions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAIAgentVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAIAgentVersionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAIAgentVersionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAIPrompts struct { +} + +func (*validateOpListAIPrompts) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAIPrompts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAIPromptsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAIPromptsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAIPromptVersions struct { +} + +func (*validateOpListAIPromptVersions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAIPromptVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAIPromptVersionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAIPromptVersionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListAssistantAssociations struct { } @@ -670,6 +950,26 @@ func (m *validateOpQueryAssistant) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpRemoveAssistantAIAgent struct { +} + +func (*validateOpRemoveAssistantAIAgent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRemoveAssistantAIAgent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RemoveAssistantAIAgentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRemoveAssistantAIAgentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpRemoveKnowledgeBaseTemplateUri struct { } @@ -830,93 +1130,189 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } -type validateOpUpdateContent struct { +type validateOpUpdateAIAgent struct { } -func (*validateOpUpdateContent) ID() string { +func (*validateOpUpdateAIAgent) ID() string { return "OperationInputValidation" } -func (m *validateOpUpdateContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( +func (m *validateOpUpdateAIAgent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { - input, ok := in.Parameters.(*UpdateContentInput) + input, ok := in.Parameters.(*UpdateAIAgentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } - if err := validateOpUpdateContentInput(input); err != nil { + if err := validateOpUpdateAIAgentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } -type validateOpUpdateKnowledgeBaseTemplateUri struct { +type validateOpUpdateAIPrompt struct { } -func (*validateOpUpdateKnowledgeBaseTemplateUri) ID() string { +func (*validateOpUpdateAIPrompt) ID() string { return "OperationInputValidation" } -func (m *validateOpUpdateKnowledgeBaseTemplateUri) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( +func (m *validateOpUpdateAIPrompt) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { - input, ok := in.Parameters.(*UpdateKnowledgeBaseTemplateUriInput) + input, ok := in.Parameters.(*UpdateAIPromptInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } - if err := validateOpUpdateKnowledgeBaseTemplateUriInput(input); err != nil { + if err := validateOpUpdateAIPromptInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } -type validateOpUpdateQuickResponse struct { +type validateOpUpdateAssistantAIAgent struct { } -func (*validateOpUpdateQuickResponse) ID() string { +func (*validateOpUpdateAssistantAIAgent) ID() string { return "OperationInputValidation" } -func (m *validateOpUpdateQuickResponse) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( +func (m *validateOpUpdateAssistantAIAgent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { - input, ok := in.Parameters.(*UpdateQuickResponseInput) + input, ok := in.Parameters.(*UpdateAssistantAIAgentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } - if err := validateOpUpdateQuickResponseInput(input); err != nil { + if err := validateOpUpdateAssistantAIAgentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } -type validateOpUpdateSession struct { +type validateOpUpdateContent struct { } -func (*validateOpUpdateSession) ID() string { +func (*validateOpUpdateContent) ID() string { return "OperationInputValidation" } -func (m *validateOpUpdateSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( +func (m *validateOpUpdateContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { - input, ok := in.Parameters.(*UpdateSessionInput) + input, ok := in.Parameters.(*UpdateContentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } - if err := validateOpUpdateSessionInput(input); err != nil { + if err := validateOpUpdateContentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } -func addOpCreateAssistantAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateAssistantAssociation{}, middleware.After) +type validateOpUpdateKnowledgeBaseTemplateUri struct { } -func addOpCreateAssistantValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateAssistant{}, middleware.After) -} +func (*validateOpUpdateKnowledgeBaseTemplateUri) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateKnowledgeBaseTemplateUri) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateKnowledgeBaseTemplateUriInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateKnowledgeBaseTemplateUriInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateQuickResponse struct { +} + +func (*validateOpUpdateQuickResponse) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateQuickResponse) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateQuickResponseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateQuickResponseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSessionData struct { +} + +func (*validateOpUpdateSessionData) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSessionData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSessionDataInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSessionDataInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSession struct { +} + +func (*validateOpUpdateSession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateAIAgentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAIAgent{}, middleware.After) +} + +func addOpCreateAIAgentVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAIAgentVersion{}, middleware.After) +} + +func addOpCreateAIPromptValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAIPrompt{}, middleware.After) +} + +func addOpCreateAIPromptVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAIPromptVersion{}, middleware.After) +} + +func addOpCreateAssistantAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAssistantAssociation{}, middleware.After) +} + +func addOpCreateAssistantValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAssistant{}, middleware.After) +} func addOpCreateContentAssociationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateContentAssociation{}, middleware.After) @@ -938,6 +1334,22 @@ func addOpCreateSessionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateSession{}, middleware.After) } +func addOpDeleteAIAgentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAIAgent{}, middleware.After) +} + +func addOpDeleteAIAgentVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAIAgentVersion{}, middleware.After) +} + +func addOpDeleteAIPromptValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAIPrompt{}, middleware.After) +} + +func addOpDeleteAIPromptVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAIPromptVersion{}, middleware.After) +} + func addOpDeleteAssistantAssociationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAssistantAssociation{}, middleware.After) } @@ -966,6 +1378,14 @@ func addOpDeleteQuickResponseValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpDeleteQuickResponse{}, middleware.After) } +func addOpGetAIAgentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAIAgent{}, middleware.After) +} + +func addOpGetAIPromptValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAIPrompt{}, middleware.After) +} + func addOpGetAssistantAssociationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAssistantAssociation{}, middleware.After) } @@ -1006,6 +1426,22 @@ func addOpGetSessionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSession{}, middleware.After) } +func addOpListAIAgentsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAIAgents{}, middleware.After) +} + +func addOpListAIAgentVersionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAIAgentVersions{}, middleware.After) +} + +func addOpListAIPromptsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAIPrompts{}, middleware.After) +} + +func addOpListAIPromptVersionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAIPromptVersions{}, middleware.After) +} + func addOpListAssistantAssociationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAssistantAssociations{}, middleware.After) } @@ -1042,6 +1478,10 @@ func addOpQueryAssistantValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpQueryAssistant{}, middleware.After) } +func addOpRemoveAssistantAIAgentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRemoveAssistantAIAgent{}, middleware.After) +} + func addOpRemoveKnowledgeBaseTemplateUriValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRemoveKnowledgeBaseTemplateUri{}, middleware.After) } @@ -1074,6 +1514,18 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateAIAgentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAIAgent{}, middleware.After) +} + +func addOpUpdateAIPromptValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAIPrompt{}, middleware.After) +} + +func addOpUpdateAssistantAIAgentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAssistantAIAgent{}, middleware.After) +} + func addOpUpdateContentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateContent{}, middleware.After) } @@ -1086,19 +1538,30 @@ func addOpUpdateQuickResponseValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpUpdateQuickResponse{}, middleware.After) } +func addOpUpdateSessionDataValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSessionData{}, middleware.After) +} + func addOpUpdateSessionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateSession{}, middleware.After) } -func validateAndConditions(v []types.TagCondition) error { +func validateAIAgentConfiguration(v types.AIAgentConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "AndConditions"} - for i := range v { - if err := validateTagCondition(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "AIAgentConfiguration"} + switch uv := v.(type) { + case *types.AIAgentConfigurationMemberAnswerRecommendationAIAgentConfiguration: + if err := validateAnswerRecommendationAIAgentConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[answerRecommendationAIAgentConfiguration]", err.(smithy.InvalidParamsError)) + } + + case *types.AIAgentConfigurationMemberManualSearchAIAgentConfiguration: + if err := validateManualSearchAIAgentConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[manualSearchAIAgentConfiguration]", err.(smithy.InvalidParamsError)) } + } if invalidParams.Len() > 0 { return invalidParams @@ -1107,13 +1570,13 @@ func validateAndConditions(v []types.TagCondition) error { } } -func validateAppIntegrationsConfiguration(v *types.AppIntegrationsConfiguration) error { +func validateAIAgentConfigurationData(v *types.AIAgentConfigurationData) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "AppIntegrationsConfiguration"} - if v.AppIntegrationArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("AppIntegrationArn")) + invalidParams := smithy.InvalidParamsError{Context: "AIAgentConfigurationData"} + if v.AiAgentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiAgentId")) } if invalidParams.Len() > 0 { return invalidParams @@ -1122,17 +1585,16 @@ func validateAppIntegrationsConfiguration(v *types.AppIntegrationsConfiguration) } } -func validateContentFeedbackData(v types.ContentFeedbackData) error { +func validateAIAgentConfigurationMap(v map[string]types.AIAgentConfigurationData) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "ContentFeedbackData"} - switch uv := v.(type) { - case *types.ContentFeedbackDataMemberGenerativeContentFeedbackData: - if err := validateGenerativeContentFeedbackData(&uv.Value); err != nil { - invalidParams.AddNested("[generativeContentFeedbackData]", err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "AIAgentConfigurationMap"} + for key := range v { + value := v[key] + if err := validateAIAgentConfigurationData(&value); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) } - } if invalidParams.Len() > 0 { return invalidParams @@ -1141,37 +1603,17 @@ func validateContentFeedbackData(v types.ContentFeedbackData) error { } } -func validateExternalSourceConfiguration(v *types.ExternalSourceConfiguration) error { +func validateAIPromptTemplateConfiguration(v types.AIPromptTemplateConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "ExternalSourceConfiguration"} - if len(v.Source) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Source")) - } - if v.Configuration == nil { - invalidParams.Add(smithy.NewErrParamRequired("Configuration")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} + invalidParams := smithy.InvalidParamsError{Context: "AIPromptTemplateConfiguration"} + switch uv := v.(type) { + case *types.AIPromptTemplateConfigurationMemberTextFullAIPromptEditTemplateConfiguration: + if err := validateTextFullAIPromptEditTemplateConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[textFullAIPromptEditTemplateConfiguration]", err.(smithy.InvalidParamsError)) + } -func validateFilter(v *types.Filter) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "Filter"} - if len(v.Field) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Field")) - } - if len(v.Operator) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Operator")) - } - if v.Value == nil { - invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams @@ -1180,13 +1622,13 @@ func validateFilter(v *types.Filter) error { } } -func validateFilterList(v []types.Filter) error { +func validateAndConditions(v []types.TagCondition) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "FilterList"} + invalidParams := smithy.InvalidParamsError{Context: "AndConditions"} for i := range v { - if err := validateFilter(&v[i]); err != nil { + if err := validateTagCondition(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } @@ -1197,13 +1639,15 @@ func validateFilterList(v []types.Filter) error { } } -func validateGenerativeContentFeedbackData(v *types.GenerativeContentFeedbackData) error { +func validateAnswerRecommendationAIAgentConfiguration(v *types.AnswerRecommendationAIAgentConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "GenerativeContentFeedbackData"} - if len(v.Relevance) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Relevance")) + invalidParams := smithy.InvalidParamsError{Context: "AnswerRecommendationAIAgentConfiguration"} + if v.AssociationConfigurations != nil { + if err := validateAssociationConfigurationList(v.AssociationConfigurations); err != nil { + invalidParams.AddNested("AssociationConfigurations", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -1212,22 +1656,13 @@ func validateGenerativeContentFeedbackData(v *types.GenerativeContentFeedbackDat } } -func validateOrCondition(v types.OrCondition) error { +func validateAppIntegrationsConfiguration(v *types.AppIntegrationsConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "OrCondition"} - switch uv := v.(type) { - case *types.OrConditionMemberAndConditions: - if err := validateAndConditions(uv.Value); err != nil { - invalidParams.AddNested("[andConditions]", err.(smithy.InvalidParamsError)) - } - - case *types.OrConditionMemberTagCondition: - if err := validateTagCondition(&uv.Value); err != nil { - invalidParams.AddNested("[tagCondition]", err.(smithy.InvalidParamsError)) - } - + invalidParams := smithy.InvalidParamsError{Context: "AppIntegrationsConfiguration"} + if v.AppIntegrationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppIntegrationArn")) } if invalidParams.Len() > 0 { return invalidParams @@ -1236,14 +1671,14 @@ func validateOrCondition(v types.OrCondition) error { } } -func validateOrConditions(v []types.OrCondition) error { +func validateAssociationConfiguration(v *types.AssociationConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "OrConditions"} - for i := range v { - if err := validateOrCondition(v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "AssociationConfiguration"} + if v.AssociationConfigurationData != nil { + if err := validateAssociationConfigurationData(v.AssociationConfigurationData); err != nil { + invalidParams.AddNested("AssociationConfigurationData", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -1253,15 +1688,15 @@ func validateOrConditions(v []types.OrCondition) error { } } -func validateQueryCondition(v types.QueryCondition) error { +func validateAssociationConfigurationData(v types.AssociationConfigurationData) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "QueryCondition"} + invalidParams := smithy.InvalidParamsError{Context: "AssociationConfigurationData"} switch uv := v.(type) { - case *types.QueryConditionMemberSingle: - if err := validateQueryConditionItem(&uv.Value); err != nil { - invalidParams.AddNested("[single]", err.(smithy.InvalidParamsError)) + case *types.AssociationConfigurationDataMemberKnowledgeBaseAssociationConfigurationData: + if err := validateKnowledgeBaseAssociationConfigurationData(&uv.Value); err != nil { + invalidParams.AddNested("[knowledgeBaseAssociationConfigurationData]", err.(smithy.InvalidParamsError)) } } @@ -1272,13 +1707,13 @@ func validateQueryCondition(v types.QueryCondition) error { } } -func validateQueryConditionExpression(v []types.QueryCondition) error { +func validateAssociationConfigurationList(v []types.AssociationConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "QueryConditionExpression"} + invalidParams := smithy.InvalidParamsError{Context: "AssociationConfigurationList"} for i := range v { - if err := validateQueryCondition(v[i]); err != nil { + if err := validateAssociationConfiguration(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } @@ -1289,19 +1724,18 @@ func validateQueryConditionExpression(v []types.QueryCondition) error { } } -func validateQueryConditionItem(v *types.QueryConditionItem) error { +func validateBedrockFoundationModelConfigurationForParsing(v *types.BedrockFoundationModelConfigurationForParsing) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "QueryConditionItem"} - if len(v.Field) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Field")) - } - if len(v.Comparator) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Comparator")) + invalidParams := smithy.InvalidParamsError{Context: "BedrockFoundationModelConfigurationForParsing"} + if v.ModelArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelArn")) } - if v.Value == nil { - invalidParams.Add(smithy.NewErrParamRequired("Value")) + if v.ParsingPrompt != nil { + if err := validateParsingPrompt(v.ParsingPrompt); err != nil { + invalidParams.AddNested("ParsingPrompt", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -1310,16 +1744,28 @@ func validateQueryConditionItem(v *types.QueryConditionItem) error { } } -func validateQuickResponseFilterField(v *types.QuickResponseFilterField) error { +func validateChunkingConfiguration(v *types.ChunkingConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "QuickResponseFilterField"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) + invalidParams := smithy.InvalidParamsError{Context: "ChunkingConfiguration"} + if len(v.ChunkingStrategy) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ChunkingStrategy")) } - if len(v.Operator) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Operator")) + 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 @@ -1328,15 +1774,17 @@ func validateQuickResponseFilterField(v *types.QuickResponseFilterField) error { } } -func validateQuickResponseFilterFieldList(v []types.QuickResponseFilterField) error { +func validateContentFeedbackData(v types.ContentFeedbackData) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "QuickResponseFilterFieldList"} - for i := range v { - if err := validateQuickResponseFilterField(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "ContentFeedbackData"} + switch uv := v.(type) { + case *types.ContentFeedbackDataMemberGenerativeContentFeedbackData: + if err := validateGenerativeContentFeedbackData(&uv.Value); err != nil { + invalidParams.AddNested("[generativeContentFeedbackData]", err.(smithy.InvalidParamsError)) } + } if invalidParams.Len() > 0 { return invalidParams @@ -1345,13 +1793,16 @@ func validateQuickResponseFilterFieldList(v []types.QuickResponseFilterField) er } } -func validateQuickResponseOrderField(v *types.QuickResponseOrderField) error { +func validateExternalSourceConfiguration(v *types.ExternalSourceConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "QuickResponseOrderField"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) + invalidParams := smithy.InvalidParamsError{Context: "ExternalSourceConfiguration"} + if len(v.Source) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.Configuration == nil { + invalidParams.Add(smithy.NewErrParamRequired("Configuration")) } if invalidParams.Len() > 0 { return invalidParams @@ -1360,13 +1811,428 @@ func validateQuickResponseOrderField(v *types.QuickResponseOrderField) error { } } -func validateQuickResponseQueryField(v *types.QuickResponseQueryField) error { +func validateFilter(v *types.Filter) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "QuickResponseQueryField"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) + invalidParams := smithy.InvalidParamsError{Context: "Filter"} + if len(v.Field) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Field")) + } + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFilterList(v []types.Filter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FilterList"} + for i := range v { + if err := validateFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFixedSizeChunkingConfiguration(v *types.FixedSizeChunkingConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FixedSizeChunkingConfiguration"} + if v.MaxTokens == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxTokens")) + } + if v.OverlapPercentage == nil { + invalidParams.Add(smithy.NewErrParamRequired("OverlapPercentage")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateGenerativeContentFeedbackData(v *types.GenerativeContentFeedbackData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GenerativeContentFeedbackData"} + if len(v.Relevance) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Relevance")) + } + 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 validateIntentInputData(v *types.IntentInputData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IntentInputData"} + if v.IntentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IntentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateKnowledgeBaseAssociationConfigurationData(v *types.KnowledgeBaseAssociationConfigurationData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KnowledgeBaseAssociationConfigurationData"} + if v.ContentTagFilter != nil { + if err := validateTagFilter(v.ContentTagFilter); err != nil { + invalidParams.AddNested("ContentTagFilter", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateManagedSourceConfiguration(v types.ManagedSourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ManagedSourceConfiguration"} + switch uv := v.(type) { + case *types.ManagedSourceConfigurationMemberWebCrawlerConfiguration: + if err := validateWebCrawlerConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[webCrawlerConfiguration]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateManualSearchAIAgentConfiguration(v *types.ManualSearchAIAgentConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ManualSearchAIAgentConfiguration"} + if v.AssociationConfigurations != nil { + if err := validateAssociationConfigurationList(v.AssociationConfigurations); err != nil { + invalidParams.AddNested("AssociationConfigurations", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOrCondition(v types.OrCondition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OrCondition"} + switch uv := v.(type) { + case *types.OrConditionMemberAndConditions: + if err := validateAndConditions(uv.Value); err != nil { + invalidParams.AddNested("[andConditions]", err.(smithy.InvalidParamsError)) + } + + case *types.OrConditionMemberTagCondition: + if err := validateTagCondition(&uv.Value); err != nil { + invalidParams.AddNested("[tagCondition]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOrConditions(v []types.OrCondition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OrConditions"} + for i := range v { + if err := validateOrCondition(v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), 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 := validateBedrockFoundationModelConfigurationForParsing(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 validateQueryCondition(v types.QueryCondition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QueryCondition"} + switch uv := v.(type) { + case *types.QueryConditionMemberSingle: + if err := validateQueryConditionItem(&uv.Value); err != nil { + invalidParams.AddNested("[single]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQueryConditionExpression(v []types.QueryCondition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QueryConditionExpression"} + for i := range v { + if err := validateQueryCondition(v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQueryConditionItem(v *types.QueryConditionItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QueryConditionItem"} + if len(v.Field) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Field")) + } + if len(v.Comparator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Comparator")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQueryInputData(v types.QueryInputData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QueryInputData"} + switch uv := v.(type) { + case *types.QueryInputDataMemberIntentInputData: + if err := validateIntentInputData(&uv.Value); err != nil { + invalidParams.AddNested("[intentInputData]", err.(smithy.InvalidParamsError)) + } + + case *types.QueryInputDataMemberQueryTextInputData: + if err := validateQueryTextInputData(&uv.Value); err != nil { + invalidParams.AddNested("[queryTextInputData]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQueryTextInputData(v *types.QueryTextInputData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QueryTextInputData"} + if v.Text == nil { + invalidParams.Add(smithy.NewErrParamRequired("Text")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQuickResponseFilterField(v *types.QuickResponseFilterField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QuickResponseFilterField"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQuickResponseFilterFieldList(v []types.QuickResponseFilterField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QuickResponseFilterFieldList"} + for i := range v { + if err := validateQuickResponseFilterField(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQuickResponseOrderField(v *types.QuickResponseOrderField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QuickResponseOrderField"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQuickResponseQueryField(v *types.QuickResponseQueryField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QuickResponseQueryField"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Values == nil { invalidParams.Add(smithy.NewErrParamRequired("Values")) @@ -1425,6 +2291,41 @@ func validateQuickResponseSearchExpression(v *types.QuickResponseSearchExpressio } } +func validateRuntimeSessionData(v *types.RuntimeSessionData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RuntimeSessionData"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRuntimeSessionDataList(v []types.RuntimeSessionData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RuntimeSessionDataList"} + for i := range v { + if err := validateRuntimeSessionData(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSearchExpression(v *types.SearchExpression) error { if v == nil { return nil @@ -1444,6 +2345,27 @@ func validateSearchExpression(v *types.SearchExpression) error { } } +func validateSemanticChunkingConfiguration(v *types.SemanticChunkingConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SemanticChunkingConfiguration"} + if v.MaxTokens == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxTokens")) + } + if v.BufferSize == nil { + invalidParams.Add(smithy.NewErrParamRequired("BufferSize")) + } + if v.BreakpointPercentileThreshold == nil { + invalidParams.Add(smithy.NewErrParamRequired("BreakpointPercentileThreshold")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSourceConfiguration(v types.SourceConfiguration) error { if v == nil { return nil @@ -1455,6 +2377,11 @@ func validateSourceConfiguration(v types.SourceConfiguration) error { invalidParams.AddNested("[appIntegrations]", err.(smithy.InvalidParamsError)) } + case *types.SourceConfigurationMemberManagedSourceConfiguration: + if err := validateManagedSourceConfiguration(uv.Value); err != nil { + invalidParams.AddNested("[managedSourceConfiguration]", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -1478,27 +2405,186 @@ func validateTagCondition(v *types.TagCondition) error { } } -func validateTagFilter(v types.TagFilter) error { +func validateTagFilter(v types.TagFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagFilter"} + switch uv := v.(type) { + case *types.TagFilterMemberAndConditions: + if err := validateAndConditions(uv.Value); err != nil { + invalidParams.AddNested("[andConditions]", err.(smithy.InvalidParamsError)) + } + + case *types.TagFilterMemberOrConditions: + if err := validateOrConditions(uv.Value); err != nil { + invalidParams.AddNested("[orConditions]", err.(smithy.InvalidParamsError)) + } + + case *types.TagFilterMemberTagCondition: + if err := validateTagCondition(&uv.Value); err != nil { + invalidParams.AddNested("[tagCondition]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTextFullAIPromptEditTemplateConfiguration(v *types.TextFullAIPromptEditTemplateConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TextFullAIPromptEditTemplateConfiguration"} + if v.Text == nil { + invalidParams.Add(smithy.NewErrParamRequired("Text")) + } + 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.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 validateWebCrawlerConfiguration(v *types.WebCrawlerConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WebCrawlerConfiguration"} + if v.UrlConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("UrlConfiguration")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAIAgentInput(v *CreateAIAgentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAIAgentInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Configuration == nil { + invalidParams.Add(smithy.NewErrParamRequired("Configuration")) + } else if v.Configuration != nil { + if err := validateAIAgentConfiguration(v.Configuration); err != nil { + invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) + } + } + if len(v.VisibilityStatus) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("VisibilityStatus")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAIAgentVersionInput(v *CreateAIAgentVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAIAgentVersionInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiAgentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiAgentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAIPromptInput(v *CreateAIPromptInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAIPromptInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.TemplateConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateConfiguration")) + } else if v.TemplateConfiguration != nil { + if err := validateAIPromptTemplateConfiguration(v.TemplateConfiguration); err != nil { + invalidParams.AddNested("TemplateConfiguration", err.(smithy.InvalidParamsError)) + } + } + if len(v.VisibilityStatus) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("VisibilityStatus")) + } + if len(v.TemplateType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("TemplateType")) + } + if v.ModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelId")) + } + if len(v.ApiFormat) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ApiFormat")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAIPromptVersionInput(v *CreateAIPromptVersionInput) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "TagFilter"} - switch uv := v.(type) { - case *types.TagFilterMemberAndConditions: - if err := validateAndConditions(uv.Value); err != nil { - invalidParams.AddNested("[andConditions]", err.(smithy.InvalidParamsError)) - } - - case *types.TagFilterMemberOrConditions: - if err := validateOrConditions(uv.Value); err != nil { - invalidParams.AddNested("[orConditions]", err.(smithy.InvalidParamsError)) - } - - case *types.TagFilterMemberTagCondition: - if err := validateTagCondition(&uv.Value); err != nil { - invalidParams.AddNested("[tagCondition]", err.(smithy.InvalidParamsError)) - } - + invalidParams := smithy.InvalidParamsError{Context: "CreateAIPromptVersionInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiPromptId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiPromptId")) } if invalidParams.Len() > 0 { return invalidParams @@ -1607,6 +2693,11 @@ func validateOpCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput) error { invalidParams.AddNested("SourceConfiguration", err.(smithy.InvalidParamsError)) } } + if v.VectorIngestionConfiguration != nil { + if err := validateVectorIngestionConfiguration(v.VectorIngestionConfiguration); err != nil { + invalidParams.AddNested("VectorIngestionConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1651,6 +2742,89 @@ func validateOpCreateSessionInput(v *CreateSessionInput) error { invalidParams.AddNested("TagFilter", err.(smithy.InvalidParamsError)) } } + if v.AiAgentConfiguration != nil { + if err := validateAIAgentConfigurationMap(v.AiAgentConfiguration); err != nil { + invalidParams.AddNested("AiAgentConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAIAgentInput(v *DeleteAIAgentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAIAgentInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiAgentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiAgentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAIAgentVersionInput(v *DeleteAIAgentVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAIAgentVersionInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiAgentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiAgentId")) + } + if v.VersionNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("VersionNumber")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAIPromptInput(v *DeleteAIPromptInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAIPromptInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiPromptId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiPromptId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAIPromptVersionInput(v *DeleteAIPromptVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAIPromptVersionInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiPromptId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiPromptId")) + } + if v.VersionNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("VersionNumber")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1781,6 +2955,42 @@ func validateOpDeleteQuickResponseInput(v *DeleteQuickResponseInput) error { } } +func validateOpGetAIAgentInput(v *GetAIAgentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAIAgentInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiAgentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiAgentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAIPromptInput(v *GetAIPromptInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAIPromptInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiPromptId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiPromptId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetAssistantAssociationInput(v *GetAssistantAssociationInput) error { if v == nil { return nil @@ -1958,6 +3168,72 @@ func validateOpGetSessionInput(v *GetSessionInput) error { } } +func validateOpListAIAgentsInput(v *ListAIAgentsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAIAgentsInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAIAgentVersionsInput(v *ListAIAgentVersionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAIAgentVersionsInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiAgentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiAgentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAIPromptsInput(v *ListAIPromptsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAIPromptsInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAIPromptVersionsInput(v *ListAIPromptVersionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAIPromptVersionsInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiPromptId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiPromptId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListAssistantAssociationsInput(v *ListAssistantAssociationsInput) error { if v == nil { return nil @@ -2108,14 +3384,34 @@ func validateOpQueryAssistantInput(v *QueryAssistantInput) error { if v.AssistantId == nil { invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) } - if v.QueryText == nil { - invalidParams.Add(smithy.NewErrParamRequired("QueryText")) - } if v.QueryCondition != nil { if err := validateQueryConditionExpression(v.QueryCondition); err != nil { invalidParams.AddNested("QueryCondition", err.(smithy.InvalidParamsError)) } } + if v.QueryInputData != nil { + if err := validateQueryInputData(v.QueryInputData); err != nil { + invalidParams.AddNested("QueryInputData", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRemoveAssistantAIAgentInput(v *RemoveAssistantAIAgentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RemoveAssistantAIAgentInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if len(v.AiAgentType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AiAgentType")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2284,6 +3580,83 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { } } +func validateOpUpdateAIAgentInput(v *UpdateAIAgentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAIAgentInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiAgentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiAgentId")) + } + if len(v.VisibilityStatus) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("VisibilityStatus")) + } + if v.Configuration != nil { + if err := validateAIAgentConfiguration(v.Configuration); err != nil { + invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateAIPromptInput(v *UpdateAIPromptInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAIPromptInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.AiPromptId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AiPromptId")) + } + if len(v.VisibilityStatus) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("VisibilityStatus")) + } + if v.TemplateConfiguration != nil { + if err := validateAIPromptTemplateConfiguration(v.TemplateConfiguration); err != nil { + invalidParams.AddNested("TemplateConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateAssistantAIAgentInput(v *UpdateAssistantAIAgentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAssistantAIAgentInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if len(v.AiAgentType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AiAgentType")) + } + if v.Configuration == nil { + invalidParams.Add(smithy.NewErrParamRequired("Configuration")) + } else if v.Configuration != nil { + if err := validateAIAgentConfigurationData(v.Configuration); err != nil { + invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateContentInput(v *UpdateContentInput) error { if v == nil { return nil @@ -2338,6 +3711,31 @@ func validateOpUpdateQuickResponseInput(v *UpdateQuickResponseInput) error { } } +func validateOpUpdateSessionDataInput(v *UpdateSessionDataInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSessionDataInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.SessionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionId")) + } + if v.Data == nil { + invalidParams.Add(smithy.NewErrParamRequired("Data")) + } else if v.Data != nil { + if err := validateRuntimeSessionDataList(v.Data); err != nil { + invalidParams.AddNested("Data", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateSessionInput(v *UpdateSessionInput) error { if v == nil { return nil @@ -2354,6 +3752,11 @@ func validateOpUpdateSessionInput(v *UpdateSessionInput) error { invalidParams.AddNested("TagFilter", err.(smithy.InvalidParamsError)) } } + if v.AiAgentConfiguration != nil { + if err := validateAIAgentConfigurationMap(v.AiAgentConfiguration); err != nil { + invalidParams.AddNested("AiAgentConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/redshift/api_op_EnableLogging.go b/service/redshift/api_op_EnableLogging.go index 5136c3a55a1..3b7d121acc2 100644 --- a/service/redshift/api_op_EnableLogging.go +++ b/service/redshift/api_op_EnableLogging.go @@ -56,22 +56,10 @@ type EnableLoggingInput struct { // The prefix applied to the log file names. // - // Constraints: - // - // - Cannot exceed 512 characters - // - // - Cannot contain spaces( ), double quotes ("), single quotes ('), a backslash - // (\), or control characters. The hexadecimal codes for invalid characters are: - // - // - x00 to x20 - // - // - x22 - // - // - x27 - // - // - x5c - // - // - x7f or larger + // Valid characters are any letter from any language, any whitespace character, + // any numeric character, and the following characters: underscore ( _ ), period ( . + // ), colon ( : ), slash ( / ), equal ( = ), plus ( + ), backslash ( \ ), hyphen ( - + // ), at symbol ( @ ). S3KeyPrefix *string noSmithyDocumentSerde