diff --git a/clients/aws-sdk-qbusiness/README.md b/clients/aws-sdk-qbusiness/README.md new file mode 100644 index 0000000..0fe6861 --- /dev/null +++ b/clients/aws-sdk-qbusiness/README.md @@ -0,0 +1,40 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +## QBusiness Client + +aws_sdk_qbusiness client + +### Documentation + +This is the *Amazon Q Business* API Reference. Amazon Q Business is a +fully managed, generative-AI powered enterprise chat assistant that you +can deploy within your organization. Amazon Q Business enhances employee +productivity by supporting key tasks such as question-answering, +knowledge discovery, writing email messages, summarizing text, drafting +document outlines, and brainstorming ideas. Users ask questions of +Amazon Q Business and get answers that are presented in a conversational +manner. For an introduction to the service, see the [*Amazon Q Business +User +Guide*](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/what-is.html) +. + +For an overview of the Amazon Q Business APIs, see [Overview of Amazon Q +Business API +operations](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/api-ref.html#api-overview). + +For information about the IAM access control permissions you need to use +this API, see [IAM roles for Amazon Q +Business](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/iam-roles.html) +in the *Amazon Q Business User Guide*. + +The following resources provide additional information about using the +Amazon Q Business API: + +- *[Setting up for Amazon Q + Business](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/setting-up.html)* + +- *[Amazon Q Business CLI + Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/qbusiness/index.html)* + +- *[Amazon Web Services General + Reference](https://docs.aws.amazon.com/general/latest/gr/amazonq.html)* diff --git a/clients/aws-sdk-qbusiness/pyproject.toml b/clients/aws-sdk-qbusiness/pyproject.toml new file mode 100644 index 0000000..f27c23a --- /dev/null +++ b/clients/aws-sdk-qbusiness/pyproject.toml @@ -0,0 +1,61 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +[project] +name = "aws_sdk_qbusiness" +version = "0.4.0" +description = "aws_sdk_qbusiness client" +readme = "README.md" +requires-python = ">=3.12" +keywords = ["smithy", "aws_sdk_qbusiness"] +license = {text = "Apache-2.0"} +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Natural Language :: English", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14" +] + +dependencies = [ + "smithy_aws_core[eventstream, json]~=0.5.0", + "smithy_core~=0.4.0", + "smithy_http[awscrt]~=0.4.0" +] + +[dependency-groups] +test = [ + "pytest>=9.0.1,<10.0.0", + "pytest-asyncio>=1.3.0,<1.4.0" +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.pyright] +typeCheckingMode = "strict" +reportPrivateUsage = false +reportUnusedFunction = false +reportUnusedVariable = false +reportUnnecessaryComparison = false +reportUnusedClass = false +enableExperimentalFeatures = true + +[tool.ruff] +target-version = "py312" + +[tool.ruff.lint] +ignore = ["F841"] + +[tool.ruff.format] +skip-magic-trailing-comma = true + +[tool.pytest.ini_options] +python_classes = ["!Test"] +asyncio_mode = "auto" diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/__init__.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/__init__.py new file mode 100644 index 0000000..99433b7 --- /dev/null +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/__init__.py @@ -0,0 +1,3 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +__version__: str = "0.4.0" diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/_private/__init__.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/_private/__init__.py new file mode 100644 index 0000000..247be3e --- /dev/null +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/_private/__init__.py @@ -0,0 +1 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/_private/schemas.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/_private/schemas.py new file mode 100644 index 0000000..83c8773 --- /dev/null +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/_private/schemas.py @@ -0,0 +1,11983 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from types import MappingProxyType + +from smithy_core.prelude import BLOB as _BLOB, BOOLEAN, UNIT +from smithy_core.schemas import Schema +from smithy_core.shapes import ShapeID, ShapeType +from smithy_core.traits import Trait + + +MEMBER_RELATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MemberRelation"), + shape_type=ShapeType.ENUM, + members={ + "AND": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="AND")], + }, + "OR": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="OR")], + }, + }, +) + +READ_ACCESS_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ReadAccessType"), + shape_type=ShapeType.ENUM, + members={ + "ALLOW": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ALLOW")], + }, + "DENY": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DENY")], + }, + }, +) + +MEMBERSHIP_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MembershipType"), + shape_type=ShapeType.ENUM, + members={ + "INDEX": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="INDEX")], + }, + "DATASOURCE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="DATASOURCE") + ], + }, + }, +) + +GROUP_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#GroupName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1024}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^\\P{C}*$"), + ], +) + +PRINCIPAL_GROUP = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PrincipalGroup"), + members={ + "name": {"target": GROUP_NAME}, + "access": { + "target": READ_ACCESS_TYPE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "membershipType": {"target": MEMBERSHIP_TYPE}, + }, +) + +USER_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#UserId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1024}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^\\P{C}*$"), + ], +) + +PRINCIPAL_USER = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PrincipalUser"), + members={ + "id": {"target": USER_ID}, + "access": { + "target": READ_ACCESS_TYPE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "membershipType": {"target": MEMBERSHIP_TYPE}, + }, +) + +PRINCIPAL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Principal"), + shape_type=ShapeType.UNION, + members={"user": {"target": PRINCIPAL_USER}, "group": {"target": PRINCIPAL_GROUP}}, +) + +PRINCIPALS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Principals"), + shape_type=ShapeType.LIST, + members={"member": {"target": PRINCIPAL}}, +) + +ACCESS_CONTROL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AccessControl"), + members={ + "principals": { + "target": PRINCIPALS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "memberRelation": {"target": MEMBER_RELATION}, + }, +) + +ACCESS_CONTROLS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AccessControls"), + shape_type=ShapeType.LIST, + members={"member": {"target": ACCESS_CONTROL}}, +) + +ACCESS_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AccessConfiguration"), + members={ + "accessControls": { + "target": ACCESS_CONTROLS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "memberRelation": {"target": MEMBER_RELATION}, + }, +) + +ERROR_MESSAGE = Schema( + id=ShapeID("com.amazonaws.qbusiness#ErrorMessage"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 2048}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[\\s\\S]*$"), + ], +) + +ACCESS_DENIED_EXCEPTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=403), + ], + members={ + "message": { + "target": ERROR_MESSAGE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +Q_IAM_ACTION = Schema( + id=ShapeID("com.amazonaws.qbusiness#QIamAction"), + shape_type=ShapeType.STRING, + traits=[Trait.new(id=ShapeID("smithy.api#pattern"), value="^qbusiness:[a-zA-Z]+$")], +) + +DOCUMENT_ATTRIBUTE_KEY = Schema( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeKey"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 200}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9_][a-zA-Z0-9_-]*$" + ), + ], +) + +TIMESTAMP = Schema( + id=ShapeID("com.amazonaws.qbusiness#Timestamp"), shape_type=ShapeType.TIMESTAMP +) + +LONG = Schema( + id=ShapeID("com.amazonaws.qbusiness#Long"), + shape_type=ShapeType.LONG, + traits=[Trait.new(id=ShapeID("smithy.api#box"))], +) + +STRING = Schema( + id=ShapeID("com.amazonaws.qbusiness#String"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 2048}), + ) + ], +) + +DOCUMENT_ATTRIBUTE_STRING_LIST_VALUE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeStringListValue"), + shape_type=ShapeType.LIST, + members={"member": {"target": STRING}}, +) + +DOCUMENT_ATTRIBUTE_STRING_VALUE = Schema( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeStringValue"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), value=MappingProxyType({"max": 2048}) + ) + ], +) + +DOCUMENT_ATTRIBUTE_VALUE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeValue"), + shape_type=ShapeType.UNION, + members={ + "stringValue": { + "target": DOCUMENT_ATTRIBUTE_STRING_VALUE, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"max": 2048}), + ) + ], + }, + "stringListValue": {"target": DOCUMENT_ATTRIBUTE_STRING_LIST_VALUE}, + "longValue": {"target": LONG}, + "dateValue": {"target": TIMESTAMP}, + }, +) + +DOCUMENT_ATTRIBUTE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttribute"), + members={ + "name": { + "target": DOCUMENT_ATTRIBUTE_KEY, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "value": { + "target": DOCUMENT_ATTRIBUTE_VALUE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +ACTION_PAYLOAD_FIELD_KEY = Schema( + id=ShapeID("com.amazonaws.qbusiness#ActionPayloadFieldKey"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({"min": 1})) + ], +) + +ACTION_PAYLOAD_FIELD_VALUE = Schema( + id=ShapeID("com.amazonaws.qbusiness#ActionPayloadFieldValue"), + shape_type=ShapeType.DOCUMENT, +) + +ACTION_EXECUTION_PAYLOAD_FIELD = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionExecutionPayloadField"), + members={ + "value": { + "target": ACTION_PAYLOAD_FIELD_VALUE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +ACTION_EXECUTION_PAYLOAD = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionExecutionPayload"), + shape_type=ShapeType.MAP, + members={ + "key": {"target": ACTION_PAYLOAD_FIELD_KEY}, + "value": {"target": ACTION_EXECUTION_PAYLOAD_FIELD}, + }, +) + +ACTION_PAYLOAD_FIELD_NAME_SEPARATOR = Schema( + id=ShapeID("com.amazonaws.qbusiness#ActionPayloadFieldNameSeparator"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1}), + ) + ], +) + +PLUGIN_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#PluginId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", + ), + ], +) + +ACTION_EXECUTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionExecution"), + members={ + "pluginId": { + "target": PLUGIN_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "payload": { + "target": ACTION_EXECUTION_PAYLOAD, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "payloadFieldNameSeparator": { + "target": ACTION_PAYLOAD_FIELD_NAME_SEPARATOR, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +ACTION_EXECUTION_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionExecutionEvent"), + members={ + "pluginId": { + "target": PLUGIN_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "payload": { + "target": ACTION_EXECUTION_PAYLOAD, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "payloadFieldNameSeparator": { + "target": ACTION_PAYLOAD_FIELD_NAME_SEPARATOR, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +ACTION_PAYLOAD_FIELD_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionPayloadFieldType"), + shape_type=ShapeType.ENUM, + members={ + "STRING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="STRING")], + }, + "NUMBER": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="NUMBER")], + }, + "ARRAY": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ARRAY")], + }, + "BOOLEAN": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="BOOLEAN")], + }, + }, +) + +ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionReviewPayloadFieldAllowedValue"), + members={ + "value": {"target": ACTION_PAYLOAD_FIELD_VALUE}, + "displayValue": {"target": ACTION_PAYLOAD_FIELD_VALUE}, + }, +) + +ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionReviewPayloadFieldAllowedValues"), + shape_type=ShapeType.LIST, + members={"member": {"target": ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE}}, +) + +ACTION_REVIEW_PAYLOAD_FIELD_ARRAY_ITEM_JSON_SCHEMA = Schema( + id=ShapeID("com.amazonaws.qbusiness#ActionReviewPayloadFieldArrayItemJsonSchema"), + shape_type=ShapeType.DOCUMENT, +) + +INTEGER = Schema( + id=ShapeID("com.amazonaws.qbusiness#Integer"), + shape_type=ShapeType.INTEGER, + traits=[Trait.new(id=ShapeID("smithy.api#box"))], +) + +ACTION_REVIEW_PAYLOAD_FIELD = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionReviewPayloadField"), + members={ + "displayName": {"target": STRING}, + "displayOrder": {"target": INTEGER}, + "displayDescription": {"target": STRING}, + "type": {"target": ACTION_PAYLOAD_FIELD_TYPE}, + "value": {"target": ACTION_PAYLOAD_FIELD_VALUE}, + "allowedValues": {"target": ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUES}, + "allowedFormat": {"target": STRING}, + "arrayItemJsonSchema": { + "target": ACTION_REVIEW_PAYLOAD_FIELD_ARRAY_ITEM_JSON_SCHEMA + }, + "required": {"target": BOOLEAN}, + }, +) + +ACTION_REVIEW_PAYLOAD = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionReviewPayload"), + shape_type=ShapeType.MAP, + members={ + "key": {"target": ACTION_PAYLOAD_FIELD_KEY}, + "value": {"target": ACTION_REVIEW_PAYLOAD_FIELD}, + }, +) + +PLUGIN_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PluginType"), + shape_type=ShapeType.ENUM, + members={ + "SERVICE_NOW": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="SERVICE_NOW") + ], + }, + "SALESFORCE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="SALESFORCE") + ], + }, + "JIRA": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="JIRA")], + }, + "ZENDESK": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ZENDESK")], + }, + "CUSTOM": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="CUSTOM")], + }, + "QUICKSIGHT": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="QUICKSIGHT") + ], + }, + "SERVICENOW_NOW_PLATFORM": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="SERVICENOW_NOW_PLATFORM" + ) + ], + }, + "JIRA_CLOUD": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="JIRA_CLOUD") + ], + }, + "SALESFORCE_CRM": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="SALESFORCE_CRM") + ], + }, + "ZENDESK_SUITE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="ZENDESK_SUITE") + ], + }, + "ATLASSIAN_CONFLUENCE": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="ATLASSIAN_CONFLUENCE" + ) + ], + }, + "GOOGLE_CALENDAR": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="GOOGLE_CALENDAR") + ], + }, + "MICROSOFT_TEAMS": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="MICROSOFT_TEAMS") + ], + }, + "MICROSOFT_EXCHANGE": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="MICROSOFT_EXCHANGE" + ) + ], + }, + "PAGERDUTY_ADVANCE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="PAGERDUTY_ADVANCE") + ], + }, + "SMARTSHEET": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="SMARTSHEET") + ], + }, + "ASANA": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ASANA")], + }, + }, +) + +ACTION_REVIEW = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionReview"), + members={ + "pluginId": {"target": PLUGIN_ID}, + "pluginType": {"target": PLUGIN_TYPE}, + "payload": {"target": ACTION_REVIEW_PAYLOAD}, + "payloadFieldNameSeparator": {"target": ACTION_PAYLOAD_FIELD_NAME_SEPARATOR}, + }, +) + +CONVERSATION_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#ConversationId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +MESSAGE_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#MessageId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +ACTION_REVIEW_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionReviewEvent"), + members={ + "conversationId": {"target": CONVERSATION_ID}, + "userMessageId": {"target": MESSAGE_ID}, + "systemMessageId": {"target": MESSAGE_ID}, + "pluginId": {"target": PLUGIN_ID}, + "pluginType": {"target": PLUGIN_TYPE}, + "payload": {"target": ACTION_REVIEW_PAYLOAD}, + "payloadFieldNameSeparator": {"target": ACTION_PAYLOAD_FIELD_NAME_SEPARATOR}, + }, +) + +ACTION_SUMMARY = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionSummary"), + members={ + "actionIdentifier": {"target": STRING}, + "displayName": {"target": STRING}, + "instructionExample": {"target": STRING}, + "description": {"target": STRING}, + }, +) + +ACTIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Actions"), + shape_type=ShapeType.LIST, + members={"member": {"target": ACTION_SUMMARY}}, +) + +AMAZON_RESOURCE_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#AmazonResourceName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1011}), + ) + ], +) + +PAYLOAD = Schema( + id=ShapeID("com.amazonaws.qbusiness#Payload"), + shape_type=ShapeType.STRING, + traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +) + +S3_BUCKET_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#S3BucketName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 63}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$", + ), + ], +) + +S3_OBJECT_KEY = Schema( + id=ShapeID("com.amazonaws.qbusiness#S3ObjectKey"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1024}), + ) + ], +) + +S3 = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#S3"), + members={ + "bucket": { + "target": S3_BUCKET_NAME, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "key": { + "target": S3_OBJECT_KEY, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +API_SCHEMA = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#APISchema"), + shape_type=ShapeType.UNION, + members={"payload": {"target": PAYLOAD}, "s3": {"target": S3}}, +) + +API_SCHEMA_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#APISchemaType"), + shape_type=ShapeType.ENUM, + members={ + "OPEN_API_V3": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="OPEN_API_V3") + ], + } + }, +) + +APPLICATION_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#ApplicationId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +APPLICATION_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#ApplicationName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1000}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + ], +) + +IDENTITY_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#IdentityType"), + shape_type=ShapeType.ENUM, + members={ + "AWS_IAM_IDP_SAML": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="AWS_IAM_IDP_SAML") + ], + }, + "AWS_IAM_IDP_OIDC": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="AWS_IAM_IDP_OIDC") + ], + }, + "AWS_IAM_IDC": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="AWS_IAM_IDC") + ], + }, + "AWS_QUICKSIGHT_IDP": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="AWS_QUICKSIGHT_IDP" + ) + ], + }, + "ANONYMOUS": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="ANONYMOUS") + ], + }, + }, +) + +CLIENT_NAMESPACE = Schema( + id=ShapeID("com.amazonaws.qbusiness#ClientNamespace"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 64}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9._-]*$"), + ], +) + +QUICK_SIGHT_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#QuickSightConfiguration"), + members={ + "clientNamespace": { + "target": CLIENT_NAMESPACE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +APPLICATION_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ApplicationStatus"), + shape_type=ShapeType.ENUM, + members={ + "CREATING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="CREATING")], + }, + "ACTIVE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ACTIVE")], + }, + "DELETING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DELETING")], + }, + "FAILED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FAILED")], + }, + "UPDATING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="UPDATING")], + }, + }, +) + +APPLICATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Application"), + members={ + "displayName": {"target": APPLICATION_NAME}, + "applicationId": {"target": APPLICATION_ID}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + "status": {"target": APPLICATION_STATUS}, + "identityType": {"target": IDENTITY_TYPE}, + "quickSightConfiguration": {"target": QUICK_SIGHT_CONFIGURATION}, + }, +) + +APPLICATION_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#ApplicationArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$", + ), + ], +) + +CONFLICT_EXCEPTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ConflictException"), + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=409), + ], + members={ + "message": { + "target": ERROR_MESSAGE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "resourceId": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "resourceType": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +ATTACHMENTS_CONTROL_MODE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttachmentsControlMode"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +ATTACHMENTS_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttachmentsConfiguration"), + members={ + "attachmentsControlMode": { + "target": ATTACHMENTS_CONTROL_MODE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +CLIENT_ID_FOR_OIDC = Schema( + id=ShapeID("com.amazonaws.qbusiness#ClientIdForOIDC"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 255}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9_.:/()*?=-]*$"), + ], +) + +CLIENT_IDS_FOR_OIDC = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ClientIdsForOIDC"), + shape_type=ShapeType.LIST, + members={"member": {"target": CLIENT_ID_FOR_OIDC}}, +) + +CLIENT_TOKEN = Schema( + id=ShapeID("com.amazonaws.qbusiness#ClientToken"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 100}), + ) + ], +) + +DESCRIPTION = Schema( + id=ShapeID("com.amazonaws.qbusiness#Description"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1000}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[\\s\\S]*$"), + ], +) + +KMS_KEY_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#KmsKeyId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 2048}), + ), + Trait.new(id=ShapeID("smithy.api#sensitive")), + ], +) + +ENCRYPTION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#EncryptionConfiguration"), + members={"kmsKeyId": {"target": KMS_KEY_ID}}, +) + +IAM_IDENTITY_PROVIDER_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#IAMIdentityProviderArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 20, "max": 2048}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:iam::\\d{12}:(oidc-provider|saml-provider)/[a-zA-Z0-9_\\.\\/@\\-]+$", + ), + ], +) + +INSTANCE_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#InstanceArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 10, "max": 1224}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}$", + ), + ], +) + +PERSONALIZATION_CONTROL_MODE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PersonalizationControlMode"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +PERSONALIZATION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PersonalizationConfiguration"), + members={ + "personalizationControlMode": { + "target": PERSONALIZATION_CONTROL_MODE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +Q_APPS_CONTROL_MODE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#QAppsControlMode"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +Q_APPS_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#QAppsConfiguration"), + members={ + "qAppsControlMode": { + "target": Q_APPS_CONTROL_MODE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +ROLE_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#RoleArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$", + ), + ], +) + +TAG_KEY = Schema( + id=ShapeID("com.amazonaws.qbusiness#TagKey"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 128}), + ) + ], +) + +TAG_VALUE = Schema( + id=ShapeID("com.amazonaws.qbusiness#TagValue"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 256}), + ) + ], +) + +TAG = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Tag"), + members={ + "key": { + "target": TAG_KEY, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "value": { + "target": TAG_VALUE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +TAGS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Tags"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 200}), + ) + ], + members={"member": {"target": TAG}}, +) + +CREATE_APPLICATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateApplicationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateApplicationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "displayName": { + "target": APPLICATION_NAME, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "roleArn": {"target": ROLE_ARN}, + "identityType": {"target": IDENTITY_TYPE}, + "iamIdentityProviderArn": {"target": IAM_IDENTITY_PROVIDER_ARN}, + "identityCenterInstanceArn": {"target": INSTANCE_ARN}, + "clientIdsForOIDC": {"target": CLIENT_IDS_FOR_OIDC}, + "description": {"target": DESCRIPTION}, + "encryptionConfiguration": {"target": ENCRYPTION_CONFIGURATION}, + "tags": { + "target": TAGS, + "traits": [ + Trait.new(id=ShapeID("aws.cloudformation#cfnMutability"), value="full") + ], + }, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + "attachmentsConfiguration": { + "target": ATTACHMENTS_CONFIGURATION, + "traits": [ + Trait.new(id=ShapeID("aws.cloudformation#cfnMutability"), value="full") + ], + }, + "qAppsConfiguration": {"target": Q_APPS_CONFIGURATION}, + "personalizationConfiguration": {"target": PERSONALIZATION_CONFIGURATION}, + "quickSightConfiguration": {"target": QUICK_SIGHT_CONFIGURATION}, + }, +) + +CREATE_APPLICATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateApplicationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateApplicationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "applicationId": {"target": APPLICATION_ID}, + "applicationArn": {"target": APPLICATION_ARN}, + }, +) + +INTERNAL_SERVER_EXCEPTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#InternalServerException"), + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="server"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=500), + ], + members={ + "message": { + "target": ERROR_MESSAGE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=404), + ], + members={ + "message": { + "target": ERROR_MESSAGE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "resourceId": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "resourceType": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=402), + ], + members={ + "message": { + "target": ERROR_MESSAGE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "resourceId": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "resourceType": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +THROTTLING_EXCEPTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=429), + ], + members={ + "message": { + "target": ERROR_MESSAGE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +VALIDATION_EXCEPTION_FIELD = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ValidationExceptionField"), + members={ + "name": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "message": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +VALIDATION_EXCEPTION_FIELDS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ValidationExceptionFields"), + shape_type=ShapeType.LIST, + members={"member": {"target": VALIDATION_EXCEPTION_FIELD}}, +) + +VALIDATION_EXCEPTION_REASON = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ValidationExceptionReason"), + shape_type=ShapeType.ENUM, + members={ + "CANNOT_PARSE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="CANNOT_PARSE") + ], + }, + "FIELD_VALIDATION_FAILED": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="FIELD_VALIDATION_FAILED" + ) + ], + }, + "UNKNOWN_OPERATION": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="UNKNOWN_OPERATION") + ], + }, + }, +) + +VALIDATION_EXCEPTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ValidationException"), + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=400), + ], + members={ + "message": { + "target": ERROR_MESSAGE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "reason": { + "target": VALIDATION_EXCEPTION_REASON, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "fields": {"target": VALIDATION_EXCEPTION_FIELDS}, + }, +) + +CREATE_APPLICATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#CreateApplication"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#conditionKeys"), + value=("aws:RequestTag/${TagKey}", "aws:TagKeys"), + ), + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetApplication", + "qbusiness:UpdateApplication", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole", + "kms:DescribeKey", + "kms:CreateGrant", + "sso:CreateApplication", + "sso:PutApplicationAuthenticationMethod", + "sso:PutApplicationAccessScope", + "sso:PutApplicationGrant", + "sso:DeleteApplication", + "sso:DescribeInstance", + "iam:GetSAMLProvider", + "quicksight:DescribeAccountSubscription", + "quicksight:ListNamespaces", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType({"uri": "/applications", "method": "POST"}), + ), + ], +) + +IDC_TRUSTED_TOKEN_ISSUER_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#IdcTrustedTokenIssuerArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:sso::[0-9]{12}:trustedTokenIssuer/(sso)?ins-[a-zA-Z0-9-.]{16}/tti-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", + ), + ], +) + +DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION = Schema.collection( + id=ShapeID( + "com.amazonaws.qbusiness#DataAccessorIdcTrustedTokenIssuerConfiguration" + ), + members={ + "idcTrustedTokenIssuerArn": { + "target": IDC_TRUSTED_TOKEN_ISSUER_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataAccessorAuthenticationConfiguration"), + shape_type=ShapeType.UNION, + members={ + "idcTrustedTokenIssuerConfiguration": { + "target": DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION + } + }, +) + +DATA_ACCESSOR_AUTHENTICATION_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataAccessorAuthenticationType"), + shape_type=ShapeType.ENUM, + members={ + "AWS_IAM_IDC_TTI": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="AWS_IAM_IDC_TTI") + ], + }, + "AWS_IAM_IDC_AUTH_CODE": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="AWS_IAM_IDC_AUTH_CODE" + ) + ], + }, + }, +) + +DATA_ACCESSOR_EXTERNAL_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#DataAccessorExternalId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1000}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + ], +) + +DATA_ACCESSOR_EXTERNAL_IDS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataAccessorExternalIds"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1}), + ) + ], + members={"member": {"target": DATA_ACCESSOR_EXTERNAL_ID}}, +) + +DATA_ACCESSOR_AUTHENTICATION_DETAIL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataAccessorAuthenticationDetail"), + members={ + "authenticationType": { + "target": DATA_ACCESSOR_AUTHENTICATION_TYPE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "authenticationConfiguration": { + "target": DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION + }, + "externalIds": {"target": DATA_ACCESSOR_EXTERNAL_IDS}, + }, +) + +DATA_ACCESSOR_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#DataAccessorName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + Trait.new(id=ShapeID("smithy.api#sensitive")), + ], +) + +PRINCIPAL_ROLE_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#PrincipalRoleArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:iam::[0-9]{12}:role/[a-zA-Z0-9_/+=,.@-]+$", + ), + ], +) + +DATA_ACCESSOR_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#DataAccessorArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$", + ), + ], +) + +DATA_ACCESSOR_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#DataAccessorId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +IDC_APPLICATION_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#IdcApplicationArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 10, "max": 1224}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:sso::\\d{12}:application/(sso)?ins-[a-zA-Z0-9-.]{16}/apl-[a-zA-Z0-9]{16}$", + ), + ], +) + +CREATE_DATA_ACCESSOR_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateDataAccessorOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateDataAccessorResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "dataAccessorId": { + "target": DATA_ACCESSOR_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "idcApplicationArn": { + "target": IDC_APPLICATION_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "dataAccessorArn": { + "target": DATA_ACCESSOR_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +DELETE_DATA_ACCESSOR_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteDataAccessorInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteDataAccessorRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "dataAccessorId": { + "target": DATA_ACCESSOR_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +DELETE_DATA_ACCESSOR_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteDataAccessorOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteDataAccessorResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_DATA_ACCESSOR = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteDataAccessor"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), value=("qbusiness:GetDataAccessor",) + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", + "method": "DELETE", + } + ), + ), + ], +) + +GET_DATA_ACCESSOR_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetDataAccessorInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetDataAccessorRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "dataAccessorId": { + "target": DATA_ACCESSOR_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +MAX_RESULTS_INTEGER_FOR_LIST_DATA_ACCESSORS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListDataAccessors"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 10}), + ), + ], +) + +NEXT_TOKEN1500 = Schema( + id=ShapeID("com.amazonaws.qbusiness#NextToken1500"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1500}), + ) + ], +) + +LIST_DATA_ACCESSORS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListDataAccessorsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListDataAccessorsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "nextToken": { + "target": NEXT_TOKEN1500, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_DATA_ACCESSORS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +DATA_ACCESSOR = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataAccessor"), + members={ + "displayName": {"target": DATA_ACCESSOR_NAME}, + "dataAccessorId": {"target": DATA_ACCESSOR_ID}, + "dataAccessorArn": {"target": DATA_ACCESSOR_ARN}, + "idcApplicationArn": {"target": IDC_APPLICATION_ARN}, + "principal": {"target": PRINCIPAL_ROLE_ARN}, + "authenticationDetail": {"target": DATA_ACCESSOR_AUTHENTICATION_DETAIL}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + }, +) + +DATA_ACCESSORS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataAccessors"), + shape_type=ShapeType.LIST, + members={"member": {"target": DATA_ACCESSOR}}, +) + +LIST_DATA_ACCESSORS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListDataAccessorsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListDataAccessorsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "dataAccessors": {"target": DATA_ACCESSORS}, + "nextToken": {"target": NEXT_TOKEN1500}, + }, +) + +LIST_DATA_ACCESSORS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListDataAccessors"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "dataAccessors", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/dataaccessors", "method": "GET"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +UPDATE_DATA_ACCESSOR_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateDataAccessorOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateDataAccessorResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_APPLICATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteApplicationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteApplicationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + } + }, +) + +DELETE_APPLICATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteApplicationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteApplicationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_APPLICATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteApplication"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetApplication", + "kms:RetireGrant", + "sso:DeleteApplication", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}", "method": "DELETE"} + ), + ), + ], +) + +GET_APPLICATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetApplicationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetApplicationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + } + }, +) + +APPLIED_ATTACHMENTS_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AppliedAttachmentsConfiguration"), + members={"attachmentsControlMode": {"target": ATTACHMENTS_CONTROL_MODE}}, +) + +AUTO_SUBSCRIPTION_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AutoSubscriptionStatus"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +SUBSCRIPTION_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SubscriptionType"), + shape_type=ShapeType.ENUM, + members={ + "Q_LITE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="Q_LITE")], + }, + "Q_BUSINESS": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="Q_BUSINESS") + ], + }, + }, +) + +AUTO_SUBSCRIPTION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AutoSubscriptionConfiguration"), + members={ + "autoSubscribe": { + "target": AUTO_SUBSCRIPTION_STATUS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "defaultSubscriptionType": {"target": SUBSCRIPTION_TYPE}, + }, +) + +ERROR_CODE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ErrorCode"), + shape_type=ShapeType.ENUM, + members={ + "INTERNAL_ERROR": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="InternalError") + ], + }, + "INVALID_REQUEST": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="InvalidRequest") + ], + }, + "RESOURCE_INACTIVE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="ResourceInactive") + ], + }, + "RESOURCE_NOT_FOUND": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="ResourceNotFound") + ], + }, + }, +) + +ERROR_DETAIL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ErrorDetail"), + members={ + "errorMessage": {"target": ERROR_MESSAGE}, + "errorCode": {"target": ERROR_CODE}, + }, +) + +GET_APPLICATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetApplicationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetApplicationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "displayName": {"target": APPLICATION_NAME}, + "applicationId": {"target": APPLICATION_ID}, + "applicationArn": {"target": APPLICATION_ARN}, + "identityType": {"target": IDENTITY_TYPE}, + "iamIdentityProviderArn": {"target": IAM_IDENTITY_PROVIDER_ARN}, + "identityCenterApplicationArn": {"target": IDC_APPLICATION_ARN}, + "roleArn": {"target": ROLE_ARN}, + "status": {"target": APPLICATION_STATUS}, + "description": {"target": DESCRIPTION}, + "encryptionConfiguration": { + "target": ENCRYPTION_CONFIGURATION, + "traits": [ + Trait.new( + id=ShapeID("aws.cloudformation#cfnMutability"), + value="create-and-read", + ) + ], + }, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + "error": { + "target": ERROR_DETAIL, + "traits": [Trait.new(id=ShapeID("aws.cloudformation#cfnExcludeProperty"))], + }, + "attachmentsConfiguration": { + "target": APPLIED_ATTACHMENTS_CONFIGURATION, + "traits": [Trait.new(id=ShapeID("aws.cloudformation#cfnExcludeProperty"))], + }, + "qAppsConfiguration": {"target": Q_APPS_CONFIGURATION}, + "personalizationConfiguration": {"target": PERSONALIZATION_CONFIGURATION}, + "autoSubscriptionConfiguration": {"target": AUTO_SUBSCRIPTION_CONFIGURATION}, + "clientIdsForOIDC": {"target": CLIENT_IDS_FOR_OIDC}, + "quickSightConfiguration": {"target": QUICK_SIGHT_CONFIGURATION}, + }, +) + +GET_APPLICATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetApplication"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=("qbusiness:ListTagsForResource",), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}", "method": "GET"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +INDEX_CAPACITY_INTEGER = Schema( + id=ShapeID("com.amazonaws.qbusiness#IndexCapacityInteger"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new(id=ShapeID("smithy.api#range"), value=MappingProxyType({"min": 1})), + ], +) + +INDEX_CAPACITY_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#IndexCapacityConfiguration"), + members={"units": {"target": INDEX_CAPACITY_INTEGER}}, +) + +INDEX_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#IndexName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1000}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + ], +) + +INDEX_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#IndexType"), + shape_type=ShapeType.ENUM, + members={ + "ENTERPRISE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENTERPRISE") + ], + }, + "STARTER": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="STARTER")], + }, + }, +) + +CREATE_INDEX_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateIndexInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateIndexRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "displayName": { + "target": INDEX_NAME, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("aws.cloudformation#cfnMutability"), value="full"), + ], + }, + "description": {"target": DESCRIPTION}, + "type": {"target": INDEX_TYPE}, + "tags": { + "target": TAGS, + "traits": [ + Trait.new(id=ShapeID("aws.cloudformation#cfnMutability"), value="full") + ], + }, + "capacityConfiguration": {"target": INDEX_CAPACITY_CONFIGURATION}, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + }, +) + +INDEX_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#IndexArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$", + ), + ], +) + +INDEX_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#IndexId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +CREATE_INDEX_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateIndexOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateIndexResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"indexId": {"target": INDEX_ID}, "indexArn": {"target": INDEX_ARN}}, +) + +CREATE_INDEX = Schema( + id=ShapeID("com.amazonaws.qbusiness#CreateIndex"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#conditionKeys"), + value=("aws:RequestTag/${TagKey}", "aws:TagKeys"), + ), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetIndex", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/indices", "method": "POST"} + ), + ), + ], +) + +DATA_SOURCE_CONFIGURATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#DataSourceConfiguration"), + shape_type=ShapeType.DOCUMENT, +) + +DATA_SOURCE_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#DataSourceName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1000}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + ], +) + +DOCUMENT_ENRICHMENT_CONDITION_OPERATOR = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentEnrichmentConditionOperator"), + shape_type=ShapeType.ENUM, + members={ + "GREATER_THAN": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="GREATER_THAN") + ], + }, + "GREATER_THAN_OR_EQUALS": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="GREATER_THAN_OR_EQUALS" + ) + ], + }, + "LESS_THAN": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="LESS_THAN") + ], + }, + "LESS_THAN_OR_EQUALS": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="LESS_THAN_OR_EQUALS" + ) + ], + }, + "EQUALS": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="EQUALS")], + }, + "NOT_EQUALS": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="NOT_EQUALS") + ], + }, + "CONTAINS": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="CONTAINS")], + }, + "NOT_CONTAINS": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="NOT_CONTAINS") + ], + }, + "EXISTS": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="EXISTS")], + }, + "NOT_EXISTS": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="NOT_EXISTS") + ], + }, + "BEGINS_WITH": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="BEGINS_WITH") + ], + }, + }, +) + +DOCUMENT_ATTRIBUTE_CONDITION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeCondition"), + members={ + "key": { + "target": DOCUMENT_ATTRIBUTE_KEY, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "operator": { + "target": DOCUMENT_ENRICHMENT_CONDITION_OPERATOR, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "value": {"target": DOCUMENT_ATTRIBUTE_VALUE}, + }, +) + +DOCUMENT_CONTENT_OPERATOR = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentContentOperator"), + shape_type=ShapeType.ENUM, + members={ + "DELETE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DELETE")], + } + }, +) + +ATTRIBUTE_VALUE_OPERATOR = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttributeValueOperator"), + shape_type=ShapeType.ENUM, + members={ + "DELETE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DELETE")], + } + }, +) + +DOCUMENT_ATTRIBUTE_TARGET = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeTarget"), + members={ + "key": { + "target": DOCUMENT_ATTRIBUTE_KEY, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "value": {"target": DOCUMENT_ATTRIBUTE_VALUE}, + "attributeValueOperator": {"target": ATTRIBUTE_VALUE_OPERATOR}, + }, +) + +INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#InlineDocumentEnrichmentConfiguration"), + members={ + "condition": {"target": DOCUMENT_ATTRIBUTE_CONDITION}, + "target": {"target": DOCUMENT_ATTRIBUTE_TARGET}, + "documentContentOperator": {"target": DOCUMENT_CONTENT_OPERATOR}, + }, +) + +INLINE_DOCUMENT_ENRICHMENT_CONFIGURATIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#InlineDocumentEnrichmentConfigurations"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 100}), + ) + ], + members={"member": {"target": INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION}}, +) + +LAMBDA_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#LambdaArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 2048}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:lambda:[a-z-]*-[0-9]:[0-9]{12}:function:[a-zA-Z0-9-_]+(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?(:[a-zA-Z0-9-_]+)?$", + ), + ], +) + +HOOK_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#HookConfiguration"), + members={ + "invocationCondition": {"target": DOCUMENT_ATTRIBUTE_CONDITION}, + "lambdaArn": {"target": LAMBDA_ARN}, + "s3BucketName": {"target": S3_BUCKET_NAME}, + "roleArn": {"target": ROLE_ARN}, + }, +) + +DOCUMENT_ENRICHMENT_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentEnrichmentConfiguration"), + members={ + "inlineConfigurations": {"target": INLINE_DOCUMENT_ENRICHMENT_CONFIGURATIONS}, + "preExtractionHookConfiguration": {"target": HOOK_CONFIGURATION}, + "postExtractionHookConfiguration": {"target": HOOK_CONFIGURATION}, + }, +) + +AUDIO_EXTRACTION_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AudioExtractionStatus"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +AUDIO_EXTRACTION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AudioExtractionConfiguration"), + members={ + "audioExtractionStatus": { + "target": AUDIO_EXTRACTION_STATUS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +IMAGE_EXTRACTION_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ImageExtractionStatus"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +IMAGE_EXTRACTION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ImageExtractionConfiguration"), + members={ + "imageExtractionStatus": { + "target": IMAGE_EXTRACTION_STATUS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +VIDEO_EXTRACTION_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#VideoExtractionStatus"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +VIDEO_EXTRACTION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#VideoExtractionConfiguration"), + members={ + "videoExtractionStatus": { + "target": VIDEO_EXTRACTION_STATUS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +MEDIA_EXTRACTION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MediaExtractionConfiguration"), + members={ + "imageExtractionConfiguration": {"target": IMAGE_EXTRACTION_CONFIGURATION}, + "audioExtractionConfiguration": {"target": AUDIO_EXTRACTION_CONFIGURATION}, + "videoExtractionConfiguration": {"target": VIDEO_EXTRACTION_CONFIGURATION}, + }, +) + +SYNC_SCHEDULE = Schema( + id=ShapeID("com.amazonaws.qbusiness#SyncSchedule"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), value=MappingProxyType({"max": 998}) + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[\\s\\S]*$"), + ], +) + +SECURITY_GROUP_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#SecurityGroupId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 200}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[-0-9a-zA-Z]+$"), + ], +) + +SECURITY_GROUP_IDS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SecurityGroupIds"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 10}), + ) + ], + members={"member": {"target": SECURITY_GROUP_ID}}, +) + +SUBNET_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#SubnetId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 200}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[-0-9a-zA-Z]+$"), + ], +) + +SUBNET_IDS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SubnetIds"), + shape_type=ShapeType.LIST, + members={"member": {"target": SUBNET_ID}}, +) + +DATA_SOURCE_VPC_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataSourceVpcConfiguration"), + members={ + "subnetIds": { + "target": SUBNET_IDS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "securityGroupIds": { + "target": SECURITY_GROUP_IDS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +CREATE_DATA_SOURCE_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateDataSourceInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateDataSourceRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "displayName": { + "target": DATA_SOURCE_NAME, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("aws.cloudformation#cfnMutability"), value="full"), + ], + }, + "configuration": { + "target": DATA_SOURCE_CONFIGURATION, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "vpcConfiguration": {"target": DATA_SOURCE_VPC_CONFIGURATION}, + "description": {"target": DESCRIPTION}, + "tags": { + "target": TAGS, + "traits": [ + Trait.new(id=ShapeID("aws.cloudformation#cfnMutability"), value="full") + ], + }, + "syncSchedule": {"target": SYNC_SCHEDULE}, + "roleArn": {"target": ROLE_ARN}, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + "documentEnrichmentConfiguration": { + "target": DOCUMENT_ENRICHMENT_CONFIGURATION + }, + "mediaExtractionConfiguration": {"target": MEDIA_EXTRACTION_CONFIGURATION}, + }, +) + +DATA_SOURCE_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#DataSourceArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$", + ), + ], +) + +DATA_SOURCE_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#DataSourceId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +CREATE_DATA_SOURCE_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateDataSourceOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateDataSourceResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "dataSourceId": {"target": DATA_SOURCE_ID}, + "dataSourceArn": {"target": DATA_SOURCE_ARN}, + }, +) + +CREATE_DATA_SOURCE = Schema( + id=ShapeID("com.amazonaws.qbusiness#CreateDataSource"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#conditionKeys"), + value=("aws:RequestTag/${TagKey}", "aws:TagKeys"), + ), + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetDataSource", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources", + "method": "POST", + } + ), + ), + ], +) + +DELETE_DATA_SOURCE_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteDataSourceInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteDataSourceRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "dataSourceId": { + "target": DATA_SOURCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +DELETE_DATA_SOURCE_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteDataSourceOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteDataSourceResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_DATA_SOURCE = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteDataSource"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), value=("qbusiness:GetDataSource",) + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", + "method": "DELETE", + } + ), + ), + ], +) + +GET_DATA_SOURCE_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetDataSourceInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetDataSourceRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "dataSourceId": { + "target": DATA_SOURCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +DATA_SOURCE_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataSourceStatus"), + shape_type=ShapeType.ENUM, + members={ + "PENDING_CREATION": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="PENDING_CREATION") + ], + }, + "CREATING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="CREATING")], + }, + "ACTIVE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ACTIVE")], + }, + "DELETING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DELETING")], + }, + "FAILED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FAILED")], + }, + "UPDATING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="UPDATING")], + }, + }, +) + +GET_DATA_SOURCE_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetDataSourceOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetDataSourceResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "applicationId": {"target": APPLICATION_ID}, + "indexId": {"target": INDEX_ID}, + "dataSourceId": {"target": DATA_SOURCE_ID}, + "dataSourceArn": {"target": DATA_SOURCE_ARN}, + "displayName": {"target": DATA_SOURCE_NAME}, + "type": {"target": STRING}, + "configuration": {"target": DATA_SOURCE_CONFIGURATION}, + "vpcConfiguration": {"target": DATA_SOURCE_VPC_CONFIGURATION}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + "description": {"target": DESCRIPTION}, + "status": {"target": DATA_SOURCE_STATUS}, + "syncSchedule": {"target": SYNC_SCHEDULE}, + "roleArn": {"target": ROLE_ARN}, + "error": { + "target": ERROR_DETAIL, + "traits": [Trait.new(id=ShapeID("aws.cloudformation#cfnExcludeProperty"))], + }, + "documentEnrichmentConfiguration": { + "target": DOCUMENT_ENRICHMENT_CONFIGURATION + }, + "mediaExtractionConfiguration": {"target": MEDIA_EXTRACTION_CONFIGURATION}, + }, +) + +GET_DATA_SOURCE = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetDataSource"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=("qbusiness:ListTagsForResource",), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", + "method": "GET", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListDataSources"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 10}), + ), + ], +) + +NEXT_TOKEN = Schema( + id=ShapeID("com.amazonaws.qbusiness#NextToken"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 800}), + ) + ], +) + +LIST_DATA_SOURCES_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListDataSourcesInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListDataSourcesRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +DATA_SOURCE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataSource"), + members={ + "displayName": {"target": DATA_SOURCE_NAME}, + "dataSourceId": {"target": DATA_SOURCE_ID}, + "type": {"target": STRING}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + "status": {"target": DATA_SOURCE_STATUS}, + }, +) + +DATA_SOURCES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataSources"), + shape_type=ShapeType.LIST, + members={"member": {"target": DATA_SOURCE}}, +) + +LIST_DATA_SOURCES_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListDataSourcesOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListDataSourcesResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "dataSources": {"target": DATA_SOURCES}, + "nextToken": {"target": NEXT_TOKEN}, + }, +) + +LIST_DATA_SOURCES = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListDataSources"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "dataSources", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources", + "method": "GET", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +UPDATE_DATA_SOURCE_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateDataSourceInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateDataSourceRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "dataSourceId": { + "target": DATA_SOURCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "displayName": {"target": DATA_SOURCE_NAME}, + "configuration": {"target": DATA_SOURCE_CONFIGURATION}, + "vpcConfiguration": {"target": DATA_SOURCE_VPC_CONFIGURATION}, + "description": {"target": DESCRIPTION}, + "syncSchedule": {"target": SYNC_SCHEDULE}, + "roleArn": {"target": ROLE_ARN}, + "documentEnrichmentConfiguration": { + "target": DOCUMENT_ENRICHMENT_CONFIGURATION + }, + "mediaExtractionConfiguration": {"target": MEDIA_EXTRACTION_CONFIGURATION}, + }, +) + +UPDATE_DATA_SOURCE_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateDataSourceOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateDataSourceResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +UPDATE_DATA_SOURCE = Schema( + id=ShapeID("com.amazonaws.qbusiness#UpdateDataSource"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetDataSource", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", + "method": "PUT", + } + ), + ), + ], +) + +DELETE_INDEX_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteIndexInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteIndexRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +DELETE_INDEX_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteIndexOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteIndexResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_INDEX = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteIndex"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new(id=ShapeID("aws.iam#requiredActions"), value=("qbusiness:GetIndex",)), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}", + "method": "DELETE", + } + ), + ), + ], +) + +GET_INDEX_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetIndexInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetIndexRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +DOCUMENT_METADATA_CONFIGURATION_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#DocumentMetadataConfigurationName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 30}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9_][a-zA-Z0-9_-]*$" + ), + ], +) + +STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Status"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +ATTRIBUTE_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttributeType"), + shape_type=ShapeType.ENUM, + members={ + "STRING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="STRING")], + }, + "STRING_LIST": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="STRING_LIST") + ], + }, + "NUMBER": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="NUMBER")], + }, + "DATE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DATE")], + }, + }, +) + +DOCUMENT_ATTRIBUTE_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeConfiguration"), + members={ + "name": {"target": DOCUMENT_METADATA_CONFIGURATION_NAME}, + "type": {"target": ATTRIBUTE_TYPE}, + "search": {"target": STATUS}, + }, +) + +DOCUMENT_ATTRIBUTE_CONFIGURATIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeConfigurations"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 500}), + ) + ], + members={"member": {"target": DOCUMENT_ATTRIBUTE_CONFIGURATION}}, +) + +INDEXED_TEXT_BYTES = Schema( + id=ShapeID("com.amazonaws.qbusiness#IndexedTextBytes"), + shape_type=ShapeType.LONG, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new(id=ShapeID("smithy.api#range"), value=MappingProxyType({"min": 0})), + ], +) + +INDEXED_TEXT_DOCUMENT = Schema( + id=ShapeID("com.amazonaws.qbusiness#IndexedTextDocument"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new(id=ShapeID("smithy.api#range"), value=MappingProxyType({"min": 0})), + ], +) + +TEXT_DOCUMENT_STATISTICS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#TextDocumentStatistics"), + members={ + "indexedTextBytes": {"target": INDEXED_TEXT_BYTES}, + "indexedTextDocumentCount": {"target": INDEXED_TEXT_DOCUMENT}, + }, +) + +INDEX_STATISTICS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#IndexStatistics"), + members={"textDocumentStatistics": {"target": TEXT_DOCUMENT_STATISTICS}}, +) + +INDEX_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#IndexStatus"), + shape_type=ShapeType.ENUM, + members={ + "CREATING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="CREATING")], + }, + "ACTIVE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ACTIVE")], + }, + "DELETING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DELETING")], + }, + "FAILED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FAILED")], + }, + "UPDATING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="UPDATING")], + }, + }, +) + +GET_INDEX_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetIndexOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetIndexResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "applicationId": {"target": APPLICATION_ID}, + "indexId": {"target": INDEX_ID}, + "displayName": {"target": INDEX_NAME}, + "indexArn": {"target": INDEX_ARN}, + "status": {"target": INDEX_STATUS}, + "type": {"target": INDEX_TYPE}, + "description": {"target": DESCRIPTION}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + "capacityConfiguration": {"target": INDEX_CAPACITY_CONFIGURATION}, + "documentAttributeConfigurations": { + "target": DOCUMENT_ATTRIBUTE_CONFIGURATIONS + }, + "error": { + "target": ERROR_DETAIL, + "traits": [Trait.new(id=ShapeID("aws.cloudformation#cfnExcludeProperty"))], + }, + "indexStatistics": {"target": INDEX_STATISTICS}, + }, +) + +GET_INDEX = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetIndex"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=("qbusiness:ListTagsForResource",), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}", + "method": "GET", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_INDICES = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListIndices"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + ], +) + +LIST_INDICES_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListIndicesInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListIndicesRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_INDICES, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +INDEX = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Index"), + members={ + "displayName": {"target": INDEX_NAME}, + "indexId": {"target": INDEX_ID}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + "status": {"target": INDEX_STATUS}, + }, +) + +INDICES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Indices"), + shape_type=ShapeType.LIST, + members={"member": {"target": INDEX}}, +) + +LIST_INDICES_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListIndicesOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListIndicesResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"nextToken": {"target": NEXT_TOKEN}, "indices": {"target": INDICES}}, +) + +LIST_INDICES = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListIndices"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "indices", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/indices", "method": "GET"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +UPDATE_INDEX_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateIndexInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateIndexRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "displayName": {"target": APPLICATION_NAME}, + "description": {"target": DESCRIPTION}, + "capacityConfiguration": {"target": INDEX_CAPACITY_CONFIGURATION}, + "documentAttributeConfigurations": { + "target": DOCUMENT_ATTRIBUTE_CONFIGURATIONS + }, + }, +) + +UPDATE_INDEX_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateIndexOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateIndexResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +UPDATE_INDEX = Schema( + id=ShapeID("com.amazonaws.qbusiness#UpdateIndex"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetIndex", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}", + "method": "PUT", + } + ), + ), + ], +) + +INTEGRATION_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#IntegrationId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]*$"), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_APPLICATIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListApplications"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + ], +) + +LIST_APPLICATIONS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListApplicationsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListApplicationsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_APPLICATIONS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +APPLICATIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Applications"), + shape_type=ShapeType.LIST, + members={"member": {"target": APPLICATION}}, +) + +LIST_APPLICATIONS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListApplicationsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListApplicationsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "nextToken": {"target": NEXT_TOKEN}, + "applications": {"target": APPLICATIONS}, + }, +) + +LIST_APPLICATIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListApplications"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "applications", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType({"uri": "/applications", "method": "GET"}), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +SECRET_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#SecretArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$", + ), + ], +) + +BASIC_AUTH_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#BasicAuthConfiguration"), + members={ + "secretArn": { + "target": SECRET_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "roleArn": { + "target": ROLE_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +IDC_AUTH_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#IdcAuthConfiguration"), + members={ + "idcApplicationArn": { + "target": IDC_APPLICATION_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "roleArn": { + "target": ROLE_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +NO_AUTH_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#NoAuthConfiguration") +) + +URL = Schema( + id=ShapeID("com.amazonaws.qbusiness#Url"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 2048}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^(https?|ftp|file)://([^\\s]*)$" + ), + ], +) + +O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#OAuth2ClientCredentialConfiguration"), + members={ + "secretArn": { + "target": SECRET_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "roleArn": { + "target": ROLE_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "authorizationUrl": {"target": URL}, + "tokenUrl": {"target": URL}, + }, +) + +PLUGIN_AUTH_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PluginAuthConfiguration"), + shape_type=ShapeType.UNION, + members={ + "basicAuthConfiguration": {"target": BASIC_AUTH_CONFIGURATION}, + "oAuth2ClientCredentialConfiguration": { + "target": O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION + }, + "noAuthConfiguration": {"target": NO_AUTH_CONFIGURATION}, + "idcAuthConfiguration": {"target": IDC_AUTH_CONFIGURATION}, + }, +) + +PLUGIN_DESCRIPTION = Schema( + id=ShapeID("com.amazonaws.qbusiness#PluginDescription"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 200}), + ) + ], +) + +CUSTOM_PLUGIN_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CustomPluginConfiguration"), + members={ + "description": { + "target": PLUGIN_DESCRIPTION, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "apiSchemaType": { + "target": API_SCHEMA_TYPE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "apiSchema": {"target": API_SCHEMA}, + }, +) + +PLUGIN_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#PluginName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + ], +) + +CREATE_PLUGIN_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreatePluginInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreatePluginRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "displayName": { + "target": PLUGIN_NAME, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "type": { + "target": PLUGIN_TYPE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "authConfiguration": { + "target": PLUGIN_AUTH_CONFIGURATION, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "serverUrl": {"target": URL}, + "customPluginConfiguration": {"target": CUSTOM_PLUGIN_CONFIGURATION}, + "tags": { + "target": TAGS, + "traits": [ + Trait.new(id=ShapeID("aws.cloudformation#cfnMutability"), value="full") + ], + }, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + }, +) + +PLUGIN_BUILD_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PluginBuildStatus"), + shape_type=ShapeType.ENUM, + members={ + "READY": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="READY")], + }, + "CREATE_IN_PROGRESS": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="CREATE_IN_PROGRESS" + ) + ], + }, + "CREATE_FAILED": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="CREATE_FAILED") + ], + }, + "UPDATE_IN_PROGRESS": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="UPDATE_IN_PROGRESS" + ) + ], + }, + "UPDATE_FAILED": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="UPDATE_FAILED") + ], + }, + "DELETE_IN_PROGRESS": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="DELETE_IN_PROGRESS" + ) + ], + }, + "DELETE_FAILED": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="DELETE_FAILED") + ], + }, + }, +) + +PLUGIN_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#PluginArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$", + ), + ], +) + +CREATE_PLUGIN_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreatePluginOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreatePluginResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "pluginId": {"target": PLUGIN_ID}, + "pluginArn": {"target": PLUGIN_ARN}, + "buildStatus": {"target": PLUGIN_BUILD_STATUS}, + }, +) + +CREATE_PLUGIN = Schema( + id=ShapeID("com.amazonaws.qbusiness#CreatePlugin"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#conditionKeys"), + value=("aws:RequestTag/${TagKey}", "aws:TagKeys"), + ), + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetPlugin", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"method": "POST", "uri": "/applications/{applicationId}/plugins"} + ), + ), + ], +) + +DELETE_PLUGIN_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeletePluginInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeletePluginRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "pluginId": { + "target": PLUGIN_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +DELETE_PLUGIN_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeletePluginOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeletePluginResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_PLUGIN = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeletePlugin"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), value=("qbusiness:GetPlugin",) + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "DELETE", + "uri": "/applications/{applicationId}/plugins/{pluginId}", + } + ), + ), + ], +) + +GET_PLUGIN_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetPluginInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetPluginRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "pluginId": { + "target": PLUGIN_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +PLUGIN_STATE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PluginState"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +GET_PLUGIN_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetPluginOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetPluginResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "applicationId": {"target": APPLICATION_ID}, + "pluginId": {"target": PLUGIN_ID}, + "displayName": {"target": PLUGIN_NAME}, + "type": {"target": PLUGIN_TYPE}, + "serverUrl": {"target": URL}, + "authConfiguration": {"target": PLUGIN_AUTH_CONFIGURATION}, + "customPluginConfiguration": {"target": CUSTOM_PLUGIN_CONFIGURATION}, + "buildStatus": {"target": PLUGIN_BUILD_STATUS}, + "pluginArn": {"target": PLUGIN_ARN}, + "state": {"target": PLUGIN_STATE}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + }, +) + +GET_PLUGIN = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetPlugin"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=("qbusiness:ListTagsForResource",), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/plugins/{pluginId}", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_PLUGINS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListPlugins"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 50}), + ), + ], +) + +LIST_PLUGINS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListPluginsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListPluginsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_PLUGINS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +PLUGIN = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Plugin"), + members={ + "pluginId": {"target": PLUGIN_ID}, + "displayName": {"target": PLUGIN_NAME}, + "type": {"target": PLUGIN_TYPE}, + "serverUrl": {"target": URL}, + "state": {"target": PLUGIN_STATE}, + "buildStatus": {"target": PLUGIN_BUILD_STATUS}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + }, +) + +PLUGINS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Plugins"), + shape_type=ShapeType.LIST, + members={"member": {"target": PLUGIN}}, +) + +LIST_PLUGINS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListPluginsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListPluginsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"nextToken": {"target": NEXT_TOKEN}, "plugins": {"target": PLUGINS}}, +) + +LIST_PLUGINS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListPlugins"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "plugins", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"method": "GET", "uri": "/applications/{applicationId}/plugins"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +UPDATE_PLUGIN_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdatePluginInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdatePluginRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "pluginId": { + "target": PLUGIN_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "displayName": {"target": PLUGIN_NAME}, + "state": {"target": PLUGIN_STATE}, + "serverUrl": {"target": URL}, + "customPluginConfiguration": {"target": CUSTOM_PLUGIN_CONFIGURATION}, + "authConfiguration": {"target": PLUGIN_AUTH_CONFIGURATION}, + }, +) + +UPDATE_PLUGIN_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdatePluginOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdatePluginResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +UPDATE_PLUGIN = Schema( + id=ShapeID("com.amazonaws.qbusiness#UpdatePlugin"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetPlugin", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "PUT", + "uri": "/applications/{applicationId}/plugins/{pluginId}", + } + ), + ), + ], +) + +KENDRA_INDEX_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#KendraIndexId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +KENDRA_INDEX_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#KendraIndexConfiguration"), + members={ + "indexId": { + "target": KENDRA_INDEX_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +BOOSTING_DURATION_IN_SECONDS = Schema( + id=ShapeID("com.amazonaws.qbusiness#BoostingDurationInSeconds"), + shape_type=ShapeType.LONG, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 0, "max": 999999999}), + ), + ], +) + +DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeBoostingLevel"), + shape_type=ShapeType.ENUM, + members={ + "NONE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="NONE")], + }, + "LOW": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="LOW")], + }, + "MEDIUM": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="MEDIUM")], + }, + "HIGH": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="HIGH")], + }, + "VERY_HIGH": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="VERY_HIGH") + ], + }, + "ONE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ONE")], + }, + "TWO": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="TWO")], + }, + }, +) + +DATE_ATTRIBUTE_BOOSTING_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DateAttributeBoostingConfiguration"), + members={ + "boostingLevel": { + "target": DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "boostingDurationInSeconds": {"target": BOOSTING_DURATION_IN_SECONDS}, + }, +) + +NUMBER_ATTRIBUTE_BOOSTING_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#NumberAttributeBoostingType"), + shape_type=ShapeType.ENUM, + members={ + "PRIORITIZE_LARGER_VALUES": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="PRIORITIZE_LARGER_VALUES" + ) + ], + }, + "PRIORITIZE_SMALLER_VALUES": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), + value="PRIORITIZE_SMALLER_VALUES", + ) + ], + }, + }, +) + +NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#NumberAttributeBoostingConfiguration"), + members={ + "boostingLevel": { + "target": DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "boostingType": {"target": NUMBER_ATTRIBUTE_BOOSTING_TYPE}, + }, +) + +STRING_ATTRIBUTE_VALUE_BOOSTING_LEVEL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#StringAttributeValueBoostingLevel"), + shape_type=ShapeType.ENUM, + members={ + "LOW": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="LOW")], + }, + "MEDIUM": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="MEDIUM")], + }, + "HIGH": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="HIGH")], + }, + "VERY_HIGH": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="VERY_HIGH") + ], + }, + "ONE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ONE")], + }, + "TWO": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="TWO")], + }, + "THREE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="THREE")], + }, + "FOUR": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FOUR")], + }, + "FIVE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FIVE")], + }, + }, +) + +STRING_ATTRIBUTE_VALUE_BOOSTING = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#StringAttributeValueBoosting"), + shape_type=ShapeType.MAP, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 10}), + ) + ], + members={ + "key": {"target": STRING}, + "value": {"target": STRING_ATTRIBUTE_VALUE_BOOSTING_LEVEL}, + }, +) + +STRING_ATTRIBUTE_BOOSTING_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#StringAttributeBoostingConfiguration"), + members={ + "boostingLevel": { + "target": DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "attributeValueBoosting": {"target": STRING_ATTRIBUTE_VALUE_BOOSTING}, + }, +) + +STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#StringListAttributeBoostingConfiguration"), + members={ + "boostingLevel": { + "target": DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeBoostingConfiguration"), + shape_type=ShapeType.UNION, + members={ + "numberConfiguration": {"target": NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION}, + "stringConfiguration": {"target": STRING_ATTRIBUTE_BOOSTING_CONFIGURATION}, + "dateConfiguration": {"target": DATE_ATTRIBUTE_BOOSTING_CONFIGURATION}, + "stringListConfiguration": { + "target": STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION + }, + }, +) + +DOCUMENT_ATTRIBUTE_BOOSTING_OVERRIDE_MAP = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeBoostingOverrideMap"), + shape_type=ShapeType.MAP, + traits=[ + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({"min": 1})) + ], + members={ + "key": {"target": DOCUMENT_ATTRIBUTE_KEY}, + "value": {"target": DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION}, + }, +) + +NATIVE_INDEX_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#NativeIndexConfiguration"), + members={ + "indexId": { + "target": INDEX_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "version": {"target": LONG}, + "boostingOverride": {"target": DOCUMENT_ATTRIBUTE_BOOSTING_OVERRIDE_MAP}, + }, +) + +RETRIEVER_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#RetrieverConfiguration"), + shape_type=ShapeType.UNION, + members={ + "nativeIndexConfiguration": {"target": NATIVE_INDEX_CONFIGURATION}, + "kendraIndexConfiguration": {"target": KENDRA_INDEX_CONFIGURATION}, + }, +) + +RETRIEVER_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#RetrieverName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1000}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + ], +) + +RETRIEVER_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#RetrieverType"), + shape_type=ShapeType.ENUM, + members={ + "NATIVE_INDEX": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="NATIVE_INDEX") + ], + }, + "KENDRA_INDEX": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="KENDRA_INDEX") + ], + }, + }, +) + +CREATE_RETRIEVER_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateRetrieverInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateRetrieverRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "type": { + "target": RETRIEVER_TYPE, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new( + id=ShapeID("aws.cloudformation#cfnMutability"), + value="create-and-read", + ), + ], + }, + "displayName": { + "target": RETRIEVER_NAME, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "configuration": { + "target": RETRIEVER_CONFIGURATION, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "roleArn": {"target": ROLE_ARN}, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + "tags": { + "target": TAGS, + "traits": [ + Trait.new(id=ShapeID("aws.cloudformation#cfnMutability"), value="full") + ], + }, + }, +) + +RETRIEVER_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#RetrieverArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$", + ), + ], +) + +RETRIEVER_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#RetrieverId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +CREATE_RETRIEVER_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateRetrieverOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateRetrieverResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "retrieverId": {"target": RETRIEVER_ID}, + "retrieverArn": {"target": RETRIEVER_ARN}, + }, +) + +CREATE_RETRIEVER = Schema( + id=ShapeID("com.amazonaws.qbusiness#CreateRetriever"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#conditionKeys"), + value=("aws:RequestTag/${TagKey}", "aws:TagKeys"), + ), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + "qbusiness:GetRetriever", + "iam:PassRole", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"method": "POST", "uri": "/applications/{applicationId}/retrievers"} + ), + ), + ], +) + +DELETE_RETRIEVER_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteRetrieverInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteRetrieverRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "retrieverId": { + "target": RETRIEVER_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +DELETE_RETRIEVER_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteRetrieverOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteRetrieverResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_RETRIEVER = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteRetriever"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), value=("qbusiness:GetRetriever",) + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "DELETE", + "uri": "/applications/{applicationId}/retrievers/{retrieverId}", + } + ), + ), + ], +) + +GET_RETRIEVER_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetRetrieverInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetRetrieverRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "retrieverId": { + "target": RETRIEVER_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +RETRIEVER_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#RetrieverStatus"), + shape_type=ShapeType.ENUM, + members={ + "CREATING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="CREATING")], + }, + "ACTIVE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ACTIVE")], + }, + "FAILED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FAILED")], + }, + }, +) + +GET_RETRIEVER_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetRetrieverOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetRetrieverResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "applicationId": {"target": APPLICATION_ID}, + "retrieverId": {"target": RETRIEVER_ID}, + "retrieverArn": {"target": RETRIEVER_ARN}, + "type": {"target": RETRIEVER_TYPE}, + "status": {"target": RETRIEVER_STATUS}, + "displayName": {"target": RETRIEVER_NAME}, + "configuration": {"target": RETRIEVER_CONFIGURATION}, + "roleArn": {"target": ROLE_ARN}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + }, +) + +GET_RETRIEVER = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetRetriever"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=("qbusiness:ListTagsForResource",), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/retrievers/{retrieverId}", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_RETRIEVERS_REQUEST = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListRetrieversRequest"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 50}), + ), + ], +) + +LIST_RETRIEVERS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListRetrieversInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListRetrieversRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_RETRIEVERS_REQUEST, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +RETRIEVER = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Retriever"), + members={ + "applicationId": {"target": APPLICATION_ID}, + "retrieverId": {"target": RETRIEVER_ID}, + "type": {"target": RETRIEVER_TYPE}, + "status": {"target": RETRIEVER_STATUS}, + "displayName": {"target": RETRIEVER_NAME}, + }, +) + +RETRIEVERS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Retrievers"), + shape_type=ShapeType.LIST, + members={"member": {"target": RETRIEVER}}, +) + +LIST_RETRIEVERS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListRetrieversOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListRetrieversResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"retrievers": {"target": RETRIEVERS}, "nextToken": {"target": NEXT_TOKEN}}, +) + +LIST_RETRIEVERS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListRetrievers"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "retrievers", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/retrievers", "method": "GET"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +UPDATE_RETRIEVER_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateRetrieverInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateRetrieverRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "retrieverId": { + "target": RETRIEVER_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "configuration": {"target": RETRIEVER_CONFIGURATION}, + "displayName": {"target": RETRIEVER_NAME}, + "roleArn": {"target": ROLE_ARN}, + }, +) + +UPDATE_RETRIEVER_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateRetrieverOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateRetrieverResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +UPDATE_RETRIEVER = Schema( + id=ShapeID("com.amazonaws.qbusiness#UpdateRetriever"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + "qbusiness:GetRetriever", + "iam:PassRole", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "PUT", + "uri": "/applications/{applicationId}/retrievers/{retrieverId}", + } + ), + ), + ], +) + +UPDATE_APPLICATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateApplicationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateApplicationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "identityCenterInstanceArn": {"target": INSTANCE_ARN}, + "displayName": {"target": APPLICATION_NAME}, + "description": {"target": DESCRIPTION}, + "roleArn": {"target": ROLE_ARN}, + "attachmentsConfiguration": {"target": ATTACHMENTS_CONFIGURATION}, + "qAppsConfiguration": {"target": Q_APPS_CONFIGURATION}, + "personalizationConfiguration": {"target": PERSONALIZATION_CONFIGURATION}, + "autoSubscriptionConfiguration": {"target": AUTO_SUBSCRIPTION_CONFIGURATION}, + }, +) + +UPDATE_APPLICATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateApplicationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateApplicationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +UPDATE_APPLICATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#UpdateApplication"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetApplication", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole", + "sso:CreateApplication", + "sso:PutApplicationAuthenticationMethod", + "sso:PutApplicationAccessScope", + "sso:PutApplicationGrant", + "sso:DeleteApplication", + "sso:DescribeInstance", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}", "method": "PUT"} + ), + ), + ], +) + +BROWSER_EXTENSION = Schema( + id=ShapeID("com.amazonaws.qbusiness#BrowserExtension"), shape_type=ShapeType.STRING +) + +BROWSER_EXTENSION_LIST = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#BrowserExtensionList"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new(id=ShapeID("smithy.api#uniqueItems")), + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 2}), + ), + ], + members={"member": {"target": BROWSER_EXTENSION}}, +) + +BROWSER_EXTENSION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#BrowserExtensionConfiguration"), + members={ + "enabledBrowserExtensions": { + "target": BROWSER_EXTENSION_LIST, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +CUSTOM_CSS_URL = Schema( + id=ShapeID("com.amazonaws.qbusiness#CustomCSSUrl"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^(https?://[a-zA-Z0-9-_.+%/]+\\.css)?$", + ), + ], +) + +FAVICON_URL = Schema( + id=ShapeID("com.amazonaws.qbusiness#FaviconUrl"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^(https?://[a-zA-Z0-9-_.+%/]+\\.(svg|ico))?$", + ), + ], +) + +FONT_URL = Schema( + id=ShapeID("com.amazonaws.qbusiness#FontUrl"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^(https?://[a-zA-Z0-9-_.+%/]+\\.(ttf|woff|woff2|otf))?$", + ), + ], +) + +LOGO_URL = Schema( + id=ShapeID("com.amazonaws.qbusiness#LogoUrl"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^(https?://[a-zA-Z0-9-_.+%/]+\\.(svg|png))?$", + ), + ], +) + +CUSTOMIZATION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CustomizationConfiguration"), + members={ + "customCSSUrl": {"target": CUSTOM_CSS_URL}, + "logoUrl": {"target": LOGO_URL}, + "fontUrl": {"target": FONT_URL}, + "faviconUrl": {"target": FAVICON_URL}, + }, +) + +OPEN_ID_CONNECT_PROVIDER_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#OpenIDConnectProviderConfiguration"), + members={ + "secretsArn": { + "target": SECRET_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "secretsRole": { + "target": ROLE_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +SAML_AUTHENTICATION_URL = Schema( + id=ShapeID("com.amazonaws.qbusiness#SamlAuthenticationUrl"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1284}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^https://.*$"), + ], +) + +SAML_PROVIDER_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SamlProviderConfiguration"), + members={ + "authenticationUrl": { + "target": SAML_AUTHENTICATION_URL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +IDENTITY_PROVIDER_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#IdentityProviderConfiguration"), + shape_type=ShapeType.UNION, + members={ + "samlConfiguration": {"target": SAML_PROVIDER_CONFIGURATION}, + "openIDConnectConfiguration": { + "target": OPEN_ID_CONNECT_PROVIDER_CONFIGURATION + }, + }, +) + +ORIGIN = Schema( + id=ShapeID("com.amazonaws.qbusiness#Origin"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 256}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^(http://|https://)[a-zA-Z0-9-_.]+(?::[0-9]{1,5})?$", + ), + ], +) + +WEB_EXPERIENCE_ORIGINS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#WebExperienceOrigins"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 10}), + ) + ], + members={"member": {"target": ORIGIN}}, +) + +WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#WebExperienceSamplePromptsControlMode"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +WEB_EXPERIENCE_SUBTITLE = Schema( + id=ShapeID("com.amazonaws.qbusiness#WebExperienceSubtitle"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 500}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[\\s\\S]*$"), + ], +) + +WEB_EXPERIENCE_TITLE = Schema( + id=ShapeID("com.amazonaws.qbusiness#WebExperienceTitle"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 500}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[\\s\\S]*$"), + ], +) + +WEB_EXPERIENCE_WELCOME_MESSAGE = Schema( + id=ShapeID("com.amazonaws.qbusiness#WebExperienceWelcomeMessage"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 300}), + ) + ], +) + +CREATE_WEB_EXPERIENCE_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateWebExperienceInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateWebExperienceRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "title": {"target": WEB_EXPERIENCE_TITLE}, + "subtitle": {"target": WEB_EXPERIENCE_SUBTITLE}, + "welcomeMessage": {"target": WEB_EXPERIENCE_WELCOME_MESSAGE}, + "samplePromptsControlMode": { + "target": WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE + }, + "origins": {"target": WEB_EXPERIENCE_ORIGINS}, + "roleArn": {"target": ROLE_ARN}, + "tags": { + "target": TAGS, + "traits": [ + Trait.new(id=ShapeID("aws.cloudformation#cfnMutability"), value="full") + ], + }, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + "identityProviderConfiguration": {"target": IDENTITY_PROVIDER_CONFIGURATION}, + "browserExtensionConfiguration": {"target": BROWSER_EXTENSION_CONFIGURATION}, + "customizationConfiguration": {"target": CUSTOMIZATION_CONFIGURATION}, + }, +) + +WEB_EXPERIENCE_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#WebExperienceArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$", + ), + ], +) + +WEB_EXPERIENCE_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#WebExperienceId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]*$"), + ], +) + +CREATE_WEB_EXPERIENCE_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateWebExperienceOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateWebExperienceResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "webExperienceId": {"target": WEB_EXPERIENCE_ID}, + "webExperienceArn": {"target": WEB_EXPERIENCE_ARN}, + }, +) + +CREATE_WEB_EXPERIENCE = Schema( + id=ShapeID("com.amazonaws.qbusiness#CreateWebExperience"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#conditionKeys"), + value=("aws:RequestTag/${TagKey}", "aws:TagKeys"), + ), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetWebExperience", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole", + "sso:PutApplicationGrant", + "sso:UpdateApplication", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/experiences", "method": "POST"} + ), + ), + ], +) + +DELETE_WEB_EXPERIENCE_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteWebExperienceInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteWebExperienceRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "webExperienceId": { + "target": WEB_EXPERIENCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +DELETE_WEB_EXPERIENCE_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteWebExperienceOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteWebExperienceResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_WEB_EXPERIENCE = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteWebExperience"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), value=("qbusiness:GetWebExperience",) + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}", + "method": "DELETE", + } + ), + ), + ], +) + +GET_WEB_EXPERIENCE_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetWebExperienceInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetWebExperienceRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "webExperienceId": { + "target": WEB_EXPERIENCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +SAML_METADATA_XML = Schema( + id=ShapeID("com.amazonaws.qbusiness#SamlMetadataXML"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1000, "max": 10000000}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^.*$"), + ], +) + +SAML_ATTRIBUTE = Schema( + id=ShapeID("com.amazonaws.qbusiness#SamlAttribute"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 256}), + ) + ], +) + +SAML_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SamlConfiguration"), + members={ + "metadataXML": { + "target": SAML_METADATA_XML, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "roleArn": { + "target": ROLE_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "userIdAttribute": { + "target": SAML_ATTRIBUTE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "userGroupAttribute": {"target": SAML_ATTRIBUTE}, + }, +) + +WEB_EXPERIENCE_AUTH_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#WebExperienceAuthConfiguration"), + shape_type=ShapeType.UNION, + members={"samlConfiguration": {"target": SAML_CONFIGURATION}}, +) + +WEB_EXPERIENCE_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#WebExperienceStatus"), + shape_type=ShapeType.ENUM, + members={ + "CREATING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="CREATING")], + }, + "ACTIVE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ACTIVE")], + }, + "DELETING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DELETING")], + }, + "FAILED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FAILED")], + }, + "PENDING_AUTH_CONFIG": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="PENDING_AUTH_CONFIG" + ) + ], + }, + }, +) + +GET_WEB_EXPERIENCE_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetWebExperienceOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetWebExperienceResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "applicationId": {"target": APPLICATION_ID}, + "webExperienceId": {"target": WEB_EXPERIENCE_ID}, + "webExperienceArn": {"target": WEB_EXPERIENCE_ARN}, + "defaultEndpoint": {"target": URL}, + "status": {"target": WEB_EXPERIENCE_STATUS}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + "title": {"target": WEB_EXPERIENCE_TITLE}, + "subtitle": {"target": WEB_EXPERIENCE_SUBTITLE}, + "welcomeMessage": {"target": WEB_EXPERIENCE_WELCOME_MESSAGE}, + "samplePromptsControlMode": { + "target": WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE + }, + "origins": {"target": WEB_EXPERIENCE_ORIGINS}, + "roleArn": {"target": ROLE_ARN}, + "identityProviderConfiguration": {"target": IDENTITY_PROVIDER_CONFIGURATION}, + "authenticationConfiguration": { + "target": WEB_EXPERIENCE_AUTH_CONFIGURATION, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#deprecated"), + value=MappingProxyType( + { + "message": "Property associated with legacy SAML IdP flow. Deprecated in favor of using AWS IAM Identity Center for user management." + } + ), + ) + ], + }, + "error": { + "target": ERROR_DETAIL, + "traits": [Trait.new(id=ShapeID("aws.cloudformation#cfnExcludeProperty"))], + }, + "browserExtensionConfiguration": {"target": BROWSER_EXTENSION_CONFIGURATION}, + "customizationConfiguration": {"target": CUSTOMIZATION_CONFIGURATION}, + }, +) + +GET_WEB_EXPERIENCE = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetWebExperience"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=("qbusiness:ListTagsForResource",), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}", + "method": "GET", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_WEB_EXPERIENCES_REQUEST = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListWebExperiencesRequest"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + ], +) + +LIST_WEB_EXPERIENCES_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListWebExperiencesInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListWebExperiencesRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_WEB_EXPERIENCES_REQUEST, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +WEB_EXPERIENCE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#WebExperience"), + members={ + "webExperienceId": {"target": WEB_EXPERIENCE_ID}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + "defaultEndpoint": {"target": URL}, + "status": {"target": WEB_EXPERIENCE_STATUS}, + }, +) + +WEB_EXPERIENCES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#WebExperiences"), + shape_type=ShapeType.LIST, + members={"member": {"target": WEB_EXPERIENCE}}, +) + +LIST_WEB_EXPERIENCES_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListWebExperiencesOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListWebExperiencesResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "webExperiences": {"target": WEB_EXPERIENCES}, + "nextToken": {"target": NEXT_TOKEN}, + }, +) + +LIST_WEB_EXPERIENCES = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListWebExperiences"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "webExperiences", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/experiences", "method": "GET"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +UPDATE_WEB_EXPERIENCE_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateWebExperienceInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateWebExperienceRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "webExperienceId": { + "target": WEB_EXPERIENCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "roleArn": {"target": ROLE_ARN}, + "authenticationConfiguration": { + "target": WEB_EXPERIENCE_AUTH_CONFIGURATION, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#deprecated"), + value=MappingProxyType( + { + "message": "Property associated with legacy SAML IdP flow. Deprecated in favor of using AWS IAM Identity Center for user management." + } + ), + ) + ], + }, + "title": {"target": WEB_EXPERIENCE_TITLE}, + "subtitle": {"target": WEB_EXPERIENCE_SUBTITLE}, + "welcomeMessage": {"target": WEB_EXPERIENCE_WELCOME_MESSAGE}, + "samplePromptsControlMode": { + "target": WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE + }, + "identityProviderConfiguration": {"target": IDENTITY_PROVIDER_CONFIGURATION}, + "origins": {"target": WEB_EXPERIENCE_ORIGINS}, + "browserExtensionConfiguration": {"target": BROWSER_EXTENSION_CONFIGURATION}, + "customizationConfiguration": {"target": CUSTOMIZATION_CONFIGURATION}, + }, +) + +UPDATE_WEB_EXPERIENCE_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateWebExperienceOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateWebExperienceResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +UPDATE_WEB_EXPERIENCE = Schema( + id=ShapeID("com.amazonaws.qbusiness#UpdateWebExperience"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetWebExperience", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole", + "sso:PutApplicationGrant", + "sso:UpdateApplication", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}", + "method": "PUT", + } + ), + ), + ], +) + +CREATOR_MODE_CONTROL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreatorModeControl"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +APPLIED_CREATOR_MODE_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AppliedCreatorModeConfiguration"), + members={ + "creatorModeControl": { + "target": CREATOR_MODE_CONTROL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +ORCHESTRATION_CONTROL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#OrchestrationControl"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +APPLIED_ORCHESTRATION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AppliedOrchestrationConfiguration"), + members={ + "control": { + "target": ORCHESTRATION_CONTROL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +ASSOCIATED_GROUP = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AssociatedGroup"), + members={"name": {"target": GROUP_NAME}, "type": {"target": MEMBERSHIP_TYPE}}, +) + +ASSOCIATED_GROUPS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AssociatedGroups"), + shape_type=ShapeType.LIST, + members={"member": {"target": ASSOCIATED_GROUP}}, +) + +ASSOCIATED_USER = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AssociatedUser"), + members={"id": {"target": STRING}, "type": {"target": MEMBERSHIP_TYPE}}, +) + +ASSOCIATED_USERS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AssociatedUsers"), + shape_type=ShapeType.LIST, + members={"member": {"target": ASSOCIATED_USER}}, +) + +Q_IAM_ACTIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#QIamActions"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 10}), + ) + ], + members={"member": {"target": Q_IAM_ACTION}}, +) + +PERMISSION_CONDITION_KEY = Schema( + id=ShapeID("com.amazonaws.qbusiness#PermissionConditionKey"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^aws:[a-zA-Z][a-zA-Z0-9-/:]*$" + ) + ], +) + +PERMISSION_CONDITION_OPERATOR = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PermissionConditionOperator"), + shape_type=ShapeType.ENUM, + members={ + "STRING_EQUALS": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="StringEquals") + ], + } + }, +) + +PERMISSION_CONDITION_VALUE = Schema( + id=ShapeID("com.amazonaws.qbusiness#PermissionConditionValue"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1000}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9._-]*$" + ), + ], +) + +PERMISSION_CONDITION_VALUES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PermissionConditionValues"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1}), + ) + ], + members={"member": {"target": PERMISSION_CONDITION_VALUE}}, +) + +PERMISSION_CONDITION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PermissionCondition"), + members={ + "conditionOperator": { + "target": PERMISSION_CONDITION_OPERATOR, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "conditionKey": { + "target": PERMISSION_CONDITION_KEY, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "conditionValues": { + "target": PERMISSION_CONDITION_VALUES, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +PERMISSION_CONDITIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PermissionConditions"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 10}), + ) + ], + members={"member": {"target": PERMISSION_CONDITION}}, +) + +STATEMENT_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#StatementId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9_-]+$"), + ], +) + +ASSOCIATE_PERMISSION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AssociatePermissionInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#AssociatePermissionRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "statementId": { + "target": STATEMENT_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "actions": { + "target": Q_IAM_ACTIONS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "conditions": {"target": PERMISSION_CONDITIONS}, + "principal": { + "target": PRINCIPAL_ROLE_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +ASSOCIATE_PERMISSION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AssociatePermissionOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#AssociatePermissionResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"statement": {"target": STRING}}, +) + +ASSOCIATE_PERMISSION = Schema( + id=ShapeID("com.amazonaws.qbusiness#AssociatePermission"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/policy", "method": "POST"} + ), + ) + ], +) + +ATTACHMENT_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#AttachmentId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", + ) + ], +) + +CONVERSATION_SOURCE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ConversationSource"), + members={ + "conversationId": { + "target": CONVERSATION_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "attachmentId": { + "target": ATTACHMENT_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +COPY_FROM_SOURCE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CopyFromSource"), + shape_type=ShapeType.UNION, + members={"conversation": {"target": CONVERSATION_SOURCE}}, +) + +ATTACHMENT_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#AttachmentName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1000}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^\\P{C}*$"), + ], +) + +ATTACHMENT_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttachmentStatus"), + shape_type=ShapeType.ENUM, + members={ + "FAILED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FAILED")], + }, + "SUCCESS": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="SUCCESS")], + }, + }, +) + +ATTACHMENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Attachment"), + members={ + "attachmentId": {"target": ATTACHMENT_ID}, + "conversationId": {"target": CONVERSATION_ID}, + "name": {"target": ATTACHMENT_NAME}, + "copyFrom": {"target": COPY_FROM_SOURCE}, + "fileType": {"target": STRING}, + "fileSize": {"target": INTEGER}, + "md5chksum": {"target": STRING}, + "createdAt": {"target": TIMESTAMP}, + "status": {"target": ATTACHMENT_STATUS}, + "error": {"target": ERROR_DETAIL}, + }, +) + +BLOB = Schema(id=ShapeID("com.amazonaws.qbusiness#Blob"), shape_type=ShapeType.BLOB) + +ATTACHMENT_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttachmentInput"), + members={ + "data": {"target": BLOB}, + "name": {"target": ATTACHMENT_NAME}, + "copyFrom": {"target": COPY_FROM_SOURCE}, + }, +) + +ATTACHMENT_INPUT_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttachmentInputEvent"), + members={"attachment": {"target": ATTACHMENT_INPUT}}, +) + +ATTACHMENT_LIST = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttachmentList"), + shape_type=ShapeType.LIST, + members={"member": {"target": ATTACHMENT}}, +) + +ATTACHMENT_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttachmentOutput"), + members={ + "name": {"target": ATTACHMENT_NAME}, + "status": {"target": ATTACHMENT_STATUS}, + "error": {"target": ERROR_DETAIL}, + "attachmentId": {"target": ATTACHMENT_ID}, + "conversationId": {"target": CONVERSATION_ID}, + }, +) + +ATTACHMENTS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttachmentsInput"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({"min": 1})) + ], + members={"member": {"target": ATTACHMENT_INPUT}}, +) + +ATTACHMENTS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttachmentsOutput"), + shape_type=ShapeType.LIST, + members={"member": {"target": ATTACHMENT_OUTPUT}}, +) + +AUDIO_EXTRACTION_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AudioExtractionType"), + shape_type=ShapeType.ENUM, + members={ + "TRANSCRIPT": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="TRANSCRIPT") + ], + }, + "SUMMARY": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="SUMMARY")], + }, + }, +) + +MEDIA_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#MediaId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +AUDIO_SOURCE_DETAILS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AudioSourceDetails"), + members={ + "mediaId": {"target": MEDIA_ID}, + "mediaMimeType": {"target": STRING}, + "startTimeMilliseconds": {"target": LONG}, + "endTimeMilliseconds": {"target": LONG}, + "audioExtractionType": {"target": AUDIO_EXTRACTION_TYPE}, + }, +) + +AUTH_CHALLENGE_REQUEST = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AuthChallengeRequest"), + members={ + "authorizationUrl": { + "target": URL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +AUTH_CHALLENGE_REQUEST_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AuthChallengeRequestEvent"), + members={ + "authorizationUrl": { + "target": URL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +AUTH_RESPONSE_KEY = Schema( + id=ShapeID("com.amazonaws.qbusiness#AuthResponseKey"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 100}), + ) + ], +) + +AUTH_RESPONSE_VALUE = Schema( + id=ShapeID("com.amazonaws.qbusiness#AuthResponseValue"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 2048}), + ) + ], +) + +AUTHORIZATION_RESPONSE_MAP = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AuthorizationResponseMap"), + shape_type=ShapeType.MAP, + members={ + "key": {"target": AUTH_RESPONSE_KEY}, + "value": {"target": AUTH_RESPONSE_VALUE}, + }, +) + +AUTH_CHALLENGE_RESPONSE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AuthChallengeResponse"), + members={ + "responseMap": { + "target": AUTHORIZATION_RESPONSE_MAP, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +AUTH_CHALLENGE_RESPONSE_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AuthChallengeResponseEvent"), + members={ + "responseMap": { + "target": AUTHORIZATION_RESPONSE_MAP, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +EXECUTION_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#ExecutionId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +DOCUMENT_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#DocumentId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1825}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^\\P{C}*$"), + ], +) + +DELETE_DOCUMENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteDocument"), + members={ + "documentId": { + "target": DOCUMENT_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +DELETE_DOCUMENTS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteDocuments"), + shape_type=ShapeType.LIST, + members={"member": {"target": DELETE_DOCUMENT}}, +) + +BATCH_DELETE_DOCUMENT_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#BatchDeleteDocumentInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#BatchDeleteDocumentRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "documents": { + "target": DELETE_DOCUMENTS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "dataSourceSyncId": {"target": EXECUTION_ID}, + }, +) + +FAILED_DOCUMENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#FailedDocument"), + members={ + "id": {"target": DOCUMENT_ID}, + "error": {"target": ERROR_DETAIL}, + "dataSourceId": {"target": DATA_SOURCE_ID}, + }, +) + +FAILED_DOCUMENTS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#FailedDocuments"), + shape_type=ShapeType.LIST, + members={"member": {"target": FAILED_DOCUMENT}}, +) + +BATCH_DELETE_DOCUMENT_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#BatchDeleteDocumentOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#BatchDeleteDocumentResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"failedDocuments": {"target": FAILED_DOCUMENTS}}, +) + +BATCH_DELETE_DOCUMENT = Schema( + id=ShapeID("com.amazonaws.qbusiness#BatchDeleteDocument"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "POST", + "uri": "/applications/{applicationId}/indices/{indexId}/documents/delete", + } + ), + ) + ], +) + +DOCUMENT_ATTRIBUTES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAttributes"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 500}), + ) + ], + members={"member": {"target": DOCUMENT_ATTRIBUTE}}, +) + +DOCUMENT_CONTENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentContent"), + shape_type=ShapeType.UNION, + members={"blob": {"target": _BLOB}, "s3": {"target": S3}}, +) + +CONTENT_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ContentType"), + shape_type=ShapeType.ENUM, + members={ + "PDF": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="PDF")], + }, + "HTML": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="HTML")], + }, + "MS_WORD": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="MS_WORD")], + }, + "PLAIN_TEXT": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="PLAIN_TEXT") + ], + }, + "PPT": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="PPT")], + }, + "RTF": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="RTF")], + }, + "XML": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="XML")], + }, + "XSLT": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="XSLT")], + }, + "MS_EXCEL": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="MS_EXCEL")], + }, + "CSV": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="CSV")], + }, + "JSON": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="JSON")], + }, + "MD": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="MD")], + }, + }, +) + +TITLE = Schema( + id=ShapeID("com.amazonaws.qbusiness#Title"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1024}), + ) + ], +) + +DOCUMENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Document"), + members={ + "id": { + "target": DOCUMENT_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "attributes": {"target": DOCUMENT_ATTRIBUTES}, + "content": {"target": DOCUMENT_CONTENT}, + "contentType": {"target": CONTENT_TYPE}, + "title": {"target": TITLE}, + "accessConfiguration": {"target": ACCESS_CONFIGURATION}, + "documentEnrichmentConfiguration": { + "target": DOCUMENT_ENRICHMENT_CONFIGURATION + }, + "mediaExtractionConfiguration": {"target": MEDIA_EXTRACTION_CONFIGURATION}, + }, +) + +DOCUMENTS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Documents"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 10}), + ) + ], + members={"member": {"target": DOCUMENT}}, +) + +BATCH_PUT_DOCUMENT_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#BatchPutDocumentInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#BatchPutDocumentRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "documents": { + "target": DOCUMENTS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "roleArn": {"target": ROLE_ARN}, + "dataSourceSyncId": {"target": EXECUTION_ID}, + }, +) + +BATCH_PUT_DOCUMENT_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#BatchPutDocumentOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#BatchPutDocumentResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"failedDocuments": {"target": FAILED_DOCUMENTS}}, +) + +BATCH_PUT_DOCUMENT = Schema( + id=ShapeID("com.amazonaws.qbusiness#BatchPutDocument"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "POST", + "uri": "/applications/{applicationId}/indices/{indexId}/documents", + } + ), + ) + ], +) + +BLOCKED_PHRASE = Schema( + id=ShapeID("com.amazonaws.qbusiness#BlockedPhrase"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({"max": 36})), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^\\P{C}*$"), + ], +) + +BLOCKED_PHRASES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#BlockedPhrases"), + shape_type=ShapeType.LIST, + members={"member": {"target": BLOCKED_PHRASE}}, +) + +SYSTEM_MESSAGE_OVERRIDE = Schema( + id=ShapeID("com.amazonaws.qbusiness#SystemMessageOverride"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), value=MappingProxyType({"max": 350}) + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^\\P{C}*$"), + ], +) + +BLOCKED_PHRASES_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#BlockedPhrasesConfiguration"), + members={ + "blockedPhrases": {"target": BLOCKED_PHRASES}, + "systemMessageOverride": {"target": SYSTEM_MESSAGE_OVERRIDE}, + }, +) + +BLOCKED_PHRASES_CONFIGURATION_UPDATE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#BlockedPhrasesConfigurationUpdate"), + members={ + "blockedPhrasesToCreateOrUpdate": {"target": BLOCKED_PHRASES}, + "blockedPhrasesToDelete": {"target": BLOCKED_PHRASES}, + "systemMessageOverride": {"target": SYSTEM_MESSAGE_OVERRIDE}, + }, +) + +SUBSCRIPTION_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#SubscriptionId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1224}), + ) + ], +) + +CANCEL_SUBSCRIPTION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CancelSubscriptionInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CancelSubscriptionRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "subscriptionId": { + "target": SUBSCRIPTION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +SUBSCRIPTION_DETAILS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SubscriptionDetails"), + members={"type": {"target": SUBSCRIPTION_TYPE}}, +) + +SUBSCRIPTION_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#SubscriptionArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 10, "max": 1224}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$", + ), + ], +) + +CANCEL_SUBSCRIPTION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CancelSubscriptionOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CancelSubscriptionResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "subscriptionArn": {"target": SUBSCRIPTION_ARN}, + "currentSubscription": {"target": SUBSCRIPTION_DETAILS}, + "nextSubscription": {"target": SUBSCRIPTION_DETAILS}, + }, +) + +CANCEL_SUBSCRIPTION = Schema( + id=ShapeID("com.amazonaws.qbusiness#CancelSubscription"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "DELETE", + "uri": "/applications/{applicationId}/subscriptions/{subscriptionId}", + } + ), + ), + ], +) + +CHAT_MODE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatMode"), + shape_type=ShapeType.ENUM, + members={ + "RETRIEVAL_MODE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="RETRIEVAL_MODE") + ], + }, + "CREATOR_MODE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="CREATOR_MODE") + ], + }, + "PLUGIN_MODE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="PLUGIN_MODE") + ], + }, + }, +) + +PLUGIN_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PluginConfiguration"), + members={ + "pluginId": { + "target": PLUGIN_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +CHAT_MODE_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatModeConfiguration"), + shape_type=ShapeType.UNION, + members={"pluginConfiguration": {"target": PLUGIN_CONFIGURATION}}, +) + +END_OF_INPUT_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#EndOfInputEvent") +) + +USER_MESSAGE = Schema( + id=ShapeID("com.amazonaws.qbusiness#UserMessage"), shape_type=ShapeType.STRING +) + +TEXT_INPUT_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#TextInputEvent"), + members={ + "userMessage": { + "target": USER_MESSAGE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +USER_GROUPS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UserGroups"), + shape_type=ShapeType.LIST, + members={"member": {"target": STRING}}, +) + +FAILED_ATTACHMENT_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#FailedAttachmentEvent"), + members={ + "conversationId": {"target": CONVERSATION_ID}, + "userMessageId": {"target": MESSAGE_ID}, + "systemMessageId": {"target": MESSAGE_ID}, + "attachment": {"target": ATTACHMENT_OUTPUT}, + }, +) + +SOURCE_ATTRIBUTION_MEDIA_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#SourceAttributionMediaId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +SNIPPET_EXCERPT_TEXT = Schema( + id=ShapeID("com.amazonaws.qbusiness#SnippetExcerptText"), + shape_type=ShapeType.STRING, +) + +SNIPPET_EXCERPT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SnippetExcerpt"), + members={"text": {"target": SNIPPET_EXCERPT_TEXT}}, +) + +IMAGE_SOURCE_DETAILS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ImageSourceDetails"), + members={"mediaId": {"target": MEDIA_ID}, "mediaMimeType": {"target": STRING}}, +) + +VIDEO_EXTRACTION_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#VideoExtractionType"), + shape_type=ShapeType.ENUM, + members={ + "TRANSCRIPT": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="TRANSCRIPT") + ], + }, + "SUMMARY": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="SUMMARY")], + }, + }, +) + +VIDEO_SOURCE_DETAILS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#VideoSourceDetails"), + members={ + "mediaId": {"target": MEDIA_ID}, + "mediaMimeType": {"target": STRING}, + "startTimeMilliseconds": {"target": LONG}, + "endTimeMilliseconds": {"target": LONG}, + "videoExtractionType": {"target": VIDEO_EXTRACTION_TYPE}, + }, +) + +SOURCE_DETAILS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SourceDetails"), + shape_type=ShapeType.UNION, + members={ + "imageSourceDetails": {"target": IMAGE_SOURCE_DETAILS}, + "audioSourceDetails": {"target": AUDIO_SOURCE_DETAILS}, + "videoSourceDetails": {"target": VIDEO_SOURCE_DETAILS}, + }, +) + +TEXT_SEGMENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#TextSegment"), + members={ + "beginOffset": {"target": INTEGER}, + "endOffset": {"target": INTEGER}, + "snippetExcerpt": {"target": SNIPPET_EXCERPT}, + "mediaId": { + "target": SOURCE_ATTRIBUTION_MEDIA_ID, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#deprecated"), + value=MappingProxyType( + { + "since": "2025-02-28", + "message": "Deprecated in favor of using mediaId within the respective sourceDetails field.", + } + ), + ) + ], + }, + "mediaMimeType": { + "target": STRING, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#deprecated"), + value=MappingProxyType( + { + "since": "2025-02-28", + "message": "Deprecated in favor of using mediaMimeType within the respective sourceDetails field.", + } + ), + ) + ], + }, + "sourceDetails": {"target": SOURCE_DETAILS}, + }, +) + +TEXT_SEGMENT_LIST = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#TextSegmentList"), + shape_type=ShapeType.LIST, + members={"member": {"target": TEXT_SEGMENT}}, +) + +SOURCE_ATTRIBUTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SourceAttribution"), + members={ + "title": {"target": STRING}, + "snippet": {"target": STRING}, + "url": {"target": STRING}, + "citationNumber": {"target": INTEGER}, + "updatedAt": {"target": TIMESTAMP}, + "textMessageSegments": {"target": TEXT_SEGMENT_LIST}, + "documentId": {"target": STRING}, + "indexId": {"target": STRING}, + "datasourceId": {"target": STRING}, + }, +) + +SOURCE_ATTRIBUTIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SourceAttributions"), + shape_type=ShapeType.LIST, + traits=[Trait.new(id=ShapeID("smithy.api#sparse"))], + members={"member": {"target": SOURCE_ATTRIBUTION}}, +) + +METADATA_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MetadataEvent"), + members={ + "conversationId": {"target": CONVERSATION_ID}, + "userMessageId": {"target": MESSAGE_ID}, + "systemMessageId": {"target": MESSAGE_ID}, + "sourceAttributions": {"target": SOURCE_ATTRIBUTIONS}, + "finalTextMessage": {"target": STRING}, + }, +) + +SYSTEM_MESSAGE_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SystemMessageType"), + shape_type=ShapeType.ENUM, + members={ + "RESPONSE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="RESPONSE")], + }, + "GROUNDED_RESPONSE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="GROUNDED_RESPONSE") + ], + }, + }, +) + +TEXT_OUTPUT_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#TextOutputEvent"), + members={ + "systemMessageType": {"target": SYSTEM_MESSAGE_TYPE}, + "conversationId": {"target": CONVERSATION_ID}, + "userMessageId": {"target": MESSAGE_ID}, + "systemMessageId": {"target": MESSAGE_ID}, + "systemMessage": {"target": STRING}, + }, +) + +CHAT_OUTPUT_STREAM = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatOutputStream"), + shape_type=ShapeType.UNION, + traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], + members={ + "textEvent": {"target": TEXT_OUTPUT_EVENT}, + "metadataEvent": {"target": METADATA_EVENT}, + "actionReviewEvent": {"target": ACTION_REVIEW_EVENT}, + "failedAttachmentEvent": {"target": FAILED_ATTACHMENT_EVENT}, + "authChallengeRequestEvent": {"target": AUTH_CHALLENGE_REQUEST_EVENT}, + }, +) + +CHAT_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatOutput"), + traits=[Trait.new(id=ShapeID("smithy.api#output"))], + members={ + "outputStream": { + "target": CHAT_OUTPUT_STREAM, + "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], + } + }, +) + +EXTERNAL_RESOURCE_EXCEPTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ExternalResourceException"), + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=424), + ], + members={ + "message": { + "target": ERROR_MESSAGE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +LICENSE_NOT_FOUND_EXCEPTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#LicenseNotFoundException"), + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=400), + ], + members={ + "message": { + "target": ERROR_MESSAGE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +CHAT_RESPONSE_CONFIGURATION_ARN = Schema( + id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfigurationArn"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1284}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$", + ), + ], +) + +CHAT_RESPONSE_CONFIGURATION_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfigurationId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +DISPLAY_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#DisplayName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 100}), + ) + ], +) + +RESPONSE_CONFIGURATION_SUMMARY = Schema( + id=ShapeID("com.amazonaws.qbusiness#ResponseConfigurationSummary"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1000}), + ) + ], +) + +CHAT_RESPONSE_CONFIGURATION_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfigurationStatus"), + shape_type=ShapeType.ENUM, + members={ + "CREATING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="CREATING")], + }, + "UPDATING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="UPDATING")], + }, + "FAILED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FAILED")], + }, + "ACTIVE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ACTIVE")], + }, + }, +) + +CHAT_RESPONSE_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfiguration"), + members={ + "chatResponseConfigurationId": { + "target": CHAT_RESPONSE_CONFIGURATION_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "chatResponseConfigurationArn": { + "target": CHAT_RESPONSE_CONFIGURATION_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "displayName": { + "target": DISPLAY_NAME, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "responseConfigurationSummary": {"target": RESPONSE_CONFIGURATION_SUMMARY}, + "status": { + "target": CHAT_RESPONSE_CONFIGURATION_STATUS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + }, +) + +RESPONSE_CONFIGURATION_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ResponseConfigurationType"), + shape_type=ShapeType.ENUM, + members={ + "ALL": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ALL")], + } + }, +) + +INSTRUCTION = Schema( + id=ShapeID("com.amazonaws.qbusiness#Instruction"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 5, "max": 1000}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[\\s\\S]*$"), + ], +) + +INSTRUCTION_COLLECTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#InstructionCollection"), + members={ + "responseLength": {"target": INSTRUCTION}, + "targetAudience": {"target": INSTRUCTION}, + "perspective": {"target": INSTRUCTION}, + "outputStyle": {"target": INSTRUCTION}, + "identity": {"target": INSTRUCTION}, + "tone": {"target": INSTRUCTION}, + "customInstructions": {"target": INSTRUCTION}, + "examples": {"target": INSTRUCTION}, + }, +) + +RESPONSE_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ResponseConfiguration"), + members={"instructionCollection": {"target": INSTRUCTION_COLLECTION}}, +) + +RESPONSE_CONFIGURATIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ResponseConfigurations"), + shape_type=ShapeType.MAP, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1}), + ) + ], + members={ + "key": {"target": RESPONSE_CONFIGURATION_TYPE}, + "value": {"target": RESPONSE_CONFIGURATION}, + }, +) + +CHAT_RESPONSE_CONFIGURATION_DETAIL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfigurationDetail"), + members={ + "responseConfigurations": {"target": RESPONSE_CONFIGURATIONS}, + "responseConfigurationSummary": {"target": STRING}, + "status": {"target": CHAT_RESPONSE_CONFIGURATION_STATUS}, + "error": {"target": ERROR_DETAIL}, + "updatedAt": {"target": TIMESTAMP}, + }, +) + +CHAT_RESPONSE_CONFIGURATIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfigurations"), + shape_type=ShapeType.LIST, + members={"member": {"target": CHAT_RESPONSE_CONFIGURATION}}, +) + +CHAT_SYNC_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatSyncOutput"), + traits=[Trait.new(id=ShapeID("smithy.api#output"))], + members={ + "conversationId": {"target": CONVERSATION_ID}, + "systemMessage": {"target": STRING}, + "systemMessageId": {"target": MESSAGE_ID}, + "userMessageId": {"target": MESSAGE_ID}, + "actionReview": {"target": ACTION_REVIEW}, + "authChallengeRequest": {"target": AUTH_CHALLENGE_REQUEST}, + "sourceAttributions": {"target": SOURCE_ATTRIBUTIONS}, + "failedAttachments": {"target": ATTACHMENTS_OUTPUT}, + }, +) + +CHECK_DOCUMENT_ACCESS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CheckDocumentAccessInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CheckDocumentAccessRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "documentId": { + "target": DOCUMENT_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "dataSourceId": { + "target": DATA_SOURCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceId") + ], + }, + }, +) + +DOCUMENT_ACL_GROUP = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAclGroup"), + members={"name": {"target": GROUP_NAME}, "type": {"target": MEMBERSHIP_TYPE}}, +) + +DOCUMENT_ACL_GROUPS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAclGroups"), + shape_type=ShapeType.LIST, + members={"member": {"target": DOCUMENT_ACL_GROUP}}, +) + +DOCUMENT_ACL_USER = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAclUser"), + members={"id": {"target": STRING}, "type": {"target": MEMBERSHIP_TYPE}}, +) + +DOCUMENT_ACL_USERS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAclUsers"), + shape_type=ShapeType.LIST, + members={"member": {"target": DOCUMENT_ACL_USER}}, +) + +DOCUMENT_ACL_CONDITION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAclCondition"), + members={ + "memberRelation": {"target": MEMBER_RELATION}, + "users": {"target": DOCUMENT_ACL_USERS}, + "groups": {"target": DOCUMENT_ACL_GROUPS}, + }, +) + +DOCUMENT_ACL_CONDITIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAclConditions"), + shape_type=ShapeType.LIST, + members={"member": {"target": DOCUMENT_ACL_CONDITION}}, +) + +DOCUMENT_ACL_MEMBERSHIP = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAclMembership"), + members={ + "memberRelation": {"target": MEMBER_RELATION}, + "conditions": {"target": DOCUMENT_ACL_CONDITIONS}, + }, +) + +DOCUMENT_ACL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentAcl"), + members={ + "allowlist": {"target": DOCUMENT_ACL_MEMBERSHIP}, + "denyList": {"target": DOCUMENT_ACL_MEMBERSHIP}, + }, +) + +CHECK_DOCUMENT_ACCESS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CheckDocumentAccessOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CheckDocumentAccessResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "userGroups": {"target": ASSOCIATED_GROUPS}, + "userAliases": {"target": ASSOCIATED_USERS}, + "hasAccess": {"target": BOOLEAN}, + "documentAcl": {"target": DOCUMENT_ACL}, + }, +) + +CHECK_DOCUMENT_ACCESS = Schema( + id=ShapeID("com.amazonaws.qbusiness#CheckDocumentAccess"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/index/{indexId}/users/{userId}/documents/{documentId}/check-document-access", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +CONTENT_BLOCKER_RULE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ContentBlockerRule"), + members={"systemMessageOverride": {"target": SYSTEM_MESSAGE_OVERRIDE}}, +) + +ELIGIBLE_DATA_SOURCE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#EligibleDataSource"), + members={ + "indexId": {"target": INDEX_ID}, + "dataSourceId": {"target": DATA_SOURCE_ID}, + }, +) + +ELIGIBLE_DATA_SOURCES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#EligibleDataSources"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({"max": 5})) + ], + members={"member": {"target": ELIGIBLE_DATA_SOURCE}}, +) + +CONTENT_RETRIEVAL_RULE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ContentRetrievalRule"), + members={"eligibleDataSources": {"target": ELIGIBLE_DATA_SOURCES}}, +) + +RETRIEVER_CONTENT_SOURCE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#RetrieverContentSource"), + members={ + "retrieverId": { + "target": RETRIEVER_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +CONTENT_SOURCE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ContentSource"), + shape_type=ShapeType.UNION, + members={"retriever": {"target": RETRIEVER_CONTENT_SOURCE}}, +) + +CONVERSATION_TITLE = Schema( + id=ShapeID("com.amazonaws.qbusiness#ConversationTitle"), shape_type=ShapeType.STRING +) + +CONVERSATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Conversation"), + members={ + "conversationId": {"target": CONVERSATION_ID}, + "title": {"target": CONVERSATION_TITLE}, + "startTime": {"target": TIMESTAMP}, + }, +) + +CONVERSATIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Conversations"), + shape_type=ShapeType.LIST, + members={"member": {"target": CONVERSATION}}, +) + +SESSION_DURATION_IN_MINUTES = Schema( + id=ShapeID("com.amazonaws.qbusiness#SessionDurationInMinutes"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 15, "max": 60}), + ), + ], +) + +CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "webExperienceId": { + "target": WEB_EXPERIENCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "sessionDurationInMinutes": {"target": SESSION_DURATION_IN_MINUTES}, + }, +) + +CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"anonymousUrl": {"target": URL}}, +) + +CREATE_ANONYMOUS_WEB_EXPERIENCE_URL = Schema( + id=ShapeID("com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrl"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}/anonymous-url", + "method": "POST", + } + ), + ) + ], +) + +CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateChatResponseConfigurationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateChatResponseConfigurationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "displayName": { + "target": DISPLAY_NAME, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "clientToken": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + "responseConfigurations": { + "target": RESPONSE_CONFIGURATIONS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "tags": { + "target": TAGS, + "traits": [ + Trait.new(id=ShapeID("aws.cloudformation#cfnMutability"), value="full") + ], + }, + }, +) + +CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateChatResponseConfigurationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateChatResponseConfigurationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "chatResponseConfigurationId": { + "target": CHAT_RESPONSE_CONFIGURATION_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "chatResponseConfigurationArn": { + "target": CHAT_RESPONSE_CONFIGURATION_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +CREATE_CHAT_RESPONSE_CONFIGURATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#CreateChatResponseConfiguration"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#conditionKeys"), + value=("aws:RequestTag/${TagKey}", "aws:TagKeys"), + ), + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#iamAction"), + value=MappingProxyType( + { + "requiredActions": ( + "qbusiness:GetChatResponseConfiguration", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + ) + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "POST", + "uri": "/applications/{applicationId}/chatresponseconfigurations", + } + ), + ), + ], +) + +GROUP_IDENTIFIER = Schema( + id=ShapeID("com.amazonaws.qbusiness#GroupIdentifier"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 47}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$", + ), + ], +) + +USER_IDENTIFIER = Schema( + id=ShapeID("com.amazonaws.qbusiness#UserIdentifier"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 47}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$", + ), + ], +) + +SUBSCRIPTION_PRINCIPAL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SubscriptionPrincipal"), + shape_type=ShapeType.UNION, + members={ + "user": {"target": USER_IDENTIFIER}, + "group": {"target": GROUP_IDENTIFIER}, + }, +) + +CREATE_SUBSCRIPTION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateSubscriptionInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateSubscriptionRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "principal": { + "target": SUBSCRIPTION_PRINCIPAL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "type": { + "target": SUBSCRIPTION_TYPE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + }, +) + +CREATE_SUBSCRIPTION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateSubscriptionOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateSubscriptionResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "subscriptionId": {"target": SUBSCRIPTION_ID}, + "subscriptionArn": {"target": SUBSCRIPTION_ARN}, + "currentSubscription": {"target": SUBSCRIPTION_DETAILS}, + "nextSubscription": {"target": SUBSCRIPTION_DETAILS}, + }, +) + +CREATE_SUBSCRIPTION = Schema( + id=ShapeID("com.amazonaws.qbusiness#CreateSubscription"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"method": "POST", "uri": "/applications/{applicationId}/subscriptions"} + ), + ), + ], +) + +USER_ALIAS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UserAlias"), + members={ + "indexId": {"target": INDEX_ID}, + "dataSourceId": {"target": DATA_SOURCE_ID}, + "userId": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +USER_ALIASES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UserAliases"), + shape_type=ShapeType.LIST, + members={"member": {"target": USER_ALIAS}}, +) + +CREATE_USER_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateUserInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateUserRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "userAliases": { + "target": USER_ALIASES, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 100}), + ) + ], + }, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + }, +) + +CREATE_USER_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateUserOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateUserResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +CREATE_USER = Schema( + id=ShapeID("com.amazonaws.qbusiness#CreateUser"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"method": "POST", "uri": "/applications/{applicationId}/users"} + ), + ), + ], +) + +CREATOR_MODE_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreatorModeConfiguration"), + members={ + "creatorModeControl": { + "target": CREATOR_MODE_CONTROL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +DATA_SOURCE_IDS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataSourceIds"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1}), + ) + ], + members={"member": {"target": DATA_SOURCE_ID}}, +) + +METRIC_VALUE = Schema( + id=ShapeID("com.amazonaws.qbusiness#MetricValue"), + shape_type=ShapeType.STRING, + traits=[Trait.new(id=ShapeID("smithy.api#pattern"), value="^(([1-9][0-9]*)|0)$")], +) + +DATA_SOURCE_SYNC_JOB_METRICS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataSourceSyncJobMetrics"), + members={ + "documentsAdded": {"target": METRIC_VALUE}, + "documentsModified": {"target": METRIC_VALUE}, + "documentsDeleted": {"target": METRIC_VALUE}, + "documentsFailed": {"target": METRIC_VALUE}, + "documentsScanned": {"target": METRIC_VALUE}, + }, +) + +DATA_SOURCE_SYNC_JOB_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataSourceSyncJobStatus"), + shape_type=ShapeType.ENUM, + members={ + "FAILED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FAILED")], + }, + "SUCCEEDED": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="SUCCEEDED") + ], + }, + "SYNCING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="SYNCING")], + }, + "INCOMPLETE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="INCOMPLETE") + ], + }, + "STOPPING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="STOPPING")], + }, + "ABORTED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ABORTED")], + }, + "SYNCING_INDEXING": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="SYNCING_INDEXING") + ], + }, + }, +) + +DATA_SOURCE_SYNC_JOB = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataSourceSyncJob"), + members={ + "executionId": {"target": EXECUTION_ID}, + "startTime": {"target": TIMESTAMP}, + "endTime": {"target": TIMESTAMP}, + "status": {"target": DATA_SOURCE_SYNC_JOB_STATUS}, + "error": {"target": ERROR_DETAIL}, + "dataSourceErrorCode": {"target": STRING}, + "metrics": {"target": DATA_SOURCE_SYNC_JOB_METRICS}, + }, +) + +DATA_SOURCE_SYNC_JOBS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DataSourceSyncJobs"), + shape_type=ShapeType.LIST, + members={"member": {"target": DATA_SOURCE_SYNC_JOB}}, +) + +DATA_SOURCE_USER_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#DataSourceUserId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 1024}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^\\P{C}*$"), + ], +) + +DELETE_ATTACHMENT_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteAttachmentInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteAttachmentRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "conversationId": { + "target": CONVERSATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "attachmentId": { + "target": ATTACHMENT_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": USER_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], + }, + }, +) + +DELETE_ATTACHMENT_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteAttachmentOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteAttachmentResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_ATTACHMENT = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteAttachment"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/conversations/{conversationId}/attachments/{attachmentId}", + "method": "DELETE", + } + ), + ), + ], +) + +DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteChatControlsConfigurationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteChatControlsConfigurationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + } + }, +) + +DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteChatControlsConfigurationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteChatControlsConfigurationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_CHAT_CONTROLS_CONFIGURATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteChatControlsConfiguration"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/chatcontrols", + "method": "DELETE", + "code": 200, + } + ), + ), + ], +) + +DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteChatResponseConfigurationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteChatResponseConfigurationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "chatResponseConfigurationId": { + "target": CHAT_RESPONSE_CONFIGURATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteChatResponseConfigurationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteChatResponseConfigurationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_CHAT_RESPONSE_CONFIGURATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteChatResponseConfiguration"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#iamAction"), + value=MappingProxyType( + {"requiredActions": ("qbusiness:GetChatResponseConfiguration",)} + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "DELETE", + "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}", + } + ), + ), + ], +) + +DELETE_CONVERSATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteConversationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteConversationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "conversationId": { + "target": CONVERSATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": USER_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], + }, + }, +) + +DELETE_CONVERSATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteConversationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteConversationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_CONVERSATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteConversation"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/conversations/{conversationId}", + "method": "DELETE", + } + ), + ), + ], +) + +DELETE_GROUP_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteGroupInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteGroupRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "groupName": { + "target": GROUP_NAME, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "dataSourceId": { + "target": DATA_SOURCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceId") + ], + }, + }, +) + +DELETE_GROUP_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteGroupOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteGroupResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_GROUP = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteGroup"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "DELETE", + "uri": "/applications/{applicationId}/indices/{indexId}/groups/{groupName}", + } + ), + ), + ], +) + +DELETE_USER_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteUserInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteUserRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +DELETE_USER_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DeleteUserOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DeleteUserResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DELETE_USER = Schema( + id=ShapeID("com.amazonaws.qbusiness#DeleteUser"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "DELETE", + "uri": "/applications/{applicationId}/users/{userId}", + } + ), + ), + ], +) + +DISASSOCIATE_PERMISSION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DisassociatePermissionInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DisassociatePermissionRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "statementId": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +DISASSOCIATE_PERMISSION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DisassociatePermissionOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#DisassociatePermissionResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +DISASSOCIATE_PERMISSION = Schema( + id=ShapeID("com.amazonaws.qbusiness#DisassociatePermission"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/policy/{statementId}", + "method": "DELETE", + } + ), + ), + ], +) + +DOCUMENT_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentStatus"), + shape_type=ShapeType.ENUM, + members={ + "RECEIVED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="RECEIVED")], + }, + "PROCESSING": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="PROCESSING") + ], + }, + "INDEXED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="INDEXED")], + }, + "UPDATED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="UPDATED")], + }, + "FAILED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FAILED")], + }, + "DELETING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DELETING")], + }, + "DELETED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DELETED")], + }, + "DOCUMENT_FAILED_TO_INDEX": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="DOCUMENT_FAILED_TO_INDEX" + ) + ], + }, + }, +) + +DOCUMENT_DETAILS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentDetails"), + members={ + "documentId": {"target": DOCUMENT_ID}, + "status": {"target": DOCUMENT_STATUS}, + "error": {"target": ERROR_DETAIL}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + }, +) + +DOCUMENT_DETAIL_LIST = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#DocumentDetailList"), + shape_type=ShapeType.LIST, + members={"member": {"target": DOCUMENT_DETAILS}}, +) + +EXAMPLE_CHAT_MESSAGE = Schema( + id=ShapeID("com.amazonaws.qbusiness#ExampleChatMessage"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), value=MappingProxyType({"max": 350}) + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^\\P{C}*$"), + ], +) + +EXAMPLE_CHAT_MESSAGES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ExampleChatMessages"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({"max": 5})) + ], + members={"member": {"target": EXAMPLE_CHAT_MESSAGE}}, +) + +MAX_RESULTS_INTEGER_FOR_GET_TOPIC_CONFIGURATIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForGetTopicConfigurations"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 50}), + ), + ], +) + +GET_CHAT_CONTROLS_CONFIGURATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetChatControlsConfigurationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetChatControlsConfigurationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_GET_TOPIC_CONFIGURATIONS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + }, +) + +HALLUCINATION_REDUCTION_CONTROL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#HallucinationReductionControl"), + shape_type=ShapeType.ENUM, + members={ + "ENABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="ENABLED")], + }, + "DISABLED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DISABLED")], + }, + }, +) + +HALLUCINATION_REDUCTION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#HallucinationReductionConfiguration"), + members={ + "hallucinationReductionControl": {"target": HALLUCINATION_REDUCTION_CONTROL} + }, +) + +RESPONSE_SCOPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ResponseScope"), + shape_type=ShapeType.ENUM, + members={ + "ENTERPRISE_CONTENT_ONLY": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="ENTERPRISE_CONTENT_ONLY" + ) + ], + }, + "EXTENDED_KNOWLEDGE_ENABLED": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), + value="EXTENDED_KNOWLEDGE_ENABLED", + ) + ], + }, + }, +) + +TOPIC_DESCRIPTION = Schema( + id=ShapeID("com.amazonaws.qbusiness#TopicDescription"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 350}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^\\P{C}*$"), + ], +) + +TOPIC_CONFIGURATION_NAME = Schema( + id=ShapeID("com.amazonaws.qbusiness#TopicConfigurationName"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{0,35}$" + ), + ], +) + +USER_IDS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UserIds"), + shape_type=ShapeType.LIST, + members={"member": {"target": STRING}}, +) + +USERS_AND_GROUPS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UsersAndGroups"), + members={"userIds": {"target": USER_IDS}, "userGroups": {"target": USER_GROUPS}}, +) + +RULE_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#RuleConfiguration"), + shape_type=ShapeType.UNION, + members={ + "contentBlockerRule": {"target": CONTENT_BLOCKER_RULE}, + "contentRetrievalRule": {"target": CONTENT_RETRIEVAL_RULE}, + }, +) + +RULE_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#RuleType"), + shape_type=ShapeType.ENUM, + members={ + "CONTENT_BLOCKER_RULE": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="CONTENT_BLOCKER_RULE" + ) + ], + }, + "CONTENT_RETRIEVAL_RULE": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="CONTENT_RETRIEVAL_RULE" + ) + ], + }, + }, +) + +RULE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Rule"), + members={ + "includedUsersAndGroups": {"target": USERS_AND_GROUPS}, + "excludedUsersAndGroups": {"target": USERS_AND_GROUPS}, + "ruleType": { + "target": RULE_TYPE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "ruleConfiguration": {"target": RULE_CONFIGURATION}, + }, +) + +RULES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Rules"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({"max": 10})) + ], + members={"member": {"target": RULE}}, +) + +TOPIC_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#TopicConfiguration"), + members={ + "name": { + "target": TOPIC_CONFIGURATION_NAME, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "description": {"target": TOPIC_DESCRIPTION}, + "exampleChatMessages": {"target": EXAMPLE_CHAT_MESSAGES}, + "rules": { + "target": RULES, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +TOPIC_CONFIGURATIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#TopicConfigurations"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({"max": 10})) + ], + members={"member": {"target": TOPIC_CONFIGURATION}}, +) + +GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetChatControlsConfigurationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetChatControlsConfigurationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "responseScope": {"target": RESPONSE_SCOPE}, + "orchestrationConfiguration": {"target": APPLIED_ORCHESTRATION_CONFIGURATION}, + "blockedPhrases": {"target": BLOCKED_PHRASES_CONFIGURATION}, + "topicConfigurations": {"target": TOPIC_CONFIGURATIONS}, + "creatorModeConfiguration": {"target": APPLIED_CREATOR_MODE_CONFIGURATION}, + "nextToken": {"target": NEXT_TOKEN}, + "hallucinationReductionConfiguration": { + "target": HALLUCINATION_REDUCTION_CONFIGURATION + }, + }, +) + +GET_CHAT_CONTROLS_CONFIGURATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetChatControlsConfiguration"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "topicConfigurations", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/chatcontrols", + "method": "GET", + "code": 200, + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +GET_CHAT_RESPONSE_CONFIGURATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetChatResponseConfigurationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetChatResponseConfigurationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "chatResponseConfigurationId": { + "target": CHAT_RESPONSE_CONFIGURATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetChatResponseConfigurationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetChatResponseConfigurationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "chatResponseConfigurationId": {"target": CHAT_RESPONSE_CONFIGURATION_ID}, + "chatResponseConfigurationArn": {"target": CHAT_RESPONSE_CONFIGURATION_ARN}, + "displayName": {"target": DISPLAY_NAME}, + "createdAt": {"target": TIMESTAMP}, + "inUseConfiguration": {"target": CHAT_RESPONSE_CONFIGURATION_DETAIL}, + "lastUpdateConfiguration": {"target": CHAT_RESPONSE_CONFIGURATION_DETAIL}, + }, +) + +GET_CHAT_RESPONSE_CONFIGURATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetChatResponseConfiguration"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#iamAction"), + value=MappingProxyType( + {"requiredActions": ("qbusiness:ListTagsForResource",)} + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +OUTPUT_FORMAT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#OutputFormat"), + shape_type=ShapeType.ENUM, + members={ + "RAW": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="RAW")], + }, + "EXTRACTED": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="EXTRACTED") + ], + }, + }, +) + +GET_DOCUMENT_CONTENT_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetDocumentContentInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetDocumentContentRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "dataSourceId": { + "target": DATA_SOURCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceId") + ], + }, + "documentId": { + "target": DOCUMENT_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "outputFormat": { + "target": OUTPUT_FORMAT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="outputFormat") + ], + }, + }, +) + +GET_DOCUMENT_CONTENT_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetDocumentContentOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetDocumentContentResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "presignedUrl": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "mimeType": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +GET_DOCUMENT_CONTENT = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetDocumentContent"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/index/{indexId}/documents/{documentId}/content", + "method": "GET", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +GET_GROUP_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetGroupInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetGroupRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "groupName": { + "target": GROUP_NAME, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "dataSourceId": { + "target": DATA_SOURCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceId") + ], + }, + }, +) + +GROUP_STATUS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GroupStatus"), + shape_type=ShapeType.ENUM, + members={ + "FAILED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="FAILED")], + }, + "SUCCEEDED": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="SUCCEEDED") + ], + }, + "PROCESSING": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="PROCESSING") + ], + }, + "DELETING": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DELETING")], + }, + "DELETED": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="DELETED")], + }, + }, +) + +GROUP_STATUS_DETAIL = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GroupStatusDetail"), + members={ + "status": {"target": GROUP_STATUS}, + "lastUpdatedAt": {"target": TIMESTAMP}, + "errorDetail": {"target": ERROR_DETAIL}, + }, +) + +GROUP_STATUS_DETAILS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GroupStatusDetails"), + shape_type=ShapeType.LIST, + members={"member": {"target": GROUP_STATUS_DETAIL}}, +) + +GET_GROUP_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetGroupOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetGroupResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "status": {"target": GROUP_STATUS_DETAIL}, + "statusHistory": {"target": GROUP_STATUS_DETAILS}, + }, +) + +GET_GROUP = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetGroup"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/indices/{indexId}/groups/{groupName}", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +GET_MEDIA_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetMediaInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetMediaRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "conversationId": { + "target": CONVERSATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "messageId": { + "target": MESSAGE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "mediaId": { + "target": MEDIA_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +GET_MEDIA_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetMediaOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetMediaResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"mediaBytes": {"target": BLOB}, "mediaMimeType": {"target": STRING}}, +) + +MEDIA_TOO_LARGE_EXCEPTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MediaTooLargeException"), + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=400), + ], + members={ + "message": { + "target": ERROR_MESSAGE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +GET_MEDIA = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetMedia"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/conversations/{conversationId}/messages/{messageId}/media/{mediaId}", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +GET_POLICY_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetPolicyInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetPolicyRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + } + }, +) + +GET_POLICY_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetPolicyOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetPolicyResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"policy": {"target": STRING}}, +) + +GET_POLICY = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetPolicy"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/policy", "method": "GET"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +GET_USER_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetUserInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetUserRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +GET_USER_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetUserOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetUserResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"userAliases": {"target": USER_ALIASES}}, +) + +GET_USER = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetUser"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"method": "GET", "uri": "/applications/{applicationId}/users/{userId}"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_ATTACHMENTS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListAttachments"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + ], +) + +LIST_ATTACHMENTS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListAttachmentsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListAttachmentsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "conversationId": { + "target": CONVERSATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="conversationId") + ], + }, + "userId": { + "target": USER_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_ATTACHMENTS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +LIST_ATTACHMENTS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListAttachmentsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListAttachmentsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "attachments": {"target": ATTACHMENT_LIST}, + "nextToken": {"target": NEXT_TOKEN}, + }, +) + +LIST_ATTACHMENTS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListAttachments"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "attachments", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/attachments", "method": "GET"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListChatResponseConfigurationsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListChatResponseConfigurationsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "maxResults": { + "target": INTEGER, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + }, +) + +LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListChatResponseConfigurationsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListChatResponseConfigurationsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "chatResponseConfigurations": {"target": CHAT_RESPONSE_CONFIGURATIONS}, + "nextToken": {"target": NEXT_TOKEN}, + }, +) + +LIST_CHAT_RESPONSE_CONFIGURATIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListChatResponseConfigurations"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "chatResponseConfigurations", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/chatresponseconfigurations", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_CONVERSATIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListConversations"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + ], +) + +LIST_CONVERSATIONS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListConversationsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListConversationsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": USER_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_CONVERSATIONS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +LIST_CONVERSATIONS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListConversationsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListConversationsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "nextToken": {"target": NEXT_TOKEN}, + "conversations": {"target": CONVERSATIONS}, + }, +) + +LIST_CONVERSATIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListConversations"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "conversations", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/conversations", "method": "GET"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES_SYNC_JOBS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListDataSourcesSyncJobs"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 10}), + ), + ], +) + +LIST_DATA_SOURCE_SYNC_JOBS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListDataSourceSyncJobsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListDataSourceSyncJobsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "dataSourceId": { + "target": DATA_SOURCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES_SYNC_JOBS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + "startTime": { + "target": TIMESTAMP, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="startTime") + ], + }, + "endTime": { + "target": TIMESTAMP, + "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="endTime")], + }, + "statusFilter": { + "target": DATA_SOURCE_SYNC_JOB_STATUS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="syncStatus") + ], + }, + }, +) + +LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListDataSourceSyncJobsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListDataSourceSyncJobsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "history": {"target": DATA_SOURCE_SYNC_JOBS}, + "nextToken": {"target": NEXT_TOKEN}, + }, +) + +LIST_DATA_SOURCE_SYNC_JOBS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListDataSourceSyncJobs"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "history", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/syncjobs", + "method": "GET", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_DOCUMENTS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListDocuments"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + ], +) + +LIST_DOCUMENTS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListDocumentsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListDocumentsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "dataSourceIds": { + "target": DATA_SOURCE_IDS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceIds") + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_DOCUMENTS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +LIST_DOCUMENTS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListDocumentsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListDocumentsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "documentDetailList": {"target": DOCUMENT_DETAIL_LIST}, + "nextToken": {"target": NEXT_TOKEN}, + }, +) + +LIST_DOCUMENTS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListDocuments"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "documentDetailList", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/index/{indexId}/documents", + "method": "GET", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_GROUPS_REQUEST = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListGroupsRequest"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 10}), + ), + ], +) + +LIST_GROUPS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListGroupsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListGroupsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "updatedEarlierThan": { + "target": TIMESTAMP, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new( + id=ShapeID("smithy.api#httpQuery"), value="updatedEarlierThan" + ), + ], + }, + "dataSourceId": { + "target": DATA_SOURCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceId") + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_GROUPS_REQUEST, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +GROUP_SUMMARY = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GroupSummary"), + members={"groupName": {"target": GROUP_NAME}}, +) + +GROUP_SUMMARY_LIST = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GroupSummaryList"), + shape_type=ShapeType.LIST, + members={"member": {"target": GROUP_SUMMARY}}, +) + +LIST_GROUPS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListGroupsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListGroupsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "nextToken": {"target": NEXT_TOKEN}, + "items": {"target": GROUP_SUMMARY_LIST}, + }, +) + +LIST_GROUPS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListGroups"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/indices/{indexId}/groups", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_MESSAGES = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListMessages"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + ], +) + +LIST_MESSAGES_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListMessagesInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListMessagesRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "conversationId": { + "target": CONVERSATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": USER_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_MESSAGES, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +MESSAGE_BODY = Schema( + id=ShapeID("com.amazonaws.qbusiness#MessageBody"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1000}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^\\P{C}*$}$"), + ], +) + +MESSAGE_TYPE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MessageType"), + shape_type=ShapeType.ENUM, + members={ + "USER": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="USER")], + }, + "SYSTEM": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="SYSTEM")], + }, + }, +) + +MESSAGE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Message"), + members={ + "messageId": {"target": STRING}, + "body": {"target": MESSAGE_BODY}, + "time": {"target": TIMESTAMP}, + "type": {"target": MESSAGE_TYPE}, + "attachments": {"target": ATTACHMENTS_OUTPUT}, + "sourceAttribution": {"target": SOURCE_ATTRIBUTIONS}, + "actionReview": {"target": ACTION_REVIEW}, + "actionExecution": {"target": ACTION_EXECUTION}, + }, +) + +MESSAGES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Messages"), + shape_type=ShapeType.LIST, + members={"member": {"target": MESSAGE}}, +) + +LIST_MESSAGES_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListMessagesOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListMessagesResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"messages": {"target": MESSAGES}, "nextToken": {"target": NEXT_TOKEN}}, +) + +LIST_MESSAGES = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListMessages"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "messages", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/conversations/{conversationId}", + "method": "GET", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_ACTIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListPluginActions"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 50}), + ), + ], +) + +LIST_PLUGIN_ACTIONS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListPluginActionsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListPluginActionsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "pluginId": { + "target": PLUGIN_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_ACTIONS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +LIST_PLUGIN_ACTIONS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListPluginActionsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListPluginActionsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"nextToken": {"target": NEXT_TOKEN}, "items": {"target": ACTIONS}}, +) + +LIST_PLUGIN_ACTIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListPluginActions"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/plugins/{pluginId}/actions", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_ACTIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListPluginTypeActions"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 50}), + ), + ], +) + +LIST_PLUGIN_TYPE_ACTIONS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeActionsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListPluginTypeActionsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "pluginType": { + "target": PLUGIN_TYPE, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_ACTIONS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +LIST_PLUGIN_TYPE_ACTIONS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeActionsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListPluginTypeActionsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"nextToken": {"target": NEXT_TOKEN}, "items": {"target": ACTIONS}}, +) + +LIST_PLUGIN_TYPE_ACTIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeActions"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"method": "GET", "uri": "/pluginTypes/{pluginType}/actions"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_METADATA = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListPluginTypeMetadata"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 50}), + ), + ], +) + +LIST_PLUGIN_TYPE_METADATA_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeMetadataInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListPluginTypeMetadataRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_METADATA, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +PLUGIN_TYPE_CATEGORY = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PluginTypeCategory"), + shape_type=ShapeType.ENUM, + members={ + "CRM": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), + value="Customer relationship management (CRM)", + ) + ], + }, + "PROJECT_MANAGEMENT": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="Project management" + ) + ], + }, + "COMMUNICATION": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="Communication") + ], + }, + "PRODUCTIVITY": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="Productivity") + ], + }, + "TICKETING_MANAGEMENT": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), + value="Ticketing and incident management", + ) + ], + }, + }, +) + +PLUGIN_TYPE_METADATA_SUMMARY = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PluginTypeMetadataSummary"), + members={ + "type": {"target": PLUGIN_TYPE}, + "category": {"target": PLUGIN_TYPE_CATEGORY}, + "description": {"target": STRING}, + }, +) + +LIST_PLUGIN_TYPE_METADATA_SUMMARIES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeMetadataSummaries"), + shape_type=ShapeType.LIST, + members={"member": {"target": PLUGIN_TYPE_METADATA_SUMMARY}}, +) + +LIST_PLUGIN_TYPE_METADATA_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeMetadataOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListPluginTypeMetadataResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "nextToken": {"target": NEXT_TOKEN}, + "items": {"target": LIST_PLUGIN_TYPE_METADATA_SUMMARIES}, + }, +) + +LIST_PLUGIN_TYPE_METADATA = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeMetadata"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType({"method": "GET", "uri": "/pluginTypeMetadata"}), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +MAX_RESULTS_INTEGER_FOR_LIST_SUBSCRIPTIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListSubscriptions"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + ], +) + +LIST_SUBSCRIPTIONS_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListSubscriptionsInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListSubscriptionsRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "nextToken": { + "target": NEXT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") + ], + }, + "maxResults": { + "target": MAX_RESULTS_INTEGER_FOR_LIST_SUBSCRIPTIONS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") + ], + }, + }, +) + +SUBSCRIPTION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Subscription"), + members={ + "subscriptionId": {"target": SUBSCRIPTION_ID}, + "subscriptionArn": {"target": SUBSCRIPTION_ARN}, + "principal": {"target": SUBSCRIPTION_PRINCIPAL}, + "currentSubscription": {"target": SUBSCRIPTION_DETAILS}, + "nextSubscription": {"target": SUBSCRIPTION_DETAILS}, + }, +) + +SUBSCRIPTIONS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#Subscriptions"), + shape_type=ShapeType.LIST, + members={"member": {"target": SUBSCRIPTION}}, +) + +LIST_SUBSCRIPTIONS_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListSubscriptionsOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListSubscriptionsResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "nextToken": {"target": NEXT_TOKEN}, + "subscriptions": {"target": SUBSCRIPTIONS}, + }, +) + +LIST_SUBSCRIPTIONS = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListSubscriptions"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "subscriptions", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"method": "GET", "uri": "/applications/{applicationId}/subscriptions"} + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListTagsForResourceInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListTagsForResourceRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "resourceARN": { + "target": AMAZON_RESOURCE_NAME, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + } + }, +) + +LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ListTagsForResourceOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#ListTagsForResourceResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"tags": {"target": TAGS}}, +) + +LIST_TAGS_FOR_RESOURCE = Schema( + id=ShapeID("com.amazonaws.qbusiness#ListTagsForResource"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType({"uri": "/v1/tags/{resourceARN}", "method": "GET"}), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +SYSTEM_MESSAGE_ID = Schema( + id=ShapeID("com.amazonaws.qbusiness#SystemMessageId"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 36, "max": 36}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + ), + ], +) + +MESSAGE_USEFULNESS_COMMENT = Schema( + id=ShapeID("com.amazonaws.qbusiness#MessageUsefulnessComment"), + shape_type=ShapeType.STRING, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 1000}), + ), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^\\P{C}*$"), + ], +) + +MESSAGE_USEFULNESS_REASON = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MessageUsefulnessReason"), + shape_type=ShapeType.ENUM, + members={ + "NOT_FACTUALLY_CORRECT": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="NOT_FACTUALLY_CORRECT" + ) + ], + }, + "HARMFUL_OR_UNSAFE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="HARMFUL_OR_UNSAFE") + ], + }, + "INCORRECT_OR_MISSING_SOURCES": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), + value="INCORRECT_OR_MISSING_SOURCES", + ) + ], + }, + "NOT_HELPFUL": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="NOT_HELPFUL") + ], + }, + "FACTUALLY_CORRECT": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="FACTUALLY_CORRECT") + ], + }, + "COMPLETE": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="COMPLETE")], + }, + "RELEVANT_SOURCES": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="RELEVANT_SOURCES") + ], + }, + "HELPFUL": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="HELPFUL")], + }, + "NOT_BASED_ON_DOCUMENTS": { + "target": UNIT, + "traits": [ + Trait.new( + id=ShapeID("smithy.api#enumValue"), value="NOT_BASED_ON_DOCUMENTS" + ) + ], + }, + "NOT_COMPLETE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="NOT_COMPLETE") + ], + }, + "NOT_CONCISE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="NOT_CONCISE") + ], + }, + "OTHER": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="OTHER")], + }, + }, +) + +MESSAGE_USEFULNESS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MessageUsefulness"), + shape_type=ShapeType.ENUM, + members={ + "USEFUL": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="USEFUL")], + }, + "NOT_USEFUL": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="NOT_USEFUL") + ], + }, + }, +) + +MESSAGE_USEFULNESS_FEEDBACK = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MessageUsefulnessFeedback"), + members={ + "usefulness": { + "target": MESSAGE_USEFULNESS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "reason": {"target": MESSAGE_USEFULNESS_REASON}, + "comment": {"target": MESSAGE_USEFULNESS_COMMENT}, + "submittedAt": { + "target": TIMESTAMP, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +PUT_FEEDBACK_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PutFeedbackInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#PutFeedbackRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": USER_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], + }, + "conversationId": { + "target": CONVERSATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "messageId": { + "target": SYSTEM_MESSAGE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "messageCopiedAt": {"target": TIMESTAMP}, + "messageUsefulness": {"target": MESSAGE_USEFULNESS_FEEDBACK}, + }, +) + +PUT_FEEDBACK_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PutFeedbackOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +PUT_FEEDBACK = Schema( + id=ShapeID("com.amazonaws.qbusiness#PutFeedback"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/conversations/{conversationId}/messages/{messageId}/feedback", + "method": "POST", + } + ), + ) + ], +) + +MEMBER_GROUP = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MemberGroup"), + members={ + "groupName": { + "target": GROUP_NAME, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "type": {"target": MEMBERSHIP_TYPE}, + }, +) + +MEMBER_GROUPS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MemberGroups"), + shape_type=ShapeType.LIST, + members={"member": {"target": MEMBER_GROUP}}, +) + +MEMBER_USER = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MemberUser"), + members={ + "userId": { + "target": DATA_SOURCE_USER_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "type": {"target": MEMBERSHIP_TYPE}, + }, +) + +MEMBER_USERS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#MemberUsers"), + shape_type=ShapeType.LIST, + members={"member": {"target": MEMBER_USER}}, +) + +GROUP_MEMBERS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GroupMembers"), + members={ + "memberGroups": {"target": MEMBER_GROUPS}, + "memberUsers": {"target": MEMBER_USERS}, + "s3PathForGroupMembers": {"target": S3}, + }, +) + +PUT_GROUP_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PutGroupInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#PutGroupRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "groupName": { + "target": GROUP_NAME, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "dataSourceId": {"target": DATA_SOURCE_ID}, + "type": { + "target": MEMBERSHIP_TYPE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "groupMembers": { + "target": GROUP_MEMBERS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "roleArn": {"target": ROLE_ARN}, + }, +) + +PUT_GROUP_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#PutGroupOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#PutGroupResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +PUT_GROUP = Schema( + id=ShapeID("com.amazonaws.qbusiness#PutGroup"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "PUT", + "uri": "/applications/{applicationId}/indices/{indexId}/groups", + } + ), + ), + ], +) + +MAX_RESULTS = Schema( + id=ShapeID("com.amazonaws.qbusiness#MaxResults"), + shape_type=ShapeType.INTEGER, + traits=[ + Trait.new(id=ShapeID("smithy.api#box")), + Trait.new( + id=ShapeID("smithy.api#range"), + value=MappingProxyType({"min": 1, "max": 100}), + ), + ], +) + +QUERY_TEXT = Schema( + id=ShapeID("com.amazonaws.qbusiness#QueryText"), shape_type=ShapeType.STRING +) + +SCORE_CONFIDENCE = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ScoreConfidence"), + shape_type=ShapeType.ENUM, + members={ + "VERY_HIGH": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="VERY_HIGH") + ], + }, + "HIGH": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="HIGH")], + }, + "MEDIUM": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="MEDIUM")], + }, + "LOW": { + "target": UNIT, + "traits": [Trait.new(id=ShapeID("smithy.api#enumValue"), value="LOW")], + }, + "NOT_AVAILABLE": { + "target": UNIT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#enumValue"), value="NOT_AVAILABLE") + ], + }, + }, +) + +SCORE_ATTRIBUTES = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ScoreAttributes"), + members={"scoreConfidence": {"target": SCORE_CONFIDENCE}}, +) + +RELEVANT_CONTENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#RelevantContent"), + members={ + "content": {"target": STRING}, + "documentId": {"target": DOCUMENT_ID}, + "documentTitle": {"target": TITLE}, + "documentUri": {"target": URL}, + "documentAttributes": {"target": DOCUMENT_ATTRIBUTES}, + "scoreAttributes": {"target": SCORE_ATTRIBUTES}, + }, +) + +RELEVANT_CONTENT_LIST = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#RelevantContentList"), + shape_type=ShapeType.LIST, + members={"member": {"target": RELEVANT_CONTENT}}, +) + +SEARCH_RELEVANT_CONTENT_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SearchRelevantContentOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#SearchRelevantContentResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "relevantContent": {"target": RELEVANT_CONTENT_LIST}, + "nextToken": {"target": NEXT_TOKEN}, + }, +) + +START_DATA_SOURCE_SYNC_JOB_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#StartDataSourceSyncJobInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#StartDataSourceSyncJobRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "dataSourceId": { + "target": DATA_SOURCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +START_DATA_SOURCE_SYNC_JOB_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#StartDataSourceSyncJobOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#StartDataSourceSyncJobResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={"executionId": {"target": EXECUTION_ID}}, +) + +START_DATA_SOURCE_SYNC_JOB = Schema( + id=ShapeID("com.amazonaws.qbusiness#StartDataSourceSyncJob"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/startsync", + "method": "POST", + } + ), + ) + ], +) + +STOP_DATA_SOURCE_SYNC_JOB_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#StopDataSourceSyncJobInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#StopDataSourceSyncJobRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "dataSourceId": { + "target": DATA_SOURCE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "indexId": { + "target": INDEX_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + }, +) + +STOP_DATA_SOURCE_SYNC_JOB_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#StopDataSourceSyncJobOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#StopDataSourceSyncJobResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +STOP_DATA_SOURCE_SYNC_JOB = Schema( + id=ShapeID("com.amazonaws.qbusiness#StopDataSourceSyncJob"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/stopsync", + "method": "POST", + } + ), + ) + ], +) + +TAG_RESOURCE_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#TagResourceInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#TagResourceRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "resourceARN": { + "target": AMAZON_RESOURCE_NAME, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "tags": { + "target": TAGS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +TAG_RESOURCE_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#TagResourceOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#TagResourceResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +TAG_RESOURCE = Schema( + id=ShapeID("com.amazonaws.qbusiness#TagResource"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#conditionKeys"), + value=("aws:RequestTag/${TagKey}", "aws:TagKeys"), + ), + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType({"uri": "/v1/tags/{resourceARN}", "method": "POST"}), + ), + ], +) + +TAG_KEYS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#TagKeys"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 0, "max": 200}), + ) + ], + members={"member": {"target": TAG_KEY}}, +) + +UNTAG_RESOURCE_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UntagResourceInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UntagResourceRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "resourceARN": { + "target": AMAZON_RESOURCE_NAME, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "tagKeys": { + "target": TAG_KEYS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="tagKeys"), + ], + }, + }, +) + +UNTAG_RESOURCE_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UntagResourceOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UntagResourceResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +UNTAG_RESOURCE = Schema( + id=ShapeID("com.amazonaws.qbusiness#UntagResource"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("aws.iam#conditionKeys"), value=("aws:TagKeys",)), + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/v1/tags/{resourceARN}", "method": "DELETE"} + ), + ), + ], +) + +ORCHESTRATION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#OrchestrationConfiguration"), + members={ + "control": { + "target": ORCHESTRATION_CONTROL, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateChatControlsConfigurationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateChatControlsConfigurationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + "responseScope": {"target": RESPONSE_SCOPE}, + "orchestrationConfiguration": {"target": ORCHESTRATION_CONFIGURATION}, + "blockedPhrasesConfigurationUpdate": { + "target": BLOCKED_PHRASES_CONFIGURATION_UPDATE + }, + "topicConfigurationsToCreateOrUpdate": {"target": TOPIC_CONFIGURATIONS}, + "topicConfigurationsToDelete": {"target": TOPIC_CONFIGURATIONS}, + "creatorModeConfiguration": {"target": CREATOR_MODE_CONFIGURATION}, + "hallucinationReductionConfiguration": { + "target": HALLUCINATION_REDUCTION_CONFIGURATION + }, + }, +) + +UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateChatControlsConfigurationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateChatControlsConfigurationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +UPDATE_CHAT_CONTROLS_CONFIGURATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#UpdateChatControlsConfiguration"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/chatcontrols", + "method": "PATCH", + "code": 200, + } + ), + ), + ], +) + +UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateChatResponseConfigurationInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateChatResponseConfigurationRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "chatResponseConfigurationId": { + "target": CHAT_RESPONSE_CONFIGURATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "displayName": {"target": DISPLAY_NAME}, + "responseConfigurations": { + "target": RESPONSE_CONFIGURATIONS, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "clientToken": { + "target": STRING, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + }, +) + +UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateChatResponseConfigurationOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateChatResponseConfigurationResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], +) + +UPDATE_CHAT_RESPONSE_CONFIGURATION = Schema( + id=ShapeID("com.amazonaws.qbusiness#UpdateChatResponseConfiguration"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#iamAction"), + value=MappingProxyType( + { + "requiredActions": ( + "qbusiness:GetChatResponseConfiguration", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + ) + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "PUT", + "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}", + } + ), + ), + ], +) + +UPDATE_SUBSCRIPTION_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateSubscriptionInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateSubscriptionRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "subscriptionId": { + "target": SUBSCRIPTION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "type": { + "target": SUBSCRIPTION_TYPE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + }, +) + +UPDATE_SUBSCRIPTION_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateSubscriptionOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateSubscriptionResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "subscriptionArn": {"target": SUBSCRIPTION_ARN}, + "currentSubscription": {"target": SUBSCRIPTION_DETAILS}, + "nextSubscription": {"target": SUBSCRIPTION_DETAILS}, + }, +) + +UPDATE_SUBSCRIPTION = Schema( + id=ShapeID("com.amazonaws.qbusiness#UpdateSubscription"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "PUT", + "uri": "/applications/{applicationId}/subscriptions/{subscriptionId}", + } + ), + ), + ], +) + +UPDATE_USER_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateUserInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateUserRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userAliasesToUpdate": {"target": USER_ALIASES}, + "userAliasesToDelete": {"target": USER_ALIASES}, + }, +) + +UPDATE_USER_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateUserOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateUserResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "userAliasesAdded": {"target": USER_ALIASES}, + "userAliasesUpdated": {"target": USER_ALIASES}, + "userAliasesDeleted": {"target": USER_ALIASES}, + }, +) + +UPDATE_USER = Schema( + id=ShapeID("com.amazonaws.qbusiness#UpdateUser"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"method": "PUT", "uri": "/applications/{applicationId}/users/{userId}"} + ), + ), + ], +) + +ATTRIBUTE_FILTER = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttributeFilter"), + members={ + # This needs to reference a schema that isn't defined yet. + # It will be populated with a non-null value at the end of the file. + "andAllFilters": None, + # This needs to reference a schema that isn't defined yet. + # It will be populated with a non-null value at the end of the file. + "orAllFilters": None, + # This needs to reference a schema that isn't defined yet. + # It will be populated with a non-null value at the end of the file. + "notFilter": None, + "equalsTo": {"target": DOCUMENT_ATTRIBUTE}, + "containsAll": {"target": DOCUMENT_ATTRIBUTE}, + "containsAny": {"target": DOCUMENT_ATTRIBUTE}, + "greaterThan": {"target": DOCUMENT_ATTRIBUTE}, + "greaterThanOrEquals": {"target": DOCUMENT_ATTRIBUTE}, + "lessThan": {"target": DOCUMENT_ATTRIBUTE}, + "lessThanOrEquals": {"target": DOCUMENT_ATTRIBUTE}, + }, +) + +ATTRIBUTE_FILTERS = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#AttributeFilters"), + shape_type=ShapeType.LIST, + members={"member": {"target": ATTRIBUTE_FILTER}}, +) + +ACTION_FILTER_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionFilterConfiguration"), + members={ + "documentAttributeFilter": { + "target": ATTRIBUTE_FILTER, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + } + }, +) + +CHAT_SYNC_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatSyncInput"), + traits=[Trait.new(id=ShapeID("smithy.api#input"))], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": USER_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], + }, + "userGroups": { + "target": USER_GROUPS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userGroups") + ], + }, + "userMessage": {"target": USER_MESSAGE}, + "attachments": {"target": ATTACHMENTS_INPUT}, + "actionExecution": {"target": ACTION_EXECUTION}, + "authChallengeResponse": {"target": AUTH_CHALLENGE_RESPONSE}, + "conversationId": {"target": CONVERSATION_ID}, + "parentMessageId": {"target": MESSAGE_ID}, + "attributeFilter": {"target": ATTRIBUTE_FILTER}, + "chatMode": {"target": CHAT_MODE}, + "chatModeConfiguration": {"target": CHAT_MODE_CONFIGURATION}, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + }, +) + +CONFIGURATION_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ConfigurationEvent"), + members={ + "chatMode": {"target": CHAT_MODE}, + "chatModeConfiguration": {"target": CHAT_MODE_CONFIGURATION}, + "attributeFilter": {"target": ATTRIBUTE_FILTER}, + }, +) + +SEARCH_RELEVANT_CONTENT_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#SearchRelevantContentInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#SearchRelevantContentRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "queryText": { + "target": QUERY_TEXT, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "contentSource": { + "target": CONTENT_SOURCE, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "attributeFilter": {"target": ATTRIBUTE_FILTER}, + "maxResults": { + "target": MAX_RESULTS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#default"), value=10), + Trait.new(id=ShapeID("smithy.api#addedDefault")), + ], + }, + "nextToken": {"target": NEXT_TOKEN}, + }, +) + +CHAT_SYNC = Schema( + id=ShapeID("com.amazonaws.qbusiness#ChatSync"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/conversations?sync", + "method": "POST", + } + ), + ) + ], +) + +SEARCH_RELEVANT_CONTENT = Schema( + id=ShapeID("com.amazonaws.qbusiness#SearchRelevantContent"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#paginated"), + value=MappingProxyType( + { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "relevantContent", + } + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/relevant-content", + "method": "POST", + } + ), + ), + ], +) + +ACTION_CONFIGURATION = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionConfiguration"), + members={ + "action": { + "target": Q_IAM_ACTION, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "filterConfiguration": {"target": ACTION_FILTER_CONFIGURATION}, + }, +) + +CHAT_INPUT_STREAM = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatInputStream"), + shape_type=ShapeType.UNION, + traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], + members={ + "configurationEvent": {"target": CONFIGURATION_EVENT}, + "textEvent": {"target": TEXT_INPUT_EVENT}, + "attachmentEvent": {"target": ATTACHMENT_INPUT_EVENT}, + "actionExecutionEvent": {"target": ACTION_EXECUTION_EVENT}, + "endOfInputEvent": {"target": END_OF_INPUT_EVENT}, + "authChallengeResponseEvent": {"target": AUTH_CHALLENGE_RESPONSE_EVENT}, + }, +) + +ACTION_CONFIGURATION_LIST = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ActionConfigurationList"), + shape_type=ShapeType.LIST, + traits=[ + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"min": 1, "max": 10}), + ) + ], + members={"member": {"target": ACTION_CONFIGURATION}}, +) + +CHAT_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#ChatInput"), + traits=[Trait.new(id=ShapeID("smithy.api#input"))], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "userId": { + "target": USER_ID, + "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], + }, + "userGroups": { + "target": USER_GROUPS, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userGroups") + ], + }, + "conversationId": { + "target": CONVERSATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="conversationId") + ], + }, + "parentMessageId": { + "target": MESSAGE_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="parentMessageId") + ], + }, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [ + Trait.new(id=ShapeID("smithy.api#idempotencyToken")), + Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), + ], + }, + "inputStream": { + "target": CHAT_INPUT_STREAM, + "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], + }, + }, +) + +CHAT = Schema( + id=ShapeID("com.amazonaws.qbusiness#Chat"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/conversations", "method": "POST"} + ), + ) + ], +) + +CREATE_DATA_ACCESSOR_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#CreateDataAccessorInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#CreateDataAccessorRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "principal": { + "target": PRINCIPAL_ROLE_ARN, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "actionConfigurations": { + "target": ACTION_CONFIGURATION_LIST, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "clientToken": { + "target": CLIENT_TOKEN, + "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], + }, + "displayName": { + "target": DATA_ACCESSOR_NAME, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "authenticationDetail": {"target": DATA_ACCESSOR_AUTHENTICATION_DETAIL}, + "tags": { + "target": TAGS, + "traits": [ + Trait.new(id=ShapeID("aws.cloudformation#cfnMutability"), value="full") + ], + }, + }, +) + +GET_DATA_ACCESSOR_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#GetDataAccessorOutput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#GetDataAccessorResponse", + ), + Trait.new(id=ShapeID("smithy.api#output")), + ], + members={ + "displayName": {"target": DATA_ACCESSOR_NAME}, + "dataAccessorId": {"target": DATA_ACCESSOR_ID}, + "dataAccessorArn": {"target": DATA_ACCESSOR_ARN}, + "applicationId": {"target": APPLICATION_ID}, + "idcApplicationArn": {"target": IDC_APPLICATION_ARN}, + "principal": {"target": PRINCIPAL_ROLE_ARN}, + "actionConfigurations": {"target": ACTION_CONFIGURATION_LIST}, + "authenticationDetail": {"target": DATA_ACCESSOR_AUTHENTICATION_DETAIL}, + "createdAt": {"target": TIMESTAMP}, + "updatedAt": {"target": TIMESTAMP}, + }, +) + +UPDATE_DATA_ACCESSOR_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.qbusiness#UpdateDataAccessorInput"), + traits=[ + Trait.new( + id=ShapeID("smithy.synthetic#originalShapeId"), + value="com.amazonaws.qbusiness#UpdateDataAccessorRequest", + ), + Trait.new(id=ShapeID("smithy.api#input")), + ], + members={ + "applicationId": { + "target": APPLICATION_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "dataAccessorId": { + "target": DATA_ACCESSOR_ID, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + ], + }, + "actionConfigurations": { + "target": ACTION_CONFIGURATION_LIST, + "traits": [Trait.new(id=ShapeID("smithy.api#required"))], + }, + "authenticationDetail": {"target": DATA_ACCESSOR_AUTHENTICATION_DETAIL}, + "displayName": {"target": DATA_ACCESSOR_NAME}, + }, +) + +CREATE_DATA_ACCESSOR = Schema( + id=ShapeID("com.amazonaws.qbusiness#CreateDataAccessor"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#conditionKeys"), + value=("aws:RequestTag/${TagKey}", "aws:TagKeys"), + ), + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetDataAccessor", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + {"uri": "/applications/{applicationId}/dataaccessors", "method": "POST"} + ), + ), + ], +) + +GET_DATA_ACCESSOR = Schema( + id=ShapeID("com.amazonaws.qbusiness#GetDataAccessor"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=("qbusiness:ListTagsForResource",), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", + "method": "GET", + } + ), + ), + Trait.new(id=ShapeID("smithy.api#readonly")), + ], +) + +UPDATE_DATA_ACCESSOR = Schema( + id=ShapeID("com.amazonaws.qbusiness#UpdateDataAccessor"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#idempotent")), + Trait.new( + id=ShapeID("aws.iam#requiredActions"), + value=( + "qbusiness:GetDataAccessor", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + ), + ), + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", + "method": "PUT", + } + ), + ), + ], +) + +EXPERT_Q = Schema( + id=ShapeID("com.amazonaws.qbusiness#ExpertQ"), + shape_type=ShapeType.SERVICE, + traits=[ + Trait.new( + id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "qbusiness"}) + ), + Trait.new(id=ShapeID("smithy.api#title"), value="QBusiness"), + Trait.new( + id=ShapeID("smithy.rules#endpointTests"), + value=MappingProxyType( + { + "testCases": ( + MappingProxyType( + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://qbusiness-fips.us-east-1.api.aws" + } + ) + } + ), + "params": MappingProxyType( + {"Region": "us-east-1", "UseFIPS": True} + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://qbusiness.us-east-1.api.aws" + } + ) + } + ), + "params": MappingProxyType( + {"Region": "us-east-1", "UseFIPS": False} + ), + } + ), + MappingProxyType( + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://qbusiness-fips.cn-north-1.api.amazonwebservices.com.cn" + } + ) + } + ), + "params": MappingProxyType( + {"Region": "cn-north-1", "UseFIPS": True} + ), + } + ), + MappingProxyType( + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://qbusiness.cn-north-1.api.amazonwebservices.com.cn" + } + ) + } + ), + "params": MappingProxyType( + {"Region": "cn-north-1", "UseFIPS": False} + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://qbusiness-fips.us-gov-east-1.api.aws" + } + ) + } + ), + "params": MappingProxyType( + {"Region": "us-gov-east-1", "UseFIPS": True} + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://qbusiness.us-gov-east-1.api.aws" + } + ) + } + ), + "params": MappingProxyType( + {"Region": "us-gov-east-1", "UseFIPS": False} + ), + } + ), + MappingProxyType( + { + "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + {"url": "https://example.com"} + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-east-1", + "UseFIPS": False, + "Endpoint": "https://example.com", + } + ), + } + ), + MappingProxyType( + { + "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + {"url": "https://example.com"} + ) + } + ), + "params": MappingProxyType( + { + "UseFIPS": False, + "Endpoint": "https://example.com", + } + ), + } + ), + MappingProxyType( + { + "documentation": "For custom endpoint with fips enabled and dualstack disabled", + "expect": MappingProxyType( + { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + } + ), + "params": MappingProxyType( + { + "Region": "us-east-1", + "UseFIPS": True, + "Endpoint": "https://example.com", + } + ), + } + ), + MappingProxyType( + { + "documentation": "Missing region", + "expect": MappingProxyType( + {"error": "Invalid Configuration: Missing Region"} + ), + } + ), + ), + "version": "1.0", + } + ), + ), + Trait.new( + id=ShapeID("smithy.rules#endpointRuleSet"), + value=MappingProxyType( + { + "version": "1.0", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( + { + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", + } + ), + "UseFIPS": MappingProxyType( + { + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", + } + ), + "Endpoint": MappingProxyType( + { + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", + } + ), + } + ), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": ( + MappingProxyType({"ref": "Endpoint"}), + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + {"ref": "UseFIPS"} + ), + True, + ), + } + ), + ), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType( + {"ref": "Endpoint"} + ), + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + } + ), + "type": "endpoint", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": ( + MappingProxyType({"ref": "Region"}), + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "aws.partition", + "argv": ( + MappingProxyType( + {"ref": "Region"} + ), + ), + "assign": "PartitionResult", + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + True, + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "supportsDualStack", + ), + } + ), + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "supportsFIPS", + ), + } + ), + True, + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://qbusiness-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://qbusiness.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "supportsFIPS", + ), + } + ), + True, + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://qbusiness-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://qbusiness.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + ), + "type": "tree", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + } + ), + ), + Trait.new( + id=ShapeID("aws.api#service"), + value=MappingProxyType( + { + "sdkId": "QBusiness", + "cloudFormationName": "QBusiness", + "arnNamespace": "qbusiness", + "cloudTrailEventSource": "qbusiness.amazonaws.com", + } + ), + ), + Trait.new( + id=ShapeID("aws.protocols#restJson1"), + value=MappingProxyType( + {"http": ("h2", "http/1.1"), "eventStreamHttp": ("h2",)} + ), + ), + ], +) + +ATTRIBUTE_FILTER.members["notFilter"] = Schema.member( + id=ATTRIBUTE_FILTER.id.with_member("notFilter"), target=ATTRIBUTE_FILTER, index=2 +) + +ATTRIBUTE_FILTER.members["orAllFilters"] = Schema.member( + id=ATTRIBUTE_FILTER.id.with_member("orAllFilters"), + target=ATTRIBUTE_FILTERS, + index=1, +) + +ATTRIBUTE_FILTER.members["andAllFilters"] = Schema.member( + id=ATTRIBUTE_FILTER.id.with_member("andAllFilters"), + target=ATTRIBUTE_FILTERS, + index=0, +) diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/auth.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/auth.py new file mode 100644 index 0000000..24ca90f --- /dev/null +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/auth.py @@ -0,0 +1,31 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from typing import Any + +from smithy_core.auth import AuthOption as _smithy_core_auth_AuthOption, AuthParams +from smithy_core.interfaces.auth import ( + AuthOption as _smithy_core_interfaces_auth_AuthOption, +) +from smithy_core.shapes import ShapeID + + +class HTTPAuthSchemeResolver: + def resolve_auth_scheme( + self, auth_parameters: AuthParams[Any, Any] + ) -> list[_smithy_core_interfaces_auth_AuthOption]: + auth_options: list[_smithy_core_interfaces_auth_AuthOption] = [] + + if (option := _generate_sigv4_option(auth_parameters)) is not None: + auth_options.append(option) + + return auth_options + + +def _generate_sigv4_option( + auth_params: AuthParams[Any, Any], +) -> _smithy_core_interfaces_auth_AuthOption | None: + return _smithy_core_auth_AuthOption( + scheme_id=ShapeID("aws.auth#sigv4"), + identity_properties={}, # type: ignore + signer_properties={}, # type: ignore + ) diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/client.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/client.py new file mode 100644 index 0000000..8a6b1c7 --- /dev/null +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/client.py @@ -0,0 +1,4462 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from copy import deepcopy +import logging + +from smithy_core.aio.client import ClientCall, RequestPipeline +from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.exceptions import ExpectationNotMetError +from smithy_core.interceptors import InterceptorChain +from smithy_core.retries import RetryStrategyResolver +from smithy_core.types import TypedProperties +from smithy_http.plugins import user_agent_plugin + +from .config import Config, Plugin +from .models import ( + ASSOCIATE_PERMISSION, + AssociatePermissionInput, + AssociatePermissionOutput, + BATCH_DELETE_DOCUMENT, + BATCH_PUT_DOCUMENT, + BatchDeleteDocumentInput, + BatchDeleteDocumentOutput, + BatchPutDocumentInput, + BatchPutDocumentOutput, + CANCEL_SUBSCRIPTION, + CHAT, + CHAT_SYNC, + CHECK_DOCUMENT_ACCESS, + CREATE_ANONYMOUS_WEB_EXPERIENCE_URL, + CREATE_APPLICATION, + CREATE_CHAT_RESPONSE_CONFIGURATION, + CREATE_DATA_ACCESSOR, + CREATE_DATA_SOURCE, + CREATE_INDEX, + CREATE_PLUGIN, + CREATE_RETRIEVER, + CREATE_SUBSCRIPTION, + CREATE_USER, + CREATE_WEB_EXPERIENCE, + CancelSubscriptionInput, + CancelSubscriptionOutput, + ChatInput, + ChatInputStream, + ChatOutput, + ChatOutputStream, + ChatSyncInput, + ChatSyncOutput, + CheckDocumentAccessInput, + CheckDocumentAccessOutput, + CreateAnonymousWebExperienceUrlInput, + CreateAnonymousWebExperienceUrlOutput, + CreateApplicationInput, + CreateApplicationOutput, + CreateChatResponseConfigurationInput, + CreateChatResponseConfigurationOutput, + CreateDataAccessorInput, + CreateDataAccessorOutput, + CreateDataSourceInput, + CreateDataSourceOutput, + CreateIndexInput, + CreateIndexOutput, + CreatePluginInput, + CreatePluginOutput, + CreateRetrieverInput, + CreateRetrieverOutput, + CreateSubscriptionInput, + CreateSubscriptionOutput, + CreateUserInput, + CreateUserOutput, + CreateWebExperienceInput, + CreateWebExperienceOutput, + DELETE_APPLICATION, + DELETE_ATTACHMENT, + DELETE_CHAT_CONTROLS_CONFIGURATION, + DELETE_CHAT_RESPONSE_CONFIGURATION, + DELETE_CONVERSATION, + DELETE_DATA_ACCESSOR, + DELETE_DATA_SOURCE, + DELETE_GROUP, + DELETE_INDEX, + DELETE_PLUGIN, + DELETE_RETRIEVER, + DELETE_USER, + DELETE_WEB_EXPERIENCE, + DISASSOCIATE_PERMISSION, + DeleteApplicationInput, + DeleteApplicationOutput, + DeleteAttachmentInput, + DeleteAttachmentOutput, + DeleteChatControlsConfigurationInput, + DeleteChatControlsConfigurationOutput, + DeleteChatResponseConfigurationInput, + DeleteChatResponseConfigurationOutput, + DeleteConversationInput, + DeleteConversationOutput, + DeleteDataAccessorInput, + DeleteDataAccessorOutput, + DeleteDataSourceInput, + DeleteDataSourceOutput, + DeleteGroupInput, + DeleteGroupOutput, + DeleteIndexInput, + DeleteIndexOutput, + DeletePluginInput, + DeletePluginOutput, + DeleteRetrieverInput, + DeleteRetrieverOutput, + DeleteUserInput, + DeleteUserOutput, + DeleteWebExperienceInput, + DeleteWebExperienceOutput, + DisassociatePermissionInput, + DisassociatePermissionOutput, + GET_APPLICATION, + GET_CHAT_CONTROLS_CONFIGURATION, + GET_CHAT_RESPONSE_CONFIGURATION, + GET_DATA_ACCESSOR, + GET_DATA_SOURCE, + GET_DOCUMENT_CONTENT, + GET_GROUP, + GET_INDEX, + GET_MEDIA, + GET_PLUGIN, + GET_POLICY, + GET_RETRIEVER, + GET_USER, + GET_WEB_EXPERIENCE, + GetApplicationInput, + GetApplicationOutput, + GetChatControlsConfigurationInput, + GetChatControlsConfigurationOutput, + GetChatResponseConfigurationInput, + GetChatResponseConfigurationOutput, + GetDataAccessorInput, + GetDataAccessorOutput, + GetDataSourceInput, + GetDataSourceOutput, + GetDocumentContentInput, + GetDocumentContentOutput, + GetGroupInput, + GetGroupOutput, + GetIndexInput, + GetIndexOutput, + GetMediaInput, + GetMediaOutput, + GetPluginInput, + GetPluginOutput, + GetPolicyInput, + GetPolicyOutput, + GetRetrieverInput, + GetRetrieverOutput, + GetUserInput, + GetUserOutput, + GetWebExperienceInput, + GetWebExperienceOutput, + LIST_APPLICATIONS, + LIST_ATTACHMENTS, + LIST_CHAT_RESPONSE_CONFIGURATIONS, + LIST_CONVERSATIONS, + LIST_DATA_ACCESSORS, + LIST_DATA_SOURCES, + LIST_DATA_SOURCE_SYNC_JOBS, + LIST_DOCUMENTS, + LIST_GROUPS, + LIST_INDICES, + LIST_MESSAGES, + LIST_PLUGINS, + LIST_PLUGIN_ACTIONS, + LIST_PLUGIN_TYPE_ACTIONS, + LIST_PLUGIN_TYPE_METADATA, + LIST_RETRIEVERS, + LIST_SUBSCRIPTIONS, + LIST_TAGS_FOR_RESOURCE, + LIST_WEB_EXPERIENCES, + ListApplicationsInput, + ListApplicationsOutput, + ListAttachmentsInput, + ListAttachmentsOutput, + ListChatResponseConfigurationsInput, + ListChatResponseConfigurationsOutput, + ListConversationsInput, + ListConversationsOutput, + ListDataAccessorsInput, + ListDataAccessorsOutput, + ListDataSourceSyncJobsInput, + ListDataSourceSyncJobsOutput, + ListDataSourcesInput, + ListDataSourcesOutput, + ListDocumentsInput, + ListDocumentsOutput, + ListGroupsInput, + ListGroupsOutput, + ListIndicesInput, + ListIndicesOutput, + ListMessagesInput, + ListMessagesOutput, + ListPluginActionsInput, + ListPluginActionsOutput, + ListPluginTypeActionsInput, + ListPluginTypeActionsOutput, + ListPluginTypeMetadataInput, + ListPluginTypeMetadataOutput, + ListPluginsInput, + ListPluginsOutput, + ListRetrieversInput, + ListRetrieversOutput, + ListSubscriptionsInput, + ListSubscriptionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListWebExperiencesInput, + ListWebExperiencesOutput, + PUT_FEEDBACK, + PUT_GROUP, + PutFeedbackInput, + PutFeedbackOutput, + PutGroupInput, + PutGroupOutput, + SEARCH_RELEVANT_CONTENT, + START_DATA_SOURCE_SYNC_JOB, + STOP_DATA_SOURCE_SYNC_JOB, + SearchRelevantContentInput, + SearchRelevantContentOutput, + StartDataSourceSyncJobInput, + StartDataSourceSyncJobOutput, + StopDataSourceSyncJobInput, + StopDataSourceSyncJobOutput, + TAG_RESOURCE, + TagResourceInput, + TagResourceOutput, + UNTAG_RESOURCE, + UPDATE_APPLICATION, + UPDATE_CHAT_CONTROLS_CONFIGURATION, + UPDATE_CHAT_RESPONSE_CONFIGURATION, + UPDATE_DATA_ACCESSOR, + UPDATE_DATA_SOURCE, + UPDATE_INDEX, + UPDATE_PLUGIN, + UPDATE_RETRIEVER, + UPDATE_SUBSCRIPTION, + UPDATE_USER, + UPDATE_WEB_EXPERIENCE, + UntagResourceInput, + UntagResourceOutput, + UpdateApplicationInput, + UpdateApplicationOutput, + UpdateChatControlsConfigurationInput, + UpdateChatControlsConfigurationOutput, + UpdateChatResponseConfigurationInput, + UpdateChatResponseConfigurationOutput, + UpdateDataAccessorInput, + UpdateDataAccessorOutput, + UpdateDataSourceInput, + UpdateDataSourceOutput, + UpdateIndexInput, + UpdateIndexOutput, + UpdatePluginInput, + UpdatePluginOutput, + UpdateRetrieverInput, + UpdateRetrieverOutput, + UpdateSubscriptionInput, + UpdateSubscriptionOutput, + UpdateUserInput, + UpdateUserOutput, + UpdateWebExperienceInput, + UpdateWebExperienceOutput, + _ChatOutputStreamDeserializer, +) +from .user_agent import aws_user_agent_plugin + + +logger = logging.getLogger(__name__) + + +class QBusinessClient: + """ + This is the *Amazon Q Business* API Reference. Amazon Q Business is a + fully managed, generative-AI powered enterprise chat assistant that you + can deploy within your organization. Amazon Q Business enhances employee + productivity by supporting key tasks such as question-answering, + knowledge discovery, writing email messages, summarizing text, drafting + document outlines, and brainstorming ideas. Users ask questions of + Amazon Q Business and get answers that are presented in a conversational + manner. For an introduction to the service, see the [*Amazon Q Business + User + Guide*](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/what-is.html) + . + + For an overview of the Amazon Q Business APIs, see [Overview of Amazon Q + Business API + operations](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/api-ref.html#api-overview). + + For information about the IAM access control permissions you need to use + this API, see [IAM roles for Amazon Q + Business](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/iam-roles.html) + in the *Amazon Q Business User Guide*. + + The following resources provide additional information about using the + Amazon Q Business API: + + - *[Setting up for Amazon Q + Business](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/setting-up.html)* + + - *[Amazon Q Business CLI + Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/qbusiness/index.html)* + + - *[Amazon Web Services General + Reference](https://docs.aws.amazon.com/general/latest/gr/amazonq.html)* + """ + + def __init__( + self, config: Config | None = None, plugins: list[Plugin] | None = None + ): + """ + Constructor for `QBusinessClient`. + + Args: + config: + Optional configuration for the client. Here you can set things like + the endpoint for HTTP services or auth credentials. + plugins: + A list of callables that modify the configuration dynamically. These + can be used to set defaults, for example. + """ + self._config = config or Config() + + client_plugins: list[Plugin] = [aws_user_agent_plugin, user_agent_plugin] + if plugins: + client_plugins.extend(plugins) + + for plugin in client_plugins: + plugin(self._config) + + self._retry_strategy_resolver = RetryStrategyResolver() + + async def associate_permission( + self, input: AssociatePermissionInput, plugins: list[Plugin] | None = None + ) -> AssociatePermissionOutput: + """ + Adds or updates a permission policy for a Amazon Q Business application, + allowing cross-account access for an ISV. This operation creates a new + policy statement for the specified Amazon Q Business application. The + policy statement defines the IAM actions that the ISV is allowed to + perform on the Amazon Q Business application's resources. + + Args: + input: + An instance of `AssociatePermissionInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `AssociatePermissionOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=ASSOCIATE_PERMISSION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def batch_delete_document( + self, input: BatchDeleteDocumentInput, plugins: list[Plugin] | None = None + ) -> BatchDeleteDocumentOutput: + """ + Asynchronously deletes one or more documents added using the + `BatchPutDocument` API from an Amazon Q Business index. + + You can see the progress of the deletion, and any error messages related + to the process, by using CloudWatch. + + Args: + input: + An instance of `BatchDeleteDocumentInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `BatchDeleteDocumentOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=BATCH_DELETE_DOCUMENT, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def batch_put_document( + self, input: BatchPutDocumentInput, plugins: list[Plugin] | None = None + ) -> BatchPutDocumentOutput: + """ + Adds one or more documents to an Amazon Q Business index. + + You use this API to: + + - ingest your structured and unstructured documents and documents stored + in an Amazon S3 bucket into an Amazon Q Business index. + + - add custom attributes to documents in an Amazon Q Business index. + + - attach an access control list to the documents added to an Amazon Q + Business index. + + You can see the progress of the deletion, and any error messages related + to the process, by using CloudWatch. + + Args: + input: + An instance of `BatchPutDocumentInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `BatchPutDocumentOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=BATCH_PUT_DOCUMENT, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def cancel_subscription( + self, input: CancelSubscriptionInput, plugins: list[Plugin] | None = None + ) -> CancelSubscriptionOutput: + """ + Unsubscribes a user or a group from their pricing tier in an Amazon Q + Business application. An unsubscribed user or group loses all Amazon Q + Business feature access at the start of next month. + + Args: + input: + An instance of `CancelSubscriptionInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CancelSubscriptionOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CANCEL_SUBSCRIPTION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def chat( + self, input: ChatInput, plugins: list[Plugin] | None = None + ) -> DuplexEventStream[ChatInputStream, ChatOutputStream, ChatOutput]: + """ + Starts or continues a streaming Amazon Q Business conversation. + + Args: + input: + An instance of `ChatInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + A `DuplexEventStream` for bidirectional streaming. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CHAT, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline.duplex_stream( + call, + ChatInputStream, + ChatOutputStream, + _ChatOutputStreamDeserializer().deserialize, + ) + + async def chat_sync( + self, input: ChatSyncInput, plugins: list[Plugin] | None = None + ) -> ChatSyncOutput: + """ + Starts or continues a non-streaming Amazon Q Business conversation. + + Args: + input: + An instance of `ChatSyncInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ChatSyncOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CHAT_SYNC, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def check_document_access( + self, input: CheckDocumentAccessInput, plugins: list[Plugin] | None = None + ) -> CheckDocumentAccessOutput: + """ + Verifies if a user has access permissions for a specified document and + returns the actual ACL attached to the document. Resolves user access on + the document via user aliases and groups when verifying user access. + + Args: + input: + An instance of `CheckDocumentAccessInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CheckDocumentAccessOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CHECK_DOCUMENT_ACCESS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def create_anonymous_web_experience_url( + self, + input: CreateAnonymousWebExperienceUrlInput, + plugins: list[Plugin] | None = None, + ) -> CreateAnonymousWebExperienceUrlOutput: + """ + Creates a unique URL for anonymous Amazon Q Business web experience. + This URL can only be used once and must be used within 5 minutes after + it's generated. + + Args: + input: + An instance of `CreateAnonymousWebExperienceUrlInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CreateAnonymousWebExperienceUrlOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CREATE_ANONYMOUS_WEB_EXPERIENCE_URL, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def create_application( + self, input: CreateApplicationInput, plugins: list[Plugin] | None = None + ) -> CreateApplicationOutput: + """ + Creates an Amazon Q Business application. + + Note: + There are new tiers for Amazon Q Business. Not all features in Amazon Q + Business Pro are also available in Amazon Q Business Lite. For + information on what's included in Amazon Q Business Lite and what's + included in Amazon Q Business Pro, see [Amazon Q Business + tiers](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/tiers.html#user-sub-tiers). + You must use the Amazon Q Business console to assign subscription tiers + to users. + + An Amazon Q Apps service linked role will be created if it's absent in + the Amazon Web Services account when `QAppsConfiguration` is enabled in + the request. For more information, see [Using service-linked roles for Q + Apps](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/using-service-linked-roles-qapps.html). + + When you create an application, Amazon Q Business may securely transmit + data for processing from your selected Amazon Web Services region, but + within your geography. For more information, see [Cross region inference + in Amazon Q + Business](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/cross-region-inference.html). + + Args: + input: + An instance of `CreateApplicationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CreateApplicationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CREATE_APPLICATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def create_chat_response_configuration( + self, + input: CreateChatResponseConfigurationInput, + plugins: list[Plugin] | None = None, + ) -> CreateChatResponseConfigurationOutput: + """ + Creates a new chat response configuration for an Amazon Q Business + application. This operation establishes a set of parameters that define + how the system generates and formats responses to user queries in chat + interactions. + + Args: + input: + An instance of `CreateChatResponseConfigurationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CreateChatResponseConfigurationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CREATE_CHAT_RESPONSE_CONFIGURATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def create_data_accessor( + self, input: CreateDataAccessorInput, plugins: list[Plugin] | None = None + ) -> CreateDataAccessorOutput: + """ + Creates a new data accessor for an ISV to access data from a Amazon Q + Business application. The data accessor is an entity that represents the + ISV's access to the Amazon Q Business application's data. It includes + the IAM role ARN for the ISV, a friendly name, and a set of action + configurations that define the specific actions the ISV is allowed to + perform and any associated data filters. When the data accessor is + created, an IAM Identity Center application is also created to manage + the ISV's identity and authentication for accessing the Amazon Q + Business application. + + Args: + input: + An instance of `CreateDataAccessorInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CreateDataAccessorOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CREATE_DATA_ACCESSOR, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def create_data_source( + self, input: CreateDataSourceInput, plugins: list[Plugin] | None = None + ) -> CreateDataSourceOutput: + """ + Creates a data source connector for an Amazon Q Business application. + + `CreateDataSource` is a synchronous operation. The operation returns 200 + if the data source was successfully created. Otherwise, an exception is + raised. + + Args: + input: + An instance of `CreateDataSourceInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CreateDataSourceOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CREATE_DATA_SOURCE, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def create_index( + self, input: CreateIndexInput, plugins: list[Plugin] | None = None + ) -> CreateIndexOutput: + """ + Creates an Amazon Q Business index. + + To determine if index creation has completed, check the `Status` field + returned from a call to `DescribeIndex`. The `Status` field is set to + `ACTIVE` when the index is ready to use. + + Once the index is active, you can index your documents using the + [`BatchPutDocument`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_BatchPutDocument.html) + API or the + [`CreateDataSource`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_CreateDataSource.html) + API. + + Args: + input: + An instance of `CreateIndexInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CreateIndexOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CREATE_INDEX, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def create_plugin( + self, input: CreatePluginInput, plugins: list[Plugin] | None = None + ) -> CreatePluginOutput: + """ + Creates an Amazon Q Business plugin. + + Args: + input: + An instance of `CreatePluginInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CreatePluginOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CREATE_PLUGIN, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def create_retriever( + self, input: CreateRetrieverInput, plugins: list[Plugin] | None = None + ) -> CreateRetrieverOutput: + """ + Adds a retriever to your Amazon Q Business application. + + Args: + input: + An instance of `CreateRetrieverInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CreateRetrieverOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CREATE_RETRIEVER, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def create_subscription( + self, input: CreateSubscriptionInput, plugins: list[Plugin] | None = None + ) -> CreateSubscriptionOutput: + """ + Subscribes an IAM Identity Center user or a group to a pricing tier for + an Amazon Q Business application. + + Amazon Q Business offers two subscription tiers: `Q_LITE` and + `Q_BUSINESS`. Subscription tier determines feature access for the user. + For more information on subscriptions and pricing tiers, see [Amazon Q + Business pricing](https://aws.amazon.com/q/business/pricing/). + + Note: + For an example IAM role policy for assigning subscriptions, see [Set up + required + permissions](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/setting-up.html#permissions) + in the Amazon Q Business User Guide. + + Args: + input: + An instance of `CreateSubscriptionInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CreateSubscriptionOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CREATE_SUBSCRIPTION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def create_user( + self, input: CreateUserInput, plugins: list[Plugin] | None = None + ) -> CreateUserOutput: + """ + Creates a universally unique identifier (UUID) mapped to a list of local + user ids within an application. + + Args: + input: + An instance of `CreateUserInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CreateUserOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CREATE_USER, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def create_web_experience( + self, input: CreateWebExperienceInput, plugins: list[Plugin] | None = None + ) -> CreateWebExperienceOutput: + """ + Creates an Amazon Q Business web experience. + + Args: + input: + An instance of `CreateWebExperienceInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `CreateWebExperienceOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=CREATE_WEB_EXPERIENCE, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_application( + self, input: DeleteApplicationInput, plugins: list[Plugin] | None = None + ) -> DeleteApplicationOutput: + """ + Deletes an Amazon Q Business application. + + Args: + input: + An instance of `DeleteApplicationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteApplicationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_APPLICATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_attachment( + self, input: DeleteAttachmentInput, plugins: list[Plugin] | None = None + ) -> DeleteAttachmentOutput: + """ + Deletes an attachment associated with a specific Amazon Q Business + conversation. + + Args: + input: + An instance of `DeleteAttachmentInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteAttachmentOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_ATTACHMENT, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_chat_controls_configuration( + self, + input: DeleteChatControlsConfigurationInput, + plugins: list[Plugin] | None = None, + ) -> DeleteChatControlsConfigurationOutput: + """ + Deletes chat controls configured for an existing Amazon Q Business + application. + + Args: + input: + An instance of `DeleteChatControlsConfigurationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteChatControlsConfigurationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_CHAT_CONTROLS_CONFIGURATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_chat_response_configuration( + self, + input: DeleteChatResponseConfigurationInput, + plugins: list[Plugin] | None = None, + ) -> DeleteChatResponseConfigurationOutput: + """ + Deletes a specified chat response configuration from an Amazon Q + Business application. + + Args: + input: + An instance of `DeleteChatResponseConfigurationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteChatResponseConfigurationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_CHAT_RESPONSE_CONFIGURATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_conversation( + self, input: DeleteConversationInput, plugins: list[Plugin] | None = None + ) -> DeleteConversationOutput: + """ + Deletes an Amazon Q Business web experience conversation. + + Args: + input: + An instance of `DeleteConversationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteConversationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_CONVERSATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_data_accessor( + self, input: DeleteDataAccessorInput, plugins: list[Plugin] | None = None + ) -> DeleteDataAccessorOutput: + """ + Deletes a specified data accessor. This operation permanently removes + the data accessor and its associated IAM Identity Center application. + Any access granted to the ISV through this data accessor will be + revoked. + + Args: + input: + An instance of `DeleteDataAccessorInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteDataAccessorOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_DATA_ACCESSOR, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_data_source( + self, input: DeleteDataSourceInput, plugins: list[Plugin] | None = None + ) -> DeleteDataSourceOutput: + """ + Deletes an Amazon Q Business data source connector. While the data + source is being deleted, the `Status` field returned by a call to the + `DescribeDataSource` API is set to `DELETING`. + + Args: + input: + An instance of `DeleteDataSourceInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteDataSourceOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_DATA_SOURCE, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_group( + self, input: DeleteGroupInput, plugins: list[Plugin] | None = None + ) -> DeleteGroupOutput: + """ + Deletes a group so that all users and sub groups that belong to the + group can no longer access documents only available to that group. For + example, after deleting the group \"Summer Interns\", all interns who + belonged to that group no longer see intern-only documents in their chat + results. + + If you want to delete, update, or replace users or sub groups of a + group, you need to use the `PutGroup` operation. For example, if a user + in the group \"Engineering\" leaves the engineering team and another + user takes their place, you provide an updated list of users or sub + groups that belong to the \"Engineering\" group when calling `PutGroup`. + + Args: + input: + An instance of `DeleteGroupInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteGroupOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_GROUP, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_index( + self, input: DeleteIndexInput, plugins: list[Plugin] | None = None + ) -> DeleteIndexOutput: + """ + Deletes an Amazon Q Business index. + + Args: + input: + An instance of `DeleteIndexInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteIndexOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_INDEX, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_plugin( + self, input: DeletePluginInput, plugins: list[Plugin] | None = None + ) -> DeletePluginOutput: + """ + Deletes an Amazon Q Business plugin. + + Args: + input: + An instance of `DeletePluginInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeletePluginOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_PLUGIN, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_retriever( + self, input: DeleteRetrieverInput, plugins: list[Plugin] | None = None + ) -> DeleteRetrieverOutput: + """ + Deletes the retriever used by an Amazon Q Business application. + + Args: + input: + An instance of `DeleteRetrieverInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteRetrieverOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_RETRIEVER, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_user( + self, input: DeleteUserInput, plugins: list[Plugin] | None = None + ) -> DeleteUserOutput: + """ + Deletes a user by email id. + + Args: + input: + An instance of `DeleteUserInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteUserOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_USER, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def delete_web_experience( + self, input: DeleteWebExperienceInput, plugins: list[Plugin] | None = None + ) -> DeleteWebExperienceOutput: + """ + Deletes an Amazon Q Business web experience. + + Args: + input: + An instance of `DeleteWebExperienceInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DeleteWebExperienceOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DELETE_WEB_EXPERIENCE, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def disassociate_permission( + self, input: DisassociatePermissionInput, plugins: list[Plugin] | None = None + ) -> DisassociatePermissionOutput: + """ + Removes a permission policy from a Amazon Q Business application, + revoking the cross-account access that was previously granted to an ISV. + This operation deletes the specified policy statement from the + application's permission policy. + + Args: + input: + An instance of `DisassociatePermissionInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `DisassociatePermissionOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=DISASSOCIATE_PERMISSION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_application( + self, input: GetApplicationInput, plugins: list[Plugin] | None = None + ) -> GetApplicationOutput: + """ + Gets information about an existing Amazon Q Business application. + + Args: + input: + An instance of `GetApplicationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetApplicationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_APPLICATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_chat_controls_configuration( + self, + input: GetChatControlsConfigurationInput, + plugins: list[Plugin] | None = None, + ) -> GetChatControlsConfigurationOutput: + """ + Gets information about chat controls configured for an existing Amazon Q + Business application. + + Args: + input: + An instance of `GetChatControlsConfigurationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetChatControlsConfigurationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_CHAT_CONTROLS_CONFIGURATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_chat_response_configuration( + self, + input: GetChatResponseConfigurationInput, + plugins: list[Plugin] | None = None, + ) -> GetChatResponseConfigurationOutput: + """ + Retrieves detailed information about a specific chat response + configuration from an Amazon Q Business application. This operation + returns the complete configuration settings and metadata. + + Args: + input: + An instance of `GetChatResponseConfigurationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetChatResponseConfigurationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_CHAT_RESPONSE_CONFIGURATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_data_accessor( + self, input: GetDataAccessorInput, plugins: list[Plugin] | None = None + ) -> GetDataAccessorOutput: + """ + Retrieves information about a specified data accessor. This operation + returns details about the data accessor, including its display name, + unique identifier, Amazon Resource Name (ARN), the associated Amazon Q + Business application and IAM Identity Center application, the IAM role + for the ISV, the action configurations, and the timestamps for when the + data accessor was created and last updated. + + Args: + input: + An instance of `GetDataAccessorInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetDataAccessorOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_DATA_ACCESSOR, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_data_source( + self, input: GetDataSourceInput, plugins: list[Plugin] | None = None + ) -> GetDataSourceOutput: + """ + Gets information about an existing Amazon Q Business data source + connector. + + Args: + input: + An instance of `GetDataSourceInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetDataSourceOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_DATA_SOURCE, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_document_content( + self, input: GetDocumentContentInput, plugins: list[Plugin] | None = None + ) -> GetDocumentContentOutput: + """ + Retrieves the content of a document that was ingested into Amazon Q + Business. This API validates user authorization against document ACLs + before returning a pre-signed URL for secure document access. You can + download or view source documents referenced in chat responses through + the URL. + + Args: + input: + An instance of `GetDocumentContentInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetDocumentContentOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_DOCUMENT_CONTENT, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_group( + self, input: GetGroupInput, plugins: list[Plugin] | None = None + ) -> GetGroupOutput: + """ + Describes a group by group name. + + Args: + input: + An instance of `GetGroupInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetGroupOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_GROUP, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_index( + self, input: GetIndexInput, plugins: list[Plugin] | None = None + ) -> GetIndexOutput: + """ + Gets information about an existing Amazon Q Business index. + + Args: + input: + An instance of `GetIndexInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetIndexOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_INDEX, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_media( + self, input: GetMediaInput, plugins: list[Plugin] | None = None + ) -> GetMediaOutput: + """ + Returns the image bytes corresponding to a media object. If you have + implemented your own application with the Chat and ChatSync APIs, and + have enabled content extraction from visual data in Amazon Q Business, + you use the GetMedia API operation to download the images so you can + show them in your UI with responses. + + For more information, see [Extracting semantic meaning from images and + visuals](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/extracting-meaning-from-images.html). + + Args: + input: + An instance of `GetMediaInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetMediaOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_MEDIA, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_plugin( + self, input: GetPluginInput, plugins: list[Plugin] | None = None + ) -> GetPluginOutput: + """ + Gets information about an existing Amazon Q Business plugin. + + Args: + input: + An instance of `GetPluginInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetPluginOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_PLUGIN, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_policy( + self, input: GetPolicyInput, plugins: list[Plugin] | None = None + ) -> GetPolicyOutput: + """ + Retrieves the current permission policy for a Amazon Q Business + application. The policy is returned as a JSON-formatted string and + defines the IAM actions that are allowed or denied for the + application's resources. + + Args: + input: + An instance of `GetPolicyInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetPolicyOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_POLICY, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_retriever( + self, input: GetRetrieverInput, plugins: list[Plugin] | None = None + ) -> GetRetrieverOutput: + """ + Gets information about an existing retriever used by an Amazon Q + Business application. + + Args: + input: + An instance of `GetRetrieverInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetRetrieverOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_RETRIEVER, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_user( + self, input: GetUserInput, plugins: list[Plugin] | None = None + ) -> GetUserOutput: + """ + Describes the universally unique identifier (UUID) associated with a + local user in a data source. + + Args: + input: + An instance of `GetUserInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetUserOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_USER, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def get_web_experience( + self, input: GetWebExperienceInput, plugins: list[Plugin] | None = None + ) -> GetWebExperienceOutput: + """ + Gets information about an existing Amazon Q Business web experience. + + Args: + input: + An instance of `GetWebExperienceInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `GetWebExperienceOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=GET_WEB_EXPERIENCE, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_applications( + self, input: ListApplicationsInput, plugins: list[Plugin] | None = None + ) -> ListApplicationsOutput: + """ + Lists Amazon Q Business applications. + + Note: + Amazon Q Business applications may securely transmit data for processing + across Amazon Web Services Regions within your geography. For more + information, see [Cross region inference in Amazon Q + Business](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/cross-region-inference.html). + + Args: + input: + An instance of `ListApplicationsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListApplicationsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_APPLICATIONS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_attachments( + self, input: ListAttachmentsInput, plugins: list[Plugin] | None = None + ) -> ListAttachmentsOutput: + """ + Gets a list of attachments associated with an Amazon Q Business web + experience or a list of attachements associated with a specific Amazon Q + Business conversation. + + Args: + input: + An instance of `ListAttachmentsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListAttachmentsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_ATTACHMENTS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_chat_response_configurations( + self, + input: ListChatResponseConfigurationsInput, + plugins: list[Plugin] | None = None, + ) -> ListChatResponseConfigurationsOutput: + """ + Retrieves a list of all chat response configurations available in a + specified Amazon Q Business application. This operation returns summary + information about each configuration to help administrators manage and + select appropriate response settings. + + Args: + input: + An instance of `ListChatResponseConfigurationsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListChatResponseConfigurationsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_CHAT_RESPONSE_CONFIGURATIONS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_conversations( + self, input: ListConversationsInput, plugins: list[Plugin] | None = None + ) -> ListConversationsOutput: + """ + Lists one or more Amazon Q Business conversations. + + Args: + input: + An instance of `ListConversationsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListConversationsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_CONVERSATIONS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_data_accessors( + self, input: ListDataAccessorsInput, plugins: list[Plugin] | None = None + ) -> ListDataAccessorsOutput: + """ + Lists the data accessors for a Amazon Q Business application. This + operation returns a paginated list of data accessor summaries, including + the friendly name, unique identifier, ARN, associated IAM role, and + creation/update timestamps for each data accessor. + + Args: + input: + An instance of `ListDataAccessorsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListDataAccessorsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_DATA_ACCESSORS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_data_sources( + self, input: ListDataSourcesInput, plugins: list[Plugin] | None = None + ) -> ListDataSourcesOutput: + """ + Lists the Amazon Q Business data source connectors that you have + created. + + Args: + input: + An instance of `ListDataSourcesInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListDataSourcesOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_DATA_SOURCES, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_data_source_sync_jobs( + self, input: ListDataSourceSyncJobsInput, plugins: list[Plugin] | None = None + ) -> ListDataSourceSyncJobsOutput: + """ + Get information about an Amazon Q Business data source connector + synchronization. + + Args: + input: + An instance of `ListDataSourceSyncJobsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListDataSourceSyncJobsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_DATA_SOURCE_SYNC_JOBS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_documents( + self, input: ListDocumentsInput, plugins: list[Plugin] | None = None + ) -> ListDocumentsOutput: + """ + A list of documents attached to an index. + + Args: + input: + An instance of `ListDocumentsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListDocumentsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_DOCUMENTS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_groups( + self, input: ListGroupsInput, plugins: list[Plugin] | None = None + ) -> ListGroupsOutput: + """ + Provides a list of groups that are mapped to users. + + Args: + input: + An instance of `ListGroupsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListGroupsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_GROUPS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_indices( + self, input: ListIndicesInput, plugins: list[Plugin] | None = None + ) -> ListIndicesOutput: + """ + Lists the Amazon Q Business indices you have created. + + Args: + input: + An instance of `ListIndicesInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListIndicesOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_INDICES, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_messages( + self, input: ListMessagesInput, plugins: list[Plugin] | None = None + ) -> ListMessagesOutput: + """ + Gets a list of messages associated with an Amazon Q Business web + experience. + + Args: + input: + An instance of `ListMessagesInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListMessagesOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_MESSAGES, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_plugin_actions( + self, input: ListPluginActionsInput, plugins: list[Plugin] | None = None + ) -> ListPluginActionsOutput: + """ + Lists configured Amazon Q Business actions for a specific plugin in an + Amazon Q Business application. + + Args: + input: + An instance of `ListPluginActionsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListPluginActionsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_PLUGIN_ACTIONS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_plugins( + self, input: ListPluginsInput, plugins: list[Plugin] | None = None + ) -> ListPluginsOutput: + """ + Lists configured Amazon Q Business plugins. + + Args: + input: + An instance of `ListPluginsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListPluginsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_PLUGINS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_plugin_type_actions( + self, input: ListPluginTypeActionsInput, plugins: list[Plugin] | None = None + ) -> ListPluginTypeActionsOutput: + """ + Lists configured Amazon Q Business actions for any plugin type---both + built-in and custom. + + Args: + input: + An instance of `ListPluginTypeActionsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListPluginTypeActionsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_PLUGIN_TYPE_ACTIONS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_plugin_type_metadata( + self, input: ListPluginTypeMetadataInput, plugins: list[Plugin] | None = None + ) -> ListPluginTypeMetadataOutput: + """ + Lists metadata for all Amazon Q Business plugin types. + + Args: + input: + An instance of `ListPluginTypeMetadataInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListPluginTypeMetadataOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_PLUGIN_TYPE_METADATA, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_retrievers( + self, input: ListRetrieversInput, plugins: list[Plugin] | None = None + ) -> ListRetrieversOutput: + """ + Lists the retriever used by an Amazon Q Business application. + + Args: + input: + An instance of `ListRetrieversInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListRetrieversOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_RETRIEVERS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_subscriptions( + self, input: ListSubscriptionsInput, plugins: list[Plugin] | None = None + ) -> ListSubscriptionsOutput: + """ + Lists all subscriptions created in an Amazon Q Business application. + + Args: + input: + An instance of `ListSubscriptionsInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListSubscriptionsOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_SUBSCRIPTIONS, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_tags_for_resource( + self, input: ListTagsForResourceInput, plugins: list[Plugin] | None = None + ) -> ListTagsForResourceOutput: + """ + Gets a list of tags associated with a specified resource. Amazon Q + Business applications and data sources can have tags associated with + them. + + Args: + input: + An instance of `ListTagsForResourceInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListTagsForResourceOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_TAGS_FOR_RESOURCE, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def list_web_experiences( + self, input: ListWebExperiencesInput, plugins: list[Plugin] | None = None + ) -> ListWebExperiencesOutput: + """ + Lists one or more Amazon Q Business Web Experiences. + + Args: + input: + An instance of `ListWebExperiencesInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `ListWebExperiencesOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=LIST_WEB_EXPERIENCES, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def put_feedback( + self, input: PutFeedbackInput, plugins: list[Plugin] | None = None + ) -> PutFeedbackOutput: + """ + Enables your end user to provide feedback on their Amazon Q Business + generated chat responses. + + Args: + input: + An instance of `PutFeedbackInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `PutFeedbackOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=PUT_FEEDBACK, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def put_group( + self, input: PutGroupInput, plugins: list[Plugin] | None = None + ) -> PutGroupOutput: + """ + Create, or updates, a mapping of users---who have access to a + document---to groups. + + You can also map sub groups to groups. For example, the group \"Company + Intellectual Property Teams\" includes sub groups \"Research\" and + \"Engineering\". These sub groups include their own list of users or + people who work in these teams. Only users who work in research and + engineering, and therefore belong in the intellectual property group, + can see top-secret company documents in their Amazon Q Business chat + results. + + There are two options for creating groups, either passing group members + inline or using an S3 file via the S3PathForGroupMembers field. For + inline groups, there is a limit of 1000 members per group and for + provided S3 files there is a limit of 100 thousand members. When + creating a group using an S3 file, you provide both an S3 file and a + `RoleArn` for Amazon Q Buisness to access the file. + + Args: + input: + An instance of `PutGroupInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `PutGroupOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=PUT_GROUP, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def search_relevant_content( + self, input: SearchRelevantContentInput, plugins: list[Plugin] | None = None + ) -> SearchRelevantContentOutput: + """ + Searches for relevant content in a Amazon Q Business application based + on a query. This operation takes a search query text, the Amazon Q + Business application identifier, and optional filters (such as content + source and maximum results) as input. It returns a list of relevant + content items, where each item includes the content text, the unique + document identifier, the document title, the document URI, any relevant + document attributes, and score attributes indicating the confidence + level of the relevance. + + Args: + input: + An instance of `SearchRelevantContentInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `SearchRelevantContentOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=SEARCH_RELEVANT_CONTENT, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def start_data_source_sync_job( + self, input: StartDataSourceSyncJobInput, plugins: list[Plugin] | None = None + ) -> StartDataSourceSyncJobOutput: + """ + Starts a data source connector synchronization job. If a synchronization + job is already in progress, Amazon Q Business returns a + `ConflictException`. + + Args: + input: + An instance of `StartDataSourceSyncJobInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `StartDataSourceSyncJobOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=START_DATA_SOURCE_SYNC_JOB, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def stop_data_source_sync_job( + self, input: StopDataSourceSyncJobInput, plugins: list[Plugin] | None = None + ) -> StopDataSourceSyncJobOutput: + """ + Stops an Amazon Q Business data source connector synchronization job + already in progress. + + Args: + input: + An instance of `StopDataSourceSyncJobInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `StopDataSourceSyncJobOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=STOP_DATA_SOURCE_SYNC_JOB, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def tag_resource( + self, input: TagResourceInput, plugins: list[Plugin] | None = None + ) -> TagResourceOutput: + """ + Adds the specified tag to the specified Amazon Q Business application or + data source resource. If the tag already exists, the existing value is + replaced with the new value. + + Args: + input: + An instance of `TagResourceInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `TagResourceOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=TAG_RESOURCE, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def untag_resource( + self, input: UntagResourceInput, plugins: list[Plugin] | None = None + ) -> UntagResourceOutput: + """ + Removes a tag from an Amazon Q Business application or a data source. + + Args: + input: + An instance of `UntagResourceInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UntagResourceOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UNTAG_RESOURCE, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def update_application( + self, input: UpdateApplicationInput, plugins: list[Plugin] | None = None + ) -> UpdateApplicationOutput: + """ + Updates an existing Amazon Q Business application. + + Note: + Amazon Q Business applications may securely transmit data for processing + across Amazon Web Services Regions within your geography. For more + information, see [Cross region inference in Amazon Q + Business](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/cross-region-inference.html). + Note: + An Amazon Q Apps service-linked role will be created if it's absent in + the Amazon Web Services account when `QAppsConfiguration` is enabled in + the request. For more information, see [Using service-linked roles for Q + Apps](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/using-service-linked-roles-qapps.html). + + Args: + input: + An instance of `UpdateApplicationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UpdateApplicationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UPDATE_APPLICATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def update_chat_controls_configuration( + self, + input: UpdateChatControlsConfigurationInput, + plugins: list[Plugin] | None = None, + ) -> UpdateChatControlsConfigurationOutput: + """ + Updates a set of chat controls configured for an existing Amazon Q + Business application. + + Args: + input: + An instance of `UpdateChatControlsConfigurationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UpdateChatControlsConfigurationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UPDATE_CHAT_CONTROLS_CONFIGURATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def update_chat_response_configuration( + self, + input: UpdateChatResponseConfigurationInput, + plugins: list[Plugin] | None = None, + ) -> UpdateChatResponseConfigurationOutput: + """ + Updates an existing chat response configuration in an Amazon Q Business + application. This operation allows administrators to modify + configuration settings, display name, and response parameters to refine + how the system generates responses. + + Args: + input: + An instance of `UpdateChatResponseConfigurationInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UpdateChatResponseConfigurationOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UPDATE_CHAT_RESPONSE_CONFIGURATION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def update_data_accessor( + self, input: UpdateDataAccessorInput, plugins: list[Plugin] | None = None + ) -> UpdateDataAccessorOutput: + """ + Updates an existing data accessor. This operation allows modifying the + action configurations (the allowed actions and associated filters) and + the display name of the data accessor. It does not allow changing the + IAM role associated with the data accessor or other core properties of + the data accessor. + + Args: + input: + An instance of `UpdateDataAccessorInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UpdateDataAccessorOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UPDATE_DATA_ACCESSOR, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def update_data_source( + self, input: UpdateDataSourceInput, plugins: list[Plugin] | None = None + ) -> UpdateDataSourceOutput: + """ + Updates an existing Amazon Q Business data source connector. + + Args: + input: + An instance of `UpdateDataSourceInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UpdateDataSourceOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UPDATE_DATA_SOURCE, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def update_index( + self, input: UpdateIndexInput, plugins: list[Plugin] | None = None + ) -> UpdateIndexOutput: + """ + Updates an Amazon Q Business index. + + Args: + input: + An instance of `UpdateIndexInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UpdateIndexOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UPDATE_INDEX, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def update_plugin( + self, input: UpdatePluginInput, plugins: list[Plugin] | None = None + ) -> UpdatePluginOutput: + """ + Updates an Amazon Q Business plugin. + + Args: + input: + An instance of `UpdatePluginInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UpdatePluginOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UPDATE_PLUGIN, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def update_retriever( + self, input: UpdateRetrieverInput, plugins: list[Plugin] | None = None + ) -> UpdateRetrieverOutput: + """ + Updates the retriever used for your Amazon Q Business application. + + Args: + input: + An instance of `UpdateRetrieverInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UpdateRetrieverOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UPDATE_RETRIEVER, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def update_subscription( + self, input: UpdateSubscriptionInput, plugins: list[Plugin] | None = None + ) -> UpdateSubscriptionOutput: + """ + Updates the pricing tier for an Amazon Q Business subscription. Upgrades + are instant. Downgrades apply at the start of the next month. + Subscription tier determines feature access for the user. For more + information on subscriptions and pricing tiers, see [Amazon Q Business + pricing](https://aws.amazon.com/q/business/pricing/). + + Args: + input: + An instance of `UpdateSubscriptionInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UpdateSubscriptionOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UPDATE_SUBSCRIPTION, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def update_user( + self, input: UpdateUserInput, plugins: list[Plugin] | None = None + ) -> UpdateUserOutput: + """ + Updates a information associated with a user id. + + Args: + input: + An instance of `UpdateUserInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UpdateUserOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UPDATE_USER, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) + + async def update_web_experience( + self, input: UpdateWebExperienceInput, plugins: list[Plugin] | None = None + ) -> UpdateWebExperienceOutput: + """ + Updates an Amazon Q Business web experience. + + Args: + input: + An instance of `UpdateWebExperienceInput`. + plugins: + A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the + operation execution and will not affect any other operation + invocations. + + Returns: + An instance of `UpdateWebExperienceOutput`. + """ + operation_plugins: list[Plugin] = [] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) + + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + retry_strategy=config.retry_strategy + ) + + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) + call = ClientCall( + input=input, + operation=UPDATE_WEB_EXPERIENCE, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline(call) diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/config.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/config.py new file mode 100644 index 0000000..b63e2e2 --- /dev/null +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/config.py @@ -0,0 +1,451 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from typing import Any, Callable, TypeAlias, Union + +from smithy_aws_core.aio.protocols import RestJsonClientProtocol +from smithy_aws_core.auth import SigV4AuthScheme +from smithy_aws_core.endpoints.standard_regional import ( + StandardRegionalEndpointsResolver, +) +from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties +from smithy_core.aio.interfaces import ClientProtocol, ClientTransport, EndpointResolver +from smithy_core.aio.interfaces.auth import AuthScheme +from smithy_core.aio.interfaces.identity import IdentityResolver +from smithy_core.interceptors import Interceptor +from smithy_core.interfaces import URI +from smithy_core.interfaces.retries import RetryStrategy +from smithy_core.retries import RetryStrategyOptions +from smithy_core.shapes import ShapeID +from smithy_http.aio.crt import AWSCRTHTTPClient +from smithy_http.interfaces import HTTPRequestConfiguration + +from ._private.schemas import EXPERT_Q as _SCHEMA_EXPERT_Q +from .auth import HTTPAuthSchemeResolver +from .models import ( + AssociatePermissionInput, + AssociatePermissionOutput, + BatchDeleteDocumentInput, + BatchDeleteDocumentOutput, + BatchPutDocumentInput, + BatchPutDocumentOutput, + CancelSubscriptionInput, + CancelSubscriptionOutput, + ChatInput, + ChatOutput, + ChatSyncInput, + ChatSyncOutput, + CheckDocumentAccessInput, + CheckDocumentAccessOutput, + CreateAnonymousWebExperienceUrlInput, + CreateAnonymousWebExperienceUrlOutput, + CreateApplicationInput, + CreateApplicationOutput, + CreateChatResponseConfigurationInput, + CreateChatResponseConfigurationOutput, + CreateDataAccessorInput, + CreateDataAccessorOutput, + CreateDataSourceInput, + CreateDataSourceOutput, + CreateIndexInput, + CreateIndexOutput, + CreatePluginInput, + CreatePluginOutput, + CreateRetrieverInput, + CreateRetrieverOutput, + CreateSubscriptionInput, + CreateSubscriptionOutput, + CreateUserInput, + CreateUserOutput, + CreateWebExperienceInput, + CreateWebExperienceOutput, + DeleteApplicationInput, + DeleteApplicationOutput, + DeleteAttachmentInput, + DeleteAttachmentOutput, + DeleteChatControlsConfigurationInput, + DeleteChatControlsConfigurationOutput, + DeleteChatResponseConfigurationInput, + DeleteChatResponseConfigurationOutput, + DeleteConversationInput, + DeleteConversationOutput, + DeleteDataAccessorInput, + DeleteDataAccessorOutput, + DeleteDataSourceInput, + DeleteDataSourceOutput, + DeleteGroupInput, + DeleteGroupOutput, + DeleteIndexInput, + DeleteIndexOutput, + DeletePluginInput, + DeletePluginOutput, + DeleteRetrieverInput, + DeleteRetrieverOutput, + DeleteUserInput, + DeleteUserOutput, + DeleteWebExperienceInput, + DeleteWebExperienceOutput, + DisassociatePermissionInput, + DisassociatePermissionOutput, + GetApplicationInput, + GetApplicationOutput, + GetChatControlsConfigurationInput, + GetChatControlsConfigurationOutput, + GetChatResponseConfigurationInput, + GetChatResponseConfigurationOutput, + GetDataAccessorInput, + GetDataAccessorOutput, + GetDataSourceInput, + GetDataSourceOutput, + GetDocumentContentInput, + GetDocumentContentOutput, + GetGroupInput, + GetGroupOutput, + GetIndexInput, + GetIndexOutput, + GetMediaInput, + GetMediaOutput, + GetPluginInput, + GetPluginOutput, + GetPolicyInput, + GetPolicyOutput, + GetRetrieverInput, + GetRetrieverOutput, + GetUserInput, + GetUserOutput, + GetWebExperienceInput, + GetWebExperienceOutput, + ListApplicationsInput, + ListApplicationsOutput, + ListAttachmentsInput, + ListAttachmentsOutput, + ListChatResponseConfigurationsInput, + ListChatResponseConfigurationsOutput, + ListConversationsInput, + ListConversationsOutput, + ListDataAccessorsInput, + ListDataAccessorsOutput, + ListDataSourceSyncJobsInput, + ListDataSourceSyncJobsOutput, + ListDataSourcesInput, + ListDataSourcesOutput, + ListDocumentsInput, + ListDocumentsOutput, + ListGroupsInput, + ListGroupsOutput, + ListIndicesInput, + ListIndicesOutput, + ListMessagesInput, + ListMessagesOutput, + ListPluginActionsInput, + ListPluginActionsOutput, + ListPluginTypeActionsInput, + ListPluginTypeActionsOutput, + ListPluginTypeMetadataInput, + ListPluginTypeMetadataOutput, + ListPluginsInput, + ListPluginsOutput, + ListRetrieversInput, + ListRetrieversOutput, + ListSubscriptionsInput, + ListSubscriptionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListWebExperiencesInput, + ListWebExperiencesOutput, + PutFeedbackInput, + PutFeedbackOutput, + PutGroupInput, + PutGroupOutput, + SearchRelevantContentInput, + SearchRelevantContentOutput, + StartDataSourceSyncJobInput, + StartDataSourceSyncJobOutput, + StopDataSourceSyncJobInput, + StopDataSourceSyncJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateApplicationInput, + UpdateApplicationOutput, + UpdateChatControlsConfigurationInput, + UpdateChatControlsConfigurationOutput, + UpdateChatResponseConfigurationInput, + UpdateChatResponseConfigurationOutput, + UpdateDataAccessorInput, + UpdateDataAccessorOutput, + UpdateDataSourceInput, + UpdateDataSourceOutput, + UpdateIndexInput, + UpdateIndexOutput, + UpdatePluginInput, + UpdatePluginOutput, + UpdateRetrieverInput, + UpdateRetrieverOutput, + UpdateSubscriptionInput, + UpdateSubscriptionOutput, + UpdateUserInput, + UpdateUserOutput, + UpdateWebExperienceInput, + UpdateWebExperienceOutput, +) + + +_ServiceInterceptor = Union[ + Interceptor[AssociatePermissionInput, AssociatePermissionOutput, Any, Any], + Interceptor[BatchDeleteDocumentInput, BatchDeleteDocumentOutput, Any, Any], + Interceptor[BatchPutDocumentInput, BatchPutDocumentOutput, Any, Any], + Interceptor[CancelSubscriptionInput, CancelSubscriptionOutput, Any, Any], + Interceptor[ChatInput, ChatOutput, Any, Any], + Interceptor[ChatSyncInput, ChatSyncOutput, Any, Any], + Interceptor[CheckDocumentAccessInput, CheckDocumentAccessOutput, Any, Any], + Interceptor[ + CreateAnonymousWebExperienceUrlInput, + CreateAnonymousWebExperienceUrlOutput, + Any, + Any, + ], + Interceptor[CreateApplicationInput, CreateApplicationOutput, Any, Any], + Interceptor[ + CreateChatResponseConfigurationInput, + CreateChatResponseConfigurationOutput, + Any, + Any, + ], + Interceptor[CreateDataAccessorInput, CreateDataAccessorOutput, Any, Any], + Interceptor[CreateDataSourceInput, CreateDataSourceOutput, Any, Any], + Interceptor[CreateIndexInput, CreateIndexOutput, Any, Any], + Interceptor[CreatePluginInput, CreatePluginOutput, Any, Any], + Interceptor[CreateRetrieverInput, CreateRetrieverOutput, Any, Any], + Interceptor[CreateSubscriptionInput, CreateSubscriptionOutput, Any, Any], + Interceptor[CreateUserInput, CreateUserOutput, Any, Any], + Interceptor[CreateWebExperienceInput, CreateWebExperienceOutput, Any, Any], + Interceptor[DeleteApplicationInput, DeleteApplicationOutput, Any, Any], + Interceptor[DeleteAttachmentInput, DeleteAttachmentOutput, Any, Any], + Interceptor[ + DeleteChatControlsConfigurationInput, + DeleteChatControlsConfigurationOutput, + Any, + Any, + ], + Interceptor[ + DeleteChatResponseConfigurationInput, + DeleteChatResponseConfigurationOutput, + Any, + Any, + ], + Interceptor[DeleteConversationInput, DeleteConversationOutput, Any, Any], + Interceptor[DeleteDataAccessorInput, DeleteDataAccessorOutput, Any, Any], + Interceptor[DeleteDataSourceInput, DeleteDataSourceOutput, Any, Any], + Interceptor[DeleteGroupInput, DeleteGroupOutput, Any, Any], + Interceptor[DeleteIndexInput, DeleteIndexOutput, Any, Any], + Interceptor[DeletePluginInput, DeletePluginOutput, Any, Any], + Interceptor[DeleteRetrieverInput, DeleteRetrieverOutput, Any, Any], + Interceptor[DeleteUserInput, DeleteUserOutput, Any, Any], + Interceptor[DeleteWebExperienceInput, DeleteWebExperienceOutput, Any, Any], + Interceptor[DisassociatePermissionInput, DisassociatePermissionOutput, Any, Any], + Interceptor[GetApplicationInput, GetApplicationOutput, Any, Any], + Interceptor[ + GetChatControlsConfigurationInput, GetChatControlsConfigurationOutput, Any, Any + ], + Interceptor[ + GetChatResponseConfigurationInput, GetChatResponseConfigurationOutput, Any, Any + ], + Interceptor[GetDataAccessorInput, GetDataAccessorOutput, Any, Any], + Interceptor[GetDataSourceInput, GetDataSourceOutput, Any, Any], + Interceptor[GetDocumentContentInput, GetDocumentContentOutput, Any, Any], + Interceptor[GetGroupInput, GetGroupOutput, Any, Any], + Interceptor[GetIndexInput, GetIndexOutput, Any, Any], + Interceptor[GetMediaInput, GetMediaOutput, Any, Any], + Interceptor[GetPluginInput, GetPluginOutput, Any, Any], + Interceptor[GetPolicyInput, GetPolicyOutput, Any, Any], + Interceptor[GetRetrieverInput, GetRetrieverOutput, Any, Any], + Interceptor[GetUserInput, GetUserOutput, Any, Any], + Interceptor[GetWebExperienceInput, GetWebExperienceOutput, Any, Any], + Interceptor[ListApplicationsInput, ListApplicationsOutput, Any, Any], + Interceptor[ListAttachmentsInput, ListAttachmentsOutput, Any, Any], + Interceptor[ + ListChatResponseConfigurationsInput, + ListChatResponseConfigurationsOutput, + Any, + Any, + ], + Interceptor[ListConversationsInput, ListConversationsOutput, Any, Any], + Interceptor[ListDataAccessorsInput, ListDataAccessorsOutput, Any, Any], + Interceptor[ListDataSourcesInput, ListDataSourcesOutput, Any, Any], + Interceptor[ListDataSourceSyncJobsInput, ListDataSourceSyncJobsOutput, Any, Any], + Interceptor[ListDocumentsInput, ListDocumentsOutput, Any, Any], + Interceptor[ListGroupsInput, ListGroupsOutput, Any, Any], + Interceptor[ListIndicesInput, ListIndicesOutput, Any, Any], + Interceptor[ListMessagesInput, ListMessagesOutput, Any, Any], + Interceptor[ListPluginActionsInput, ListPluginActionsOutput, Any, Any], + Interceptor[ListPluginsInput, ListPluginsOutput, Any, Any], + Interceptor[ListPluginTypeActionsInput, ListPluginTypeActionsOutput, Any, Any], + Interceptor[ListPluginTypeMetadataInput, ListPluginTypeMetadataOutput, Any, Any], + Interceptor[ListRetrieversInput, ListRetrieversOutput, Any, Any], + Interceptor[ListSubscriptionsInput, ListSubscriptionsOutput, Any, Any], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[ListWebExperiencesInput, ListWebExperiencesOutput, Any, Any], + Interceptor[PutFeedbackInput, PutFeedbackOutput, Any, Any], + Interceptor[PutGroupInput, PutGroupOutput, Any, Any], + Interceptor[SearchRelevantContentInput, SearchRelevantContentOutput, Any, Any], + Interceptor[StartDataSourceSyncJobInput, StartDataSourceSyncJobOutput, Any, Any], + Interceptor[StopDataSourceSyncJobInput, StopDataSourceSyncJobOutput, Any, Any], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[UpdateApplicationInput, UpdateApplicationOutput, Any, Any], + Interceptor[ + UpdateChatControlsConfigurationInput, + UpdateChatControlsConfigurationOutput, + Any, + Any, + ], + Interceptor[ + UpdateChatResponseConfigurationInput, + UpdateChatResponseConfigurationOutput, + Any, + Any, + ], + Interceptor[UpdateDataAccessorInput, UpdateDataAccessorOutput, Any, Any], + Interceptor[UpdateDataSourceInput, UpdateDataSourceOutput, Any, Any], + Interceptor[UpdateIndexInput, UpdateIndexOutput, Any, Any], + Interceptor[UpdatePluginInput, UpdatePluginOutput, Any, Any], + Interceptor[UpdateRetrieverInput, UpdateRetrieverOutput, Any, Any], + Interceptor[UpdateSubscriptionInput, UpdateSubscriptionOutput, Any, Any], + Interceptor[UpdateUserInput, UpdateUserOutput, Any, Any], + Interceptor[UpdateWebExperienceInput, UpdateWebExperienceOutput, Any, Any], +] + + +@dataclass(init=False) +class Config: + """Configuration for QBusiness.""" + + auth_scheme_resolver: HTTPAuthSchemeResolver + """ + An auth scheme resolver that determines the auth scheme for each + operation. + """ + + auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] + """A map of auth scheme ids to auth schemes.""" + + aws_access_key_id: str | None + """The identifier for a secret access key.""" + + aws_credentials_identity_resolver: ( + IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + ) + """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" + + aws_secret_access_key: str | None + """A secret access key that can be used to sign requests.""" + + aws_session_token: str | None + """An access key ID that identifies temporary security credentials.""" + + endpoint_resolver: EndpointResolver + """ + The endpoint resolver used to resolve the final endpoint per-operation + based on the configuration. + """ + + endpoint_uri: str | URI | None + """A static URI to route requests to.""" + + http_request_config: HTTPRequestConfiguration | None + """Configuration for individual HTTP requests.""" + + interceptors: list[_ServiceInterceptor] + """ + The list of interceptors, which are hooks that are called during the + execution of a request. + """ + + protocol: ClientProtocol[Any, Any] | None + """The protocol to serialize and deserialize requests with.""" + + region: str | None + """ + The AWS region to connect to. The configured region is used to determine + the service endpoint. + """ + + retry_strategy: RetryStrategy | RetryStrategyOptions | None + """ + The retry strategy or options for configuring retry behavior. Can be + either a configured RetryStrategy or RetryStrategyOptions to create one. + """ + + sdk_ua_app_id: str | None + """ + A unique and opaque application ID that is appended to the User-Agent + header. + """ + + transport: ClientTransport[Any, Any] | None + """The transport to use to send requests (e.g. an HTTP client).""" + + user_agent_extra: str | None + """Additional suffix to be added to the User-Agent header.""" + + def __init__( + self, + *, + auth_scheme_resolver: HTTPAuthSchemeResolver | None = None, + auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None, + aws_access_key_id: str | None = None, + aws_credentials_identity_resolver: IdentityResolver[ + AWSCredentialsIdentity, AWSIdentityProperties + ] + | None = None, + aws_secret_access_key: str | None = None, + aws_session_token: str | None = None, + endpoint_resolver: EndpointResolver | None = None, + endpoint_uri: str | URI | None = None, + http_request_config: HTTPRequestConfiguration | None = None, + interceptors: list[_ServiceInterceptor] | None = None, + protocol: ClientProtocol[Any, Any] | None = None, + region: str | None = None, + retry_strategy: RetryStrategy | RetryStrategyOptions | None = None, + sdk_ua_app_id: str | None = None, + transport: ClientTransport[Any, Any] | None = None, + user_agent_extra: str | None = None, + ): + self.auth_scheme_resolver = auth_scheme_resolver or HTTPAuthSchemeResolver() + self.auth_schemes = auth_schemes or { + ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="qbusiness") + } + self.aws_access_key_id = aws_access_key_id + self.aws_credentials_identity_resolver = aws_credentials_identity_resolver + self.aws_secret_access_key = aws_secret_access_key + self.aws_session_token = aws_session_token + self.endpoint_resolver = endpoint_resolver or StandardRegionalEndpointsResolver( + endpoint_prefix="qbusiness" + ) + self.endpoint_uri = endpoint_uri + self.http_request_config = http_request_config + self.interceptors = interceptors or [] + self.protocol = protocol or RestJsonClientProtocol(_SCHEMA_EXPERT_Q) + self.region = region + self.retry_strategy = retry_strategy + self.sdk_ua_app_id = sdk_ua_app_id + self.transport = transport or AWSCRTHTTPClient() + self.user_agent_extra = user_agent_extra + + def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + """ + Sets the implementation of an auth scheme. + + Using this method ensures the correct key is used. + + Args: + scheme: + The auth scheme to add. + """ + self.auth_schemes[scheme.scheme_id] = scheme + + +Plugin: TypeAlias = Callable[[Config], None] +"""A callable that allows customizing the config object on each request.""" diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/models.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/models.py new file mode 100644 index 0000000..8b10b34 --- /dev/null +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/models.py @@ -0,0 +1,31753 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass, field +from datetime import datetime +from enum import StrEnum +import logging +from typing import Any, Literal, Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.documents import Document as _Document, TypeRegistry +from smithy_core.exceptions import ModeledError, SerializationError +from smithy_core.schemas import APIOperation, Schema +from smithy_core.serializers import ShapeSerializer +from smithy_core.shapes import ShapeID + +from ._private.schemas import ( + ACCESS_CONFIGURATION as _SCHEMA_ACCESS_CONFIGURATION, + ACCESS_CONTROL as _SCHEMA_ACCESS_CONTROL, + ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, + ACTION_CONFIGURATION as _SCHEMA_ACTION_CONFIGURATION, + ACTION_EXECUTION as _SCHEMA_ACTION_EXECUTION, + ACTION_EXECUTION_EVENT as _SCHEMA_ACTION_EXECUTION_EVENT, + ACTION_EXECUTION_PAYLOAD_FIELD as _SCHEMA_ACTION_EXECUTION_PAYLOAD_FIELD, + ACTION_FILTER_CONFIGURATION as _SCHEMA_ACTION_FILTER_CONFIGURATION, + ACTION_REVIEW as _SCHEMA_ACTION_REVIEW, + ACTION_REVIEW_EVENT as _SCHEMA_ACTION_REVIEW_EVENT, + ACTION_REVIEW_PAYLOAD_FIELD as _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD, + ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE as _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE, + ACTION_SUMMARY as _SCHEMA_ACTION_SUMMARY, + API_SCHEMA as _SCHEMA_API_SCHEMA, + APPLICATION as _SCHEMA_APPLICATION, + APPLIED_ATTACHMENTS_CONFIGURATION as _SCHEMA_APPLIED_ATTACHMENTS_CONFIGURATION, + APPLIED_CREATOR_MODE_CONFIGURATION as _SCHEMA_APPLIED_CREATOR_MODE_CONFIGURATION, + APPLIED_ORCHESTRATION_CONFIGURATION as _SCHEMA_APPLIED_ORCHESTRATION_CONFIGURATION, + ASSOCIATED_GROUP as _SCHEMA_ASSOCIATED_GROUP, + ASSOCIATED_USER as _SCHEMA_ASSOCIATED_USER, + ASSOCIATE_PERMISSION as _SCHEMA_ASSOCIATE_PERMISSION, + ASSOCIATE_PERMISSION_INPUT as _SCHEMA_ASSOCIATE_PERMISSION_INPUT, + ASSOCIATE_PERMISSION_OUTPUT as _SCHEMA_ASSOCIATE_PERMISSION_OUTPUT, + ATTACHMENT as _SCHEMA_ATTACHMENT, + ATTACHMENTS_CONFIGURATION as _SCHEMA_ATTACHMENTS_CONFIGURATION, + ATTACHMENT_INPUT as _SCHEMA_ATTACHMENT_INPUT, + ATTACHMENT_INPUT_EVENT as _SCHEMA_ATTACHMENT_INPUT_EVENT, + ATTACHMENT_OUTPUT as _SCHEMA_ATTACHMENT_OUTPUT, + ATTRIBUTE_FILTER as _SCHEMA_ATTRIBUTE_FILTER, + AUDIO_EXTRACTION_CONFIGURATION as _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION, + AUDIO_SOURCE_DETAILS as _SCHEMA_AUDIO_SOURCE_DETAILS, + AUTH_CHALLENGE_REQUEST as _SCHEMA_AUTH_CHALLENGE_REQUEST, + AUTH_CHALLENGE_REQUEST_EVENT as _SCHEMA_AUTH_CHALLENGE_REQUEST_EVENT, + AUTH_CHALLENGE_RESPONSE as _SCHEMA_AUTH_CHALLENGE_RESPONSE, + AUTH_CHALLENGE_RESPONSE_EVENT as _SCHEMA_AUTH_CHALLENGE_RESPONSE_EVENT, + AUTO_SUBSCRIPTION_CONFIGURATION as _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION, + BASIC_AUTH_CONFIGURATION as _SCHEMA_BASIC_AUTH_CONFIGURATION, + BATCH_DELETE_DOCUMENT as _SCHEMA_BATCH_DELETE_DOCUMENT, + BATCH_DELETE_DOCUMENT_INPUT as _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT, + BATCH_DELETE_DOCUMENT_OUTPUT as _SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT, + BATCH_PUT_DOCUMENT as _SCHEMA_BATCH_PUT_DOCUMENT, + BATCH_PUT_DOCUMENT_INPUT as _SCHEMA_BATCH_PUT_DOCUMENT_INPUT, + BATCH_PUT_DOCUMENT_OUTPUT as _SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT, + BLOCKED_PHRASES_CONFIGURATION as _SCHEMA_BLOCKED_PHRASES_CONFIGURATION, + BLOCKED_PHRASES_CONFIGURATION_UPDATE as _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE, + BROWSER_EXTENSION_CONFIGURATION as _SCHEMA_BROWSER_EXTENSION_CONFIGURATION, + CANCEL_SUBSCRIPTION as _SCHEMA_CANCEL_SUBSCRIPTION, + CANCEL_SUBSCRIPTION_INPUT as _SCHEMA_CANCEL_SUBSCRIPTION_INPUT, + CANCEL_SUBSCRIPTION_OUTPUT as _SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT, + CHAT as _SCHEMA_CHAT, + CHAT_INPUT as _SCHEMA_CHAT_INPUT, + CHAT_INPUT_STREAM as _SCHEMA_CHAT_INPUT_STREAM, + CHAT_MODE_CONFIGURATION as _SCHEMA_CHAT_MODE_CONFIGURATION, + CHAT_OUTPUT as _SCHEMA_CHAT_OUTPUT, + CHAT_OUTPUT_STREAM as _SCHEMA_CHAT_OUTPUT_STREAM, + CHAT_RESPONSE_CONFIGURATION as _SCHEMA_CHAT_RESPONSE_CONFIGURATION, + CHAT_RESPONSE_CONFIGURATION_DETAIL as _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL, + CHAT_SYNC as _SCHEMA_CHAT_SYNC, + CHAT_SYNC_INPUT as _SCHEMA_CHAT_SYNC_INPUT, + CHAT_SYNC_OUTPUT as _SCHEMA_CHAT_SYNC_OUTPUT, + CHECK_DOCUMENT_ACCESS as _SCHEMA_CHECK_DOCUMENT_ACCESS, + CHECK_DOCUMENT_ACCESS_INPUT as _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT, + CHECK_DOCUMENT_ACCESS_OUTPUT as _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT, + CONFIGURATION_EVENT as _SCHEMA_CONFIGURATION_EVENT, + CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, + CONTENT_BLOCKER_RULE as _SCHEMA_CONTENT_BLOCKER_RULE, + CONTENT_RETRIEVAL_RULE as _SCHEMA_CONTENT_RETRIEVAL_RULE, + CONTENT_SOURCE as _SCHEMA_CONTENT_SOURCE, + CONVERSATION as _SCHEMA_CONVERSATION, + CONVERSATION_SOURCE as _SCHEMA_CONVERSATION_SOURCE, + COPY_FROM_SOURCE as _SCHEMA_COPY_FROM_SOURCE, + CREATE_ANONYMOUS_WEB_EXPERIENCE_URL as _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL, + CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT as _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT, + CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT as _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT, + CREATE_APPLICATION as _SCHEMA_CREATE_APPLICATION, + CREATE_APPLICATION_INPUT as _SCHEMA_CREATE_APPLICATION_INPUT, + CREATE_APPLICATION_OUTPUT as _SCHEMA_CREATE_APPLICATION_OUTPUT, + CREATE_CHAT_RESPONSE_CONFIGURATION as _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION, + CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT as _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT, + CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT as _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + CREATE_DATA_ACCESSOR as _SCHEMA_CREATE_DATA_ACCESSOR, + CREATE_DATA_ACCESSOR_INPUT as _SCHEMA_CREATE_DATA_ACCESSOR_INPUT, + CREATE_DATA_ACCESSOR_OUTPUT as _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT, + CREATE_DATA_SOURCE as _SCHEMA_CREATE_DATA_SOURCE, + CREATE_DATA_SOURCE_INPUT as _SCHEMA_CREATE_DATA_SOURCE_INPUT, + CREATE_DATA_SOURCE_OUTPUT as _SCHEMA_CREATE_DATA_SOURCE_OUTPUT, + CREATE_INDEX as _SCHEMA_CREATE_INDEX, + CREATE_INDEX_INPUT as _SCHEMA_CREATE_INDEX_INPUT, + CREATE_INDEX_OUTPUT as _SCHEMA_CREATE_INDEX_OUTPUT, + CREATE_PLUGIN as _SCHEMA_CREATE_PLUGIN, + CREATE_PLUGIN_INPUT as _SCHEMA_CREATE_PLUGIN_INPUT, + CREATE_PLUGIN_OUTPUT as _SCHEMA_CREATE_PLUGIN_OUTPUT, + CREATE_RETRIEVER as _SCHEMA_CREATE_RETRIEVER, + CREATE_RETRIEVER_INPUT as _SCHEMA_CREATE_RETRIEVER_INPUT, + CREATE_RETRIEVER_OUTPUT as _SCHEMA_CREATE_RETRIEVER_OUTPUT, + CREATE_SUBSCRIPTION as _SCHEMA_CREATE_SUBSCRIPTION, + CREATE_SUBSCRIPTION_INPUT as _SCHEMA_CREATE_SUBSCRIPTION_INPUT, + CREATE_SUBSCRIPTION_OUTPUT as _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, + CREATE_USER as _SCHEMA_CREATE_USER, + CREATE_USER_INPUT as _SCHEMA_CREATE_USER_INPUT, + CREATE_USER_OUTPUT as _SCHEMA_CREATE_USER_OUTPUT, + CREATE_WEB_EXPERIENCE as _SCHEMA_CREATE_WEB_EXPERIENCE, + CREATE_WEB_EXPERIENCE_INPUT as _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT, + CREATE_WEB_EXPERIENCE_OUTPUT as _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT, + CREATOR_MODE_CONFIGURATION as _SCHEMA_CREATOR_MODE_CONFIGURATION, + CUSTOMIZATION_CONFIGURATION as _SCHEMA_CUSTOMIZATION_CONFIGURATION, + CUSTOM_PLUGIN_CONFIGURATION as _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION, + DATA_ACCESSOR as _SCHEMA_DATA_ACCESSOR, + DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION as _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION, + DATA_ACCESSOR_AUTHENTICATION_DETAIL as _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL, + DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION as _SCHEMA_DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION, + DATA_SOURCE as _SCHEMA_DATA_SOURCE, + DATA_SOURCE_SYNC_JOB as _SCHEMA_DATA_SOURCE_SYNC_JOB, + DATA_SOURCE_SYNC_JOB_METRICS as _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS, + DATA_SOURCE_VPC_CONFIGURATION as _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION, + DATE_ATTRIBUTE_BOOSTING_CONFIGURATION as _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION, + DELETE_APPLICATION as _SCHEMA_DELETE_APPLICATION, + DELETE_APPLICATION_INPUT as _SCHEMA_DELETE_APPLICATION_INPUT, + DELETE_APPLICATION_OUTPUT as _SCHEMA_DELETE_APPLICATION_OUTPUT, + DELETE_ATTACHMENT as _SCHEMA_DELETE_ATTACHMENT, + DELETE_ATTACHMENT_INPUT as _SCHEMA_DELETE_ATTACHMENT_INPUT, + DELETE_ATTACHMENT_OUTPUT as _SCHEMA_DELETE_ATTACHMENT_OUTPUT, + DELETE_CHAT_CONTROLS_CONFIGURATION as _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION, + DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT as _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT, + DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT as _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, + DELETE_CHAT_RESPONSE_CONFIGURATION as _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION, + DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT as _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT, + DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT as _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + DELETE_CONVERSATION as _SCHEMA_DELETE_CONVERSATION, + DELETE_CONVERSATION_INPUT as _SCHEMA_DELETE_CONVERSATION_INPUT, + DELETE_CONVERSATION_OUTPUT as _SCHEMA_DELETE_CONVERSATION_OUTPUT, + DELETE_DATA_ACCESSOR as _SCHEMA_DELETE_DATA_ACCESSOR, + DELETE_DATA_ACCESSOR_INPUT as _SCHEMA_DELETE_DATA_ACCESSOR_INPUT, + DELETE_DATA_ACCESSOR_OUTPUT as _SCHEMA_DELETE_DATA_ACCESSOR_OUTPUT, + DELETE_DATA_SOURCE as _SCHEMA_DELETE_DATA_SOURCE, + DELETE_DATA_SOURCE_INPUT as _SCHEMA_DELETE_DATA_SOURCE_INPUT, + DELETE_DATA_SOURCE_OUTPUT as _SCHEMA_DELETE_DATA_SOURCE_OUTPUT, + DELETE_DOCUMENT as _SCHEMA_DELETE_DOCUMENT, + DELETE_GROUP as _SCHEMA_DELETE_GROUP, + DELETE_GROUP_INPUT as _SCHEMA_DELETE_GROUP_INPUT, + DELETE_GROUP_OUTPUT as _SCHEMA_DELETE_GROUP_OUTPUT, + DELETE_INDEX as _SCHEMA_DELETE_INDEX, + DELETE_INDEX_INPUT as _SCHEMA_DELETE_INDEX_INPUT, + DELETE_INDEX_OUTPUT as _SCHEMA_DELETE_INDEX_OUTPUT, + DELETE_PLUGIN as _SCHEMA_DELETE_PLUGIN, + DELETE_PLUGIN_INPUT as _SCHEMA_DELETE_PLUGIN_INPUT, + DELETE_PLUGIN_OUTPUT as _SCHEMA_DELETE_PLUGIN_OUTPUT, + DELETE_RETRIEVER as _SCHEMA_DELETE_RETRIEVER, + DELETE_RETRIEVER_INPUT as _SCHEMA_DELETE_RETRIEVER_INPUT, + DELETE_RETRIEVER_OUTPUT as _SCHEMA_DELETE_RETRIEVER_OUTPUT, + DELETE_USER as _SCHEMA_DELETE_USER, + DELETE_USER_INPUT as _SCHEMA_DELETE_USER_INPUT, + DELETE_USER_OUTPUT as _SCHEMA_DELETE_USER_OUTPUT, + DELETE_WEB_EXPERIENCE as _SCHEMA_DELETE_WEB_EXPERIENCE, + DELETE_WEB_EXPERIENCE_INPUT as _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT, + DELETE_WEB_EXPERIENCE_OUTPUT as _SCHEMA_DELETE_WEB_EXPERIENCE_OUTPUT, + DISASSOCIATE_PERMISSION as _SCHEMA_DISASSOCIATE_PERMISSION, + DISASSOCIATE_PERMISSION_INPUT as _SCHEMA_DISASSOCIATE_PERMISSION_INPUT, + DISASSOCIATE_PERMISSION_OUTPUT as _SCHEMA_DISASSOCIATE_PERMISSION_OUTPUT, + DOCUMENT as _SCHEMA_DOCUMENT, + DOCUMENT_ACL as _SCHEMA_DOCUMENT_ACL, + DOCUMENT_ACL_CONDITION as _SCHEMA_DOCUMENT_ACL_CONDITION, + DOCUMENT_ACL_GROUP as _SCHEMA_DOCUMENT_ACL_GROUP, + DOCUMENT_ACL_MEMBERSHIP as _SCHEMA_DOCUMENT_ACL_MEMBERSHIP, + DOCUMENT_ACL_USER as _SCHEMA_DOCUMENT_ACL_USER, + DOCUMENT_ATTRIBUTE as _SCHEMA_DOCUMENT_ATTRIBUTE, + DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION as _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, + DOCUMENT_ATTRIBUTE_CONDITION as _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION, + DOCUMENT_ATTRIBUTE_CONFIGURATION as _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION, + DOCUMENT_ATTRIBUTE_TARGET as _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET, + DOCUMENT_ATTRIBUTE_VALUE as _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, + DOCUMENT_CONTENT as _SCHEMA_DOCUMENT_CONTENT, + DOCUMENT_DETAILS as _SCHEMA_DOCUMENT_DETAILS, + DOCUMENT_ENRICHMENT_CONFIGURATION as _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION, + ELIGIBLE_DATA_SOURCE as _SCHEMA_ELIGIBLE_DATA_SOURCE, + ENCRYPTION_CONFIGURATION as _SCHEMA_ENCRYPTION_CONFIGURATION, + END_OF_INPUT_EVENT as _SCHEMA_END_OF_INPUT_EVENT, + ERROR_DETAIL as _SCHEMA_ERROR_DETAIL, + EXTERNAL_RESOURCE_EXCEPTION as _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION, + FAILED_ATTACHMENT_EVENT as _SCHEMA_FAILED_ATTACHMENT_EVENT, + FAILED_DOCUMENT as _SCHEMA_FAILED_DOCUMENT, + GET_APPLICATION as _SCHEMA_GET_APPLICATION, + GET_APPLICATION_INPUT as _SCHEMA_GET_APPLICATION_INPUT, + GET_APPLICATION_OUTPUT as _SCHEMA_GET_APPLICATION_OUTPUT, + GET_CHAT_CONTROLS_CONFIGURATION as _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION, + GET_CHAT_CONTROLS_CONFIGURATION_INPUT as _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT, + GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT as _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT, + GET_CHAT_RESPONSE_CONFIGURATION as _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION, + GET_CHAT_RESPONSE_CONFIGURATION_INPUT as _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT, + GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT as _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + GET_DATA_ACCESSOR as _SCHEMA_GET_DATA_ACCESSOR, + GET_DATA_ACCESSOR_INPUT as _SCHEMA_GET_DATA_ACCESSOR_INPUT, + GET_DATA_ACCESSOR_OUTPUT as _SCHEMA_GET_DATA_ACCESSOR_OUTPUT, + GET_DATA_SOURCE as _SCHEMA_GET_DATA_SOURCE, + GET_DATA_SOURCE_INPUT as _SCHEMA_GET_DATA_SOURCE_INPUT, + GET_DATA_SOURCE_OUTPUT as _SCHEMA_GET_DATA_SOURCE_OUTPUT, + GET_DOCUMENT_CONTENT as _SCHEMA_GET_DOCUMENT_CONTENT, + GET_DOCUMENT_CONTENT_INPUT as _SCHEMA_GET_DOCUMENT_CONTENT_INPUT, + GET_DOCUMENT_CONTENT_OUTPUT as _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, + GET_GROUP as _SCHEMA_GET_GROUP, + GET_GROUP_INPUT as _SCHEMA_GET_GROUP_INPUT, + GET_GROUP_OUTPUT as _SCHEMA_GET_GROUP_OUTPUT, + GET_INDEX as _SCHEMA_GET_INDEX, + GET_INDEX_INPUT as _SCHEMA_GET_INDEX_INPUT, + GET_INDEX_OUTPUT as _SCHEMA_GET_INDEX_OUTPUT, + GET_MEDIA as _SCHEMA_GET_MEDIA, + GET_MEDIA_INPUT as _SCHEMA_GET_MEDIA_INPUT, + GET_MEDIA_OUTPUT as _SCHEMA_GET_MEDIA_OUTPUT, + GET_PLUGIN as _SCHEMA_GET_PLUGIN, + GET_PLUGIN_INPUT as _SCHEMA_GET_PLUGIN_INPUT, + GET_PLUGIN_OUTPUT as _SCHEMA_GET_PLUGIN_OUTPUT, + GET_POLICY as _SCHEMA_GET_POLICY, + GET_POLICY_INPUT as _SCHEMA_GET_POLICY_INPUT, + GET_POLICY_OUTPUT as _SCHEMA_GET_POLICY_OUTPUT, + GET_RETRIEVER as _SCHEMA_GET_RETRIEVER, + GET_RETRIEVER_INPUT as _SCHEMA_GET_RETRIEVER_INPUT, + GET_RETRIEVER_OUTPUT as _SCHEMA_GET_RETRIEVER_OUTPUT, + GET_USER as _SCHEMA_GET_USER, + GET_USER_INPUT as _SCHEMA_GET_USER_INPUT, + GET_USER_OUTPUT as _SCHEMA_GET_USER_OUTPUT, + GET_WEB_EXPERIENCE as _SCHEMA_GET_WEB_EXPERIENCE, + GET_WEB_EXPERIENCE_INPUT as _SCHEMA_GET_WEB_EXPERIENCE_INPUT, + GET_WEB_EXPERIENCE_OUTPUT as _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT, + GROUP_MEMBERS as _SCHEMA_GROUP_MEMBERS, + GROUP_STATUS_DETAIL as _SCHEMA_GROUP_STATUS_DETAIL, + GROUP_SUMMARY as _SCHEMA_GROUP_SUMMARY, + HALLUCINATION_REDUCTION_CONFIGURATION as _SCHEMA_HALLUCINATION_REDUCTION_CONFIGURATION, + HOOK_CONFIGURATION as _SCHEMA_HOOK_CONFIGURATION, + IDC_AUTH_CONFIGURATION as _SCHEMA_IDC_AUTH_CONFIGURATION, + IDENTITY_PROVIDER_CONFIGURATION as _SCHEMA_IDENTITY_PROVIDER_CONFIGURATION, + IMAGE_EXTRACTION_CONFIGURATION as _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION, + IMAGE_SOURCE_DETAILS as _SCHEMA_IMAGE_SOURCE_DETAILS, + INDEX as _SCHEMA_INDEX, + INDEX_CAPACITY_CONFIGURATION as _SCHEMA_INDEX_CAPACITY_CONFIGURATION, + INDEX_STATISTICS as _SCHEMA_INDEX_STATISTICS, + INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION as _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION, + INSTRUCTION_COLLECTION as _SCHEMA_INSTRUCTION_COLLECTION, + INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, + KENDRA_INDEX_CONFIGURATION as _SCHEMA_KENDRA_INDEX_CONFIGURATION, + LICENSE_NOT_FOUND_EXCEPTION as _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, + LIST_APPLICATIONS as _SCHEMA_LIST_APPLICATIONS, + LIST_APPLICATIONS_INPUT as _SCHEMA_LIST_APPLICATIONS_INPUT, + LIST_APPLICATIONS_OUTPUT as _SCHEMA_LIST_APPLICATIONS_OUTPUT, + LIST_ATTACHMENTS as _SCHEMA_LIST_ATTACHMENTS, + LIST_ATTACHMENTS_INPUT as _SCHEMA_LIST_ATTACHMENTS_INPUT, + LIST_ATTACHMENTS_OUTPUT as _SCHEMA_LIST_ATTACHMENTS_OUTPUT, + LIST_CHAT_RESPONSE_CONFIGURATIONS as _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS, + LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT as _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT, + LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT as _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT, + LIST_CONVERSATIONS as _SCHEMA_LIST_CONVERSATIONS, + LIST_CONVERSATIONS_INPUT as _SCHEMA_LIST_CONVERSATIONS_INPUT, + LIST_CONVERSATIONS_OUTPUT as _SCHEMA_LIST_CONVERSATIONS_OUTPUT, + LIST_DATA_ACCESSORS as _SCHEMA_LIST_DATA_ACCESSORS, + LIST_DATA_ACCESSORS_INPUT as _SCHEMA_LIST_DATA_ACCESSORS_INPUT, + LIST_DATA_ACCESSORS_OUTPUT as _SCHEMA_LIST_DATA_ACCESSORS_OUTPUT, + LIST_DATA_SOURCES as _SCHEMA_LIST_DATA_SOURCES, + LIST_DATA_SOURCES_INPUT as _SCHEMA_LIST_DATA_SOURCES_INPUT, + LIST_DATA_SOURCES_OUTPUT as _SCHEMA_LIST_DATA_SOURCES_OUTPUT, + LIST_DATA_SOURCE_SYNC_JOBS as _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS, + LIST_DATA_SOURCE_SYNC_JOBS_INPUT as _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT, + LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT as _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT, + LIST_DOCUMENTS as _SCHEMA_LIST_DOCUMENTS, + LIST_DOCUMENTS_INPUT as _SCHEMA_LIST_DOCUMENTS_INPUT, + LIST_DOCUMENTS_OUTPUT as _SCHEMA_LIST_DOCUMENTS_OUTPUT, + LIST_GROUPS as _SCHEMA_LIST_GROUPS, + LIST_GROUPS_INPUT as _SCHEMA_LIST_GROUPS_INPUT, + LIST_GROUPS_OUTPUT as _SCHEMA_LIST_GROUPS_OUTPUT, + LIST_INDICES as _SCHEMA_LIST_INDICES, + LIST_INDICES_INPUT as _SCHEMA_LIST_INDICES_INPUT, + LIST_INDICES_OUTPUT as _SCHEMA_LIST_INDICES_OUTPUT, + LIST_MESSAGES as _SCHEMA_LIST_MESSAGES, + LIST_MESSAGES_INPUT as _SCHEMA_LIST_MESSAGES_INPUT, + LIST_MESSAGES_OUTPUT as _SCHEMA_LIST_MESSAGES_OUTPUT, + LIST_PLUGINS as _SCHEMA_LIST_PLUGINS, + LIST_PLUGINS_INPUT as _SCHEMA_LIST_PLUGINS_INPUT, + LIST_PLUGINS_OUTPUT as _SCHEMA_LIST_PLUGINS_OUTPUT, + LIST_PLUGIN_ACTIONS as _SCHEMA_LIST_PLUGIN_ACTIONS, + LIST_PLUGIN_ACTIONS_INPUT as _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT, + LIST_PLUGIN_ACTIONS_OUTPUT as _SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT, + LIST_PLUGIN_TYPE_ACTIONS as _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS, + LIST_PLUGIN_TYPE_ACTIONS_INPUT as _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT, + LIST_PLUGIN_TYPE_ACTIONS_OUTPUT as _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT, + LIST_PLUGIN_TYPE_METADATA as _SCHEMA_LIST_PLUGIN_TYPE_METADATA, + LIST_PLUGIN_TYPE_METADATA_INPUT as _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT, + LIST_PLUGIN_TYPE_METADATA_OUTPUT as _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT, + LIST_RETRIEVERS as _SCHEMA_LIST_RETRIEVERS, + LIST_RETRIEVERS_INPUT as _SCHEMA_LIST_RETRIEVERS_INPUT, + LIST_RETRIEVERS_OUTPUT as _SCHEMA_LIST_RETRIEVERS_OUTPUT, + LIST_SUBSCRIPTIONS as _SCHEMA_LIST_SUBSCRIPTIONS, + LIST_SUBSCRIPTIONS_INPUT as _SCHEMA_LIST_SUBSCRIPTIONS_INPUT, + LIST_SUBSCRIPTIONS_OUTPUT as _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, + LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, + LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, + LIST_WEB_EXPERIENCES as _SCHEMA_LIST_WEB_EXPERIENCES, + LIST_WEB_EXPERIENCES_INPUT as _SCHEMA_LIST_WEB_EXPERIENCES_INPUT, + LIST_WEB_EXPERIENCES_OUTPUT as _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT, + MEDIA_EXTRACTION_CONFIGURATION as _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION, + MEDIA_TOO_LARGE_EXCEPTION as _SCHEMA_MEDIA_TOO_LARGE_EXCEPTION, + MEMBER_GROUP as _SCHEMA_MEMBER_GROUP, + MEMBER_USER as _SCHEMA_MEMBER_USER, + MESSAGE as _SCHEMA_MESSAGE, + MESSAGE_USEFULNESS_FEEDBACK as _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK, + METADATA_EVENT as _SCHEMA_METADATA_EVENT, + NATIVE_INDEX_CONFIGURATION as _SCHEMA_NATIVE_INDEX_CONFIGURATION, + NO_AUTH_CONFIGURATION as _SCHEMA_NO_AUTH_CONFIGURATION, + NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION as _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION, + OPEN_ID_CONNECT_PROVIDER_CONFIGURATION as _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION, + ORCHESTRATION_CONFIGURATION as _SCHEMA_ORCHESTRATION_CONFIGURATION, + O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION as _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION, + PERMISSION_CONDITION as _SCHEMA_PERMISSION_CONDITION, + PERSONALIZATION_CONFIGURATION as _SCHEMA_PERSONALIZATION_CONFIGURATION, + PLUGIN as _SCHEMA_PLUGIN, + PLUGIN_AUTH_CONFIGURATION as _SCHEMA_PLUGIN_AUTH_CONFIGURATION, + PLUGIN_CONFIGURATION as _SCHEMA_PLUGIN_CONFIGURATION, + PLUGIN_TYPE_METADATA_SUMMARY as _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY, + PRINCIPAL as _SCHEMA_PRINCIPAL, + PRINCIPAL_GROUP as _SCHEMA_PRINCIPAL_GROUP, + PRINCIPAL_USER as _SCHEMA_PRINCIPAL_USER, + PUT_FEEDBACK as _SCHEMA_PUT_FEEDBACK, + PUT_FEEDBACK_INPUT as _SCHEMA_PUT_FEEDBACK_INPUT, + PUT_FEEDBACK_OUTPUT as _SCHEMA_PUT_FEEDBACK_OUTPUT, + PUT_GROUP as _SCHEMA_PUT_GROUP, + PUT_GROUP_INPUT as _SCHEMA_PUT_GROUP_INPUT, + PUT_GROUP_OUTPUT as _SCHEMA_PUT_GROUP_OUTPUT, + QUICK_SIGHT_CONFIGURATION as _SCHEMA_QUICK_SIGHT_CONFIGURATION, + Q_APPS_CONFIGURATION as _SCHEMA_Q_APPS_CONFIGURATION, + RELEVANT_CONTENT as _SCHEMA_RELEVANT_CONTENT, + RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + RESPONSE_CONFIGURATION as _SCHEMA_RESPONSE_CONFIGURATION, + RETRIEVER as _SCHEMA_RETRIEVER, + RETRIEVER_CONFIGURATION as _SCHEMA_RETRIEVER_CONFIGURATION, + RETRIEVER_CONTENT_SOURCE as _SCHEMA_RETRIEVER_CONTENT_SOURCE, + RULE as _SCHEMA_RULE, + RULE_CONFIGURATION as _SCHEMA_RULE_CONFIGURATION, + S3 as _SCHEMA_S3, + SAML_CONFIGURATION as _SCHEMA_SAML_CONFIGURATION, + SAML_PROVIDER_CONFIGURATION as _SCHEMA_SAML_PROVIDER_CONFIGURATION, + SCORE_ATTRIBUTES as _SCHEMA_SCORE_ATTRIBUTES, + SEARCH_RELEVANT_CONTENT as _SCHEMA_SEARCH_RELEVANT_CONTENT, + SEARCH_RELEVANT_CONTENT_INPUT as _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT, + SEARCH_RELEVANT_CONTENT_OUTPUT as _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT, + SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SNIPPET_EXCERPT as _SCHEMA_SNIPPET_EXCERPT, + SOURCE_ATTRIBUTION as _SCHEMA_SOURCE_ATTRIBUTION, + SOURCE_DETAILS as _SCHEMA_SOURCE_DETAILS, + START_DATA_SOURCE_SYNC_JOB as _SCHEMA_START_DATA_SOURCE_SYNC_JOB, + START_DATA_SOURCE_SYNC_JOB_INPUT as _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT, + START_DATA_SOURCE_SYNC_JOB_OUTPUT as _SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT, + STOP_DATA_SOURCE_SYNC_JOB as _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB, + STOP_DATA_SOURCE_SYNC_JOB_INPUT as _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT, + STOP_DATA_SOURCE_SYNC_JOB_OUTPUT as _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_OUTPUT, + STRING_ATTRIBUTE_BOOSTING_CONFIGURATION as _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION, + STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION as _SCHEMA_STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION, + SUBSCRIPTION as _SCHEMA_SUBSCRIPTION, + SUBSCRIPTION_DETAILS as _SCHEMA_SUBSCRIPTION_DETAILS, + SUBSCRIPTION_PRINCIPAL as _SCHEMA_SUBSCRIPTION_PRINCIPAL, + TAG as _SCHEMA_TAG, + TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, + TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, + TEXT_DOCUMENT_STATISTICS as _SCHEMA_TEXT_DOCUMENT_STATISTICS, + TEXT_INPUT_EVENT as _SCHEMA_TEXT_INPUT_EVENT, + TEXT_OUTPUT_EVENT as _SCHEMA_TEXT_OUTPUT_EVENT, + TEXT_SEGMENT as _SCHEMA_TEXT_SEGMENT, + THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, + TOPIC_CONFIGURATION as _SCHEMA_TOPIC_CONFIGURATION, + UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, + UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, + UPDATE_APPLICATION as _SCHEMA_UPDATE_APPLICATION, + UPDATE_APPLICATION_INPUT as _SCHEMA_UPDATE_APPLICATION_INPUT, + UPDATE_APPLICATION_OUTPUT as _SCHEMA_UPDATE_APPLICATION_OUTPUT, + UPDATE_CHAT_CONTROLS_CONFIGURATION as _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION, + UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT as _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT, + UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT as _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, + UPDATE_CHAT_RESPONSE_CONFIGURATION as _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION, + UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT as _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT, + UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT as _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + UPDATE_DATA_ACCESSOR as _SCHEMA_UPDATE_DATA_ACCESSOR, + UPDATE_DATA_ACCESSOR_INPUT as _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT, + UPDATE_DATA_ACCESSOR_OUTPUT as _SCHEMA_UPDATE_DATA_ACCESSOR_OUTPUT, + UPDATE_DATA_SOURCE as _SCHEMA_UPDATE_DATA_SOURCE, + UPDATE_DATA_SOURCE_INPUT as _SCHEMA_UPDATE_DATA_SOURCE_INPUT, + UPDATE_DATA_SOURCE_OUTPUT as _SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, + UPDATE_INDEX as _SCHEMA_UPDATE_INDEX, + UPDATE_INDEX_INPUT as _SCHEMA_UPDATE_INDEX_INPUT, + UPDATE_INDEX_OUTPUT as _SCHEMA_UPDATE_INDEX_OUTPUT, + UPDATE_PLUGIN as _SCHEMA_UPDATE_PLUGIN, + UPDATE_PLUGIN_INPUT as _SCHEMA_UPDATE_PLUGIN_INPUT, + UPDATE_PLUGIN_OUTPUT as _SCHEMA_UPDATE_PLUGIN_OUTPUT, + UPDATE_RETRIEVER as _SCHEMA_UPDATE_RETRIEVER, + UPDATE_RETRIEVER_INPUT as _SCHEMA_UPDATE_RETRIEVER_INPUT, + UPDATE_RETRIEVER_OUTPUT as _SCHEMA_UPDATE_RETRIEVER_OUTPUT, + UPDATE_SUBSCRIPTION as _SCHEMA_UPDATE_SUBSCRIPTION, + UPDATE_SUBSCRIPTION_INPUT as _SCHEMA_UPDATE_SUBSCRIPTION_INPUT, + UPDATE_SUBSCRIPTION_OUTPUT as _SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT, + UPDATE_USER as _SCHEMA_UPDATE_USER, + UPDATE_USER_INPUT as _SCHEMA_UPDATE_USER_INPUT, + UPDATE_USER_OUTPUT as _SCHEMA_UPDATE_USER_OUTPUT, + UPDATE_WEB_EXPERIENCE as _SCHEMA_UPDATE_WEB_EXPERIENCE, + UPDATE_WEB_EXPERIENCE_INPUT as _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT, + UPDATE_WEB_EXPERIENCE_OUTPUT as _SCHEMA_UPDATE_WEB_EXPERIENCE_OUTPUT, + USERS_AND_GROUPS as _SCHEMA_USERS_AND_GROUPS, + USER_ALIAS as _SCHEMA_USER_ALIAS, + VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, + VALIDATION_EXCEPTION_FIELD as _SCHEMA_VALIDATION_EXCEPTION_FIELD, + VIDEO_EXTRACTION_CONFIGURATION as _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION, + VIDEO_SOURCE_DETAILS as _SCHEMA_VIDEO_SOURCE_DETAILS, + WEB_EXPERIENCE as _SCHEMA_WEB_EXPERIENCE, + WEB_EXPERIENCE_AUTH_CONFIGURATION as _SCHEMA_WEB_EXPERIENCE_AUTH_CONFIGURATION, +) + + +logger = logging.getLogger(__name__) + + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + + +class MemberRelation(StrEnum): + AND_ = "AND" + OR_ = "OR" + + +class ReadAccessType(StrEnum): + ALLOW = "ALLOW" + DENY = "DENY" + + +class MembershipType(StrEnum): + INDEX = "INDEX" + DATASOURCE = "DATASOURCE" + + +@dataclass(kw_only=True) +class PrincipalGroup: + """Provides information about a group associated with the principal.""" + + access: str + """ + Provides information about whether to allow or deny access to the + principal. + """ + + name: str | None = None + """The name of the group.""" + + membership_type: str | None = None + """The type of group.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PRINCIPAL_GROUP, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.name is not None: + serializer.write_string(_SCHEMA_PRINCIPAL_GROUP.members["name"], self.name) + + serializer.write_string(_SCHEMA_PRINCIPAL_GROUP.members["access"], self.access) + if self.membership_type is not None: + serializer.write_string( + _SCHEMA_PRINCIPAL_GROUP.members["membershipType"], self.membership_type + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["name"] = de.read_string( + _SCHEMA_PRINCIPAL_GROUP.members["name"] + ) + + case 1: + kwargs["access"] = de.read_string( + _SCHEMA_PRINCIPAL_GROUP.members["access"] + ) + + case 2: + kwargs["membership_type"] = de.read_string( + _SCHEMA_PRINCIPAL_GROUP.members["membershipType"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_PRINCIPAL_GROUP, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class PrincipalUser: + """Provides information about a user associated with a principal.""" + + access: str + """ + Provides information about whether to allow or deny access to the + principal. + """ + + id: str | None = None + """The identifier of the user.""" + + membership_type: str | None = None + """The type of group.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PRINCIPAL_USER, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.id is not None: + serializer.write_string(_SCHEMA_PRINCIPAL_USER.members["id"], self.id) + + serializer.write_string(_SCHEMA_PRINCIPAL_USER.members["access"], self.access) + if self.membership_type is not None: + serializer.write_string( + _SCHEMA_PRINCIPAL_USER.members["membershipType"], self.membership_type + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["id"] = de.read_string(_SCHEMA_PRINCIPAL_USER.members["id"]) + + case 1: + kwargs["access"] = de.read_string( + _SCHEMA_PRINCIPAL_USER.members["access"] + ) + + case 2: + kwargs["membership_type"] = de.read_string( + _SCHEMA_PRINCIPAL_USER.members["membershipType"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_PRINCIPAL_USER, consumer=_consumer) + return kwargs + + +@dataclass +class Principal_User: + """The user associated with the principal.""" + + value: PrincipalUser + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PRINCIPAL, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PRINCIPAL.members["user"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=PrincipalUser.deserialize(deserializer)) + + +@dataclass +class Principal_Group: + """The group associated with the principal.""" + + value: PrincipalGroup + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PRINCIPAL, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PRINCIPAL.members["group"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=PrincipalGroup.deserialize(deserializer)) + + +@dataclass +class PrincipalUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +Principal = Union[Principal_User | Principal_Group | PrincipalUnknown] +""" +Provides user and group information used for filtering documents to use +for generating Amazon Q Business conversation responses. +""" + + +class _PrincipalDeserializer: + _result: Principal | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> Principal: + self._result = None + deserializer.read_struct(_SCHEMA_PRINCIPAL, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(Principal_User.deserialize(de)) + + case 1: + self._set_result(Principal_Group.deserialize(de)) + + case _: + self._set_result(PrincipalUnknown(tag=schema.expect_member_name())) + + def _set_result(self, value: Principal) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +def _serialize_principals( + serializer: ShapeSerializer, schema: Schema, value: list[Principal] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_principals( + deserializer: ShapeDeserializer, schema: Schema +) -> list[Principal]: + result: list[Principal] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(_PrincipalDeserializer().deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class AccessControl: + """ + A list of principals. Each principal can be either a `USER` or a `GROUP` + and can be designated document access permissions of either `ALLOW` or + `DENY`. + """ + + principals: list[Principal] + """ + Contains a list of principals, where a principal can be either a `USER` + or a `GROUP`. Each principal can be have the following type of document + access: `ALLOW` or `DENY`. + """ + + member_relation: str | None = None + """Describes the member relation within a principal list.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACCESS_CONTROL, self) + + def serialize_members(self, serializer: ShapeSerializer): + _serialize_principals( + serializer, _SCHEMA_ACCESS_CONTROL.members["principals"], self.principals + ) + if self.member_relation is not None: + serializer.write_string( + _SCHEMA_ACCESS_CONTROL.members["memberRelation"], self.member_relation + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["principals"] = _deserialize_principals( + de, _SCHEMA_ACCESS_CONTROL.members["principals"] + ) + + case 1: + kwargs["member_relation"] = de.read_string( + _SCHEMA_ACCESS_CONTROL.members["memberRelation"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ACCESS_CONTROL, consumer=_consumer) + return kwargs + + +def _serialize_access_controls( + serializer: ShapeSerializer, schema: Schema, value: list[AccessControl] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_access_controls( + deserializer: ShapeDeserializer, schema: Schema +) -> list[AccessControl]: + result: list[AccessControl] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(AccessControl.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class AccessConfiguration: + """Used to configure access permissions for a document.""" + + access_controls: list[AccessControl] + """A list of `AccessControlList` objects.""" + + member_relation: str | None = None + """Describes the member relation within the `AccessControlList` object.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACCESS_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + _serialize_access_controls( + serializer, + _SCHEMA_ACCESS_CONFIGURATION.members["accessControls"], + self.access_controls, + ) + if self.member_relation is not None: + serializer.write_string( + _SCHEMA_ACCESS_CONFIGURATION.members["memberRelation"], + self.member_relation, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["access_controls"] = _deserialize_access_controls( + de, _SCHEMA_ACCESS_CONFIGURATION.members["accessControls"] + ) + + case 1: + kwargs["member_relation"] = de.read_string( + _SCHEMA_ACCESS_CONFIGURATION.members["memberRelation"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ACCESS_CONFIGURATION, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError): + """ + You don't have access to perform this action. Make sure you have the + required permission policies and user accounts and try again. + """ + + fault: Literal["client", "server"] | None = "client" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string( + _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) + return kwargs + + +def _serialize_document_attribute_string_list_value( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_document_attribute_string_list_value( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass +class DocumentAttributeValueStringValue: + """A string.""" + + value: str + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["stringValue"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls( + value=deserializer.read_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["stringValue"] + ) + ) + + +@dataclass +class DocumentAttributeValueStringListValue: + """A list of strings.""" + + value: list[str] + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, self) + + def serialize_members(self, serializer: ShapeSerializer): + _serialize_document_attribute_string_list_value( + serializer, + _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["stringListValue"], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls( + value=_deserialize_document_attribute_string_list_value( + deserializer, + _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["stringListValue"], + ) + ) + + +@dataclass +class DocumentAttributeValueLongValue: + """A long integer value.""" + + value: int + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_long( + _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["longValue"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls( + value=deserializer.read_long( + _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["longValue"] + ) + ) + + +@dataclass +class DocumentAttributeValueDateValue: + """ + A date expressed as an ISO 8601 string. + + It's important for the time zone to be included in the ISO 8601 + date-time format. For example, 2012-03-25T12:30:10+01:00 is the ISO 8601 + date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in + Central European Time. + """ + + value: datetime + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_timestamp( + _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["dateValue"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls( + value=deserializer.read_timestamp( + _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["dateValue"] + ) + ) + + +@dataclass +class DocumentAttributeValueUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +DocumentAttributeValue = Union[ + DocumentAttributeValueStringValue + | DocumentAttributeValueStringListValue + | DocumentAttributeValueLongValue + | DocumentAttributeValueDateValue + | DocumentAttributeValueUnknown +] +""" +The value of a document attribute. You can only provide one value for a +document attribute. +""" + + +class _DocumentAttributeValueDeserializer: + _result: DocumentAttributeValue | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> DocumentAttributeValue: + self._result = None + deserializer.read_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(DocumentAttributeValueStringValue.deserialize(de)) + + case 1: + self._set_result(DocumentAttributeValueStringListValue.deserialize(de)) + + case 2: + self._set_result(DocumentAttributeValueLongValue.deserialize(de)) + + case 3: + self._set_result(DocumentAttributeValueDateValue.deserialize(de)) + + case _: + self._set_result( + DocumentAttributeValueUnknown(tag=schema.expect_member_name()) + ) + + def _set_result(self, value: DocumentAttributeValue) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +@dataclass(kw_only=True) +class DocumentAttribute: + """A document attribute or metadata field.""" + + name: str + """The identifier for the attribute.""" + + value: DocumentAttributeValue + """The value of the attribute.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string(_SCHEMA_DOCUMENT_ATTRIBUTE.members["name"], self.name) + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE.members["value"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["name"] = de.read_string( + _SCHEMA_DOCUMENT_ATTRIBUTE.members["name"] + ) + + case 1: + kwargs["value"] = _DocumentAttributeValueDeserializer().deserialize( + de + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DOCUMENT_ATTRIBUTE, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ActionExecutionPayloadField: + """A user input field in an plugin action execution payload.""" + + value: _Document + """The content of a user input field in an plugin action execution payload.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACTION_EXECUTION_PAYLOAD_FIELD, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_document( + _SCHEMA_ACTION_EXECUTION_PAYLOAD_FIELD.members["value"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["value"] = de.read_document( + _SCHEMA_ACTION_EXECUTION_PAYLOAD_FIELD.members["value"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_ACTION_EXECUTION_PAYLOAD_FIELD, consumer=_consumer + ) + return kwargs + + +def _serialize_action_execution_payload( + serializer: ShapeSerializer, + schema: Schema, + value: dict[str, ActionExecutionPayloadField], +) -> None: + with serializer.begin_map(schema, len(value)) as m: + value_schema = schema.members["value"] + for k, v in value.items(): + m.entry(k, lambda vs: vs.write_struct(value_schema, v)) + + +def _deserialize_action_execution_payload( + deserializer: ShapeDeserializer, schema: Schema +) -> dict[str, ActionExecutionPayloadField]: + result: dict[str, ActionExecutionPayloadField] = {} + value_schema = schema.members["value"] + + def _read_value(k: str, d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result[k] = ActionExecutionPayloadField.deserialize(d) + + deserializer.read_map(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ActionExecution: + """ + Performs an Amazon Q Business plugin action during a non-streaming chat + conversation. + """ + + plugin_id: str + """The identifier of the plugin the action is attached to.""" + + payload: dict[str, ActionExecutionPayloadField] + """ + A mapping of field names to the field values in input that an end user + provides to Amazon Q Business requests to perform their plugin action. + """ + + payload_field_name_separator: str + """ + A string used to retain information about the hierarchical contexts + within an action execution event payload. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACTION_EXECUTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_ACTION_EXECUTION.members["pluginId"], self.plugin_id + ) + _serialize_action_execution_payload( + serializer, _SCHEMA_ACTION_EXECUTION.members["payload"], self.payload + ) + serializer.write_string( + _SCHEMA_ACTION_EXECUTION.members["payloadFieldNameSeparator"], + self.payload_field_name_separator, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_ACTION_EXECUTION.members["pluginId"] + ) + + case 1: + kwargs["payload"] = _deserialize_action_execution_payload( + de, _SCHEMA_ACTION_EXECUTION.members["payload"] + ) + + case 2: + kwargs["payload_field_name_separator"] = de.read_string( + _SCHEMA_ACTION_EXECUTION.members["payloadFieldNameSeparator"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ACTION_EXECUTION, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ActionExecutionEvent: + """ + A request from an end user signalling an intent to perform an Amazon Q + Business plugin action during a streaming chat. + """ + + plugin_id: str + """The identifier of the plugin for which the action is being requested.""" + + payload: dict[str, ActionExecutionPayloadField] + """ + A mapping of field names to the field values in input that an end user + provides to Amazon Q Business requests to perform their plugin action. + """ + + payload_field_name_separator: str + """ + A string used to retain information about the hierarchical contexts + within a action execution event payload. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACTION_EXECUTION_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_ACTION_EXECUTION_EVENT.members["pluginId"], self.plugin_id + ) + _serialize_action_execution_payload( + serializer, _SCHEMA_ACTION_EXECUTION_EVENT.members["payload"], self.payload + ) + serializer.write_string( + _SCHEMA_ACTION_EXECUTION_EVENT.members["payloadFieldNameSeparator"], + self.payload_field_name_separator, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_ACTION_EXECUTION_EVENT.members["pluginId"] + ) + + case 1: + kwargs["payload"] = _deserialize_action_execution_payload( + de, _SCHEMA_ACTION_EXECUTION_EVENT.members["payload"] + ) + + case 2: + kwargs["payload_field_name_separator"] = de.read_string( + _SCHEMA_ACTION_EXECUTION_EVENT.members[ + "payloadFieldNameSeparator" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ACTION_EXECUTION_EVENT, consumer=_consumer) + return kwargs + + +class ActionPayloadFieldType(StrEnum): + STRING = "STRING" + NUMBER = "NUMBER" + ARRAY = "ARRAY" + BOOLEAN = "BOOLEAN" + + +@dataclass(kw_only=True) +class ActionReviewPayloadFieldAllowedValue: + """ + Information about the field values that an end user can use to provide + to Amazon Q Business for Amazon Q Business to perform the requested + plugin action. + """ + + value: _Document | None = None + """The field value.""" + + display_value: _Document | None = None + """The name of the field.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.value is not None: + serializer.write_document( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE.members["value"], + self.value, + ) + + if self.display_value is not None: + serializer.write_document( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE.members[ + "displayValue" + ], + self.display_value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["value"] = de.read_document( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE.members[ + "value" + ] + ) + + case 1: + kwargs["display_value"] = de.read_document( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE.members[ + "displayValue" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE, consumer=_consumer + ) + return kwargs + + +def _serialize_action_review_payload_field_allowed_values( + serializer: ShapeSerializer, + schema: Schema, + value: list[ActionReviewPayloadFieldAllowedValue], +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_action_review_payload_field_allowed_values( + deserializer: ShapeDeserializer, schema: Schema +) -> list[ActionReviewPayloadFieldAllowedValue]: + result: list[ActionReviewPayloadFieldAllowedValue] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(ActionReviewPayloadFieldAllowedValue.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ActionReviewPayloadField: + """A user input field in an plugin action review payload.""" + + display_name: str | None = None + """The name of the field.""" + + display_order: int | None = None + """The display order of fields in a payload.""" + + display_description: str | None = None + """ + The field level description of each action review input field. This + could be an explanation of the field. In the Amazon Q Business web + experience, these descriptions could be used to display as tool tips to + help users understand the field. + """ + + type: str | None = None + """The type of field.""" + + value: _Document | None = None + """The field value.""" + + allowed_values: list[ActionReviewPayloadFieldAllowedValue] | None = None + """ + Information about the field values that an end user can use to provide + to Amazon Q Business for Amazon Q Business to perform the requested + plugin action. + """ + + allowed_format: str | None = None + """ + The expected data format for the action review input field value. For + example, in PTO request, `from` and `to` would be of `datetime` allowed + format. + """ + + array_item_json_schema: _Document | None = None + """ + Use to create a custom form with array fields (fields with nested + objects inside an array). + """ + + required: bool | None = None + """Information about whether the field is required.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.display_name is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["displayName"], + self.display_name, + ) + + if self.display_order is not None: + serializer.write_integer( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["displayOrder"], + self.display_order, + ) + + if self.display_description is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["displayDescription"], + self.display_description, + ) + + if self.type is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["type"], self.type + ) + + if self.value is not None: + serializer.write_document( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["value"], self.value + ) + + if self.allowed_values is not None: + _serialize_action_review_payload_field_allowed_values( + serializer, + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["allowedValues"], + self.allowed_values, + ) + + if self.allowed_format is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["allowedFormat"], + self.allowed_format, + ) + + if self.array_item_json_schema is not None: + serializer.write_document( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["arrayItemJsonSchema"], + self.array_item_json_schema, + ) + + if self.required is not None: + serializer.write_boolean( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["required"], self.required + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["display_name"] = de.read_string( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["displayName"] + ) + + case 1: + kwargs["display_order"] = de.read_integer( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["displayOrder"] + ) + + case 2: + kwargs["display_description"] = de.read_string( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members[ + "displayDescription" + ] + ) + + case 3: + kwargs["type"] = de.read_string( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["type"] + ) + + case 4: + kwargs["value"] = de.read_document( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["value"] + ) + + case 5: + kwargs["allowed_values"] = ( + _deserialize_action_review_payload_field_allowed_values( + de, + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members[ + "allowedValues" + ], + ) + ) + + case 6: + kwargs["allowed_format"] = de.read_string( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["allowedFormat"] + ) + + case 7: + kwargs["array_item_json_schema"] = de.read_document( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members[ + "arrayItemJsonSchema" + ] + ) + + case 8: + kwargs["required"] = de.read_boolean( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["required"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD, consumer=_consumer + ) + return kwargs + + +def _serialize_action_review_payload( + serializer: ShapeSerializer, + schema: Schema, + value: dict[str, ActionReviewPayloadField], +) -> None: + with serializer.begin_map(schema, len(value)) as m: + value_schema = schema.members["value"] + for k, v in value.items(): + m.entry(k, lambda vs: vs.write_struct(value_schema, v)) + + +def _deserialize_action_review_payload( + deserializer: ShapeDeserializer, schema: Schema +) -> dict[str, ActionReviewPayloadField]: + result: dict[str, ActionReviewPayloadField] = {} + value_schema = schema.members["value"] + + def _read_value(k: str, d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result[k] = ActionReviewPayloadField.deserialize(d) + + deserializer.read_map(schema, _read_value) + return result + + +class PluginType(StrEnum): + SERVICE_NOW = "SERVICE_NOW" + SALESFORCE = "SALESFORCE" + JIRA = "JIRA" + ZENDESK = "ZENDESK" + CUSTOM = "CUSTOM" + QUICKSIGHT = "QUICKSIGHT" + SERVICENOW_NOW_PLATFORM = "SERVICENOW_NOW_PLATFORM" + JIRA_CLOUD = "JIRA_CLOUD" + SALESFORCE_CRM = "SALESFORCE_CRM" + ZENDESK_SUITE = "ZENDESK_SUITE" + ATLASSIAN_CONFLUENCE = "ATLASSIAN_CONFLUENCE" + GOOGLE_CALENDAR = "GOOGLE_CALENDAR" + MICROSOFT_TEAMS = "MICROSOFT_TEAMS" + MICROSOFT_EXCHANGE = "MICROSOFT_EXCHANGE" + PAGERDUTY_ADVANCE = "PAGERDUTY_ADVANCE" + SMARTSHEET = "SMARTSHEET" + ASANA = "ASANA" + + +@dataclass(kw_only=True) +class ActionReview: + """ + An output event that Amazon Q Business returns to an user who wants to + perform a plugin action during a non-streaming chat conversation. It + contains information about the selected action with a list of possible + user input fields, some pre-populated by Amazon Q Business. + """ + + plugin_id: str | None = None + """The identifier of the plugin associated with the action review.""" + + plugin_type: str | None = None + """The type of plugin.""" + + payload: dict[str, ActionReviewPayloadField] | None = None + """ + Field values that an end user needs to provide to Amazon Q Business for + Amazon Q Business to perform the requested plugin action. + """ + + payload_field_name_separator: str | None = None + """ + A string used to retain information about the hierarchical contexts + within an action review payload. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACTION_REVIEW, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.plugin_id is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW.members["pluginId"], self.plugin_id + ) + + if self.plugin_type is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW.members["pluginType"], self.plugin_type + ) + + if self.payload is not None: + _serialize_action_review_payload( + serializer, _SCHEMA_ACTION_REVIEW.members["payload"], self.payload + ) + + if self.payload_field_name_separator is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW.members["payloadFieldNameSeparator"], + self.payload_field_name_separator, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_ACTION_REVIEW.members["pluginId"] + ) + + case 1: + kwargs["plugin_type"] = de.read_string( + _SCHEMA_ACTION_REVIEW.members["pluginType"] + ) + + case 2: + kwargs["payload"] = _deserialize_action_review_payload( + de, _SCHEMA_ACTION_REVIEW.members["payload"] + ) + + case 3: + kwargs["payload_field_name_separator"] = de.read_string( + _SCHEMA_ACTION_REVIEW.members["payloadFieldNameSeparator"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ACTION_REVIEW, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ActionReviewEvent: + """ + An output event that Amazon Q Business returns to an user who wants to + perform a plugin action during a streaming chat conversation. It + contains information about the selected action with a list of possible + user input fields, some pre-populated by Amazon Q Business. + """ + + conversation_id: str | None = None + """ + The identifier of the conversation with which the action review event is + associated. + """ + + user_message_id: str | None = None + """ + The identifier of the conversation with which the plugin action is + associated. + """ + + system_message_id: str | None = None + """ + The identifier of an Amazon Q Business AI generated associated with the + action review event. + """ + + plugin_id: str | None = None + """The identifier of the plugin associated with the action review event.""" + + plugin_type: str | None = None + """The type of plugin.""" + + payload: dict[str, ActionReviewPayloadField] | None = None + """ + Field values that an end user needs to provide to Amazon Q Business for + Amazon Q Business to perform the requested plugin action. + """ + + payload_field_name_separator: str | None = None + """ + A string used to retain information about the hierarchical contexts + within an action review event payload. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACTION_REVIEW_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["conversationId"], + self.conversation_id, + ) + + if self.user_message_id is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["userMessageId"], + self.user_message_id, + ) + + if self.system_message_id is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["systemMessageId"], + self.system_message_id, + ) + + if self.plugin_id is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["pluginId"], self.plugin_id + ) + + if self.plugin_type is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["pluginType"], self.plugin_type + ) + + if self.payload is not None: + _serialize_action_review_payload( + serializer, _SCHEMA_ACTION_REVIEW_EVENT.members["payload"], self.payload + ) + + if self.payload_field_name_separator is not None: + serializer.write_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["payloadFieldNameSeparator"], + self.payload_field_name_separator, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["conversationId"] + ) + + case 1: + kwargs["user_message_id"] = de.read_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["userMessageId"] + ) + + case 2: + kwargs["system_message_id"] = de.read_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["systemMessageId"] + ) + + case 3: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["pluginId"] + ) + + case 4: + kwargs["plugin_type"] = de.read_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["pluginType"] + ) + + case 5: + kwargs["payload"] = _deserialize_action_review_payload( + de, _SCHEMA_ACTION_REVIEW_EVENT.members["payload"] + ) + + case 6: + kwargs["payload_field_name_separator"] = de.read_string( + _SCHEMA_ACTION_REVIEW_EVENT.members["payloadFieldNameSeparator"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ACTION_REVIEW_EVENT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ActionSummary: + """Summary information for an Amazon Q Business plugin action.""" + + action_identifier: str | None = None + """The identifier of an Amazon Q Business plugin action.""" + + display_name: str | None = None + """ + The display name assigned by Amazon Q Business to a plugin action. You + can't modify this value. + """ + + instruction_example: str | None = None + """ + An Amazon Q Business suggested prompt and end user can use to invoke a + plugin action. This value can be modified and sent as input to initiate + an action. For example: + + - Create a Jira task + + - Create a chat assistant task to find the root cause of a specific + incident + """ + + description: str | None = None + """The description of an Amazon Q Business plugin action.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACTION_SUMMARY, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.action_identifier is not None: + serializer.write_string( + _SCHEMA_ACTION_SUMMARY.members["actionIdentifier"], + self.action_identifier, + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_ACTION_SUMMARY.members["displayName"], self.display_name + ) + + if self.instruction_example is not None: + serializer.write_string( + _SCHEMA_ACTION_SUMMARY.members["instructionExample"], + self.instruction_example, + ) + + if self.description is not None: + serializer.write_string( + _SCHEMA_ACTION_SUMMARY.members["description"], self.description + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["action_identifier"] = de.read_string( + _SCHEMA_ACTION_SUMMARY.members["actionIdentifier"] + ) + + case 1: + kwargs["display_name"] = de.read_string( + _SCHEMA_ACTION_SUMMARY.members["displayName"] + ) + + case 2: + kwargs["instruction_example"] = de.read_string( + _SCHEMA_ACTION_SUMMARY.members["instructionExample"] + ) + + case 3: + kwargs["description"] = de.read_string( + _SCHEMA_ACTION_SUMMARY.members["description"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ACTION_SUMMARY, consumer=_consumer) + return kwargs + + +def _serialize_actions( + serializer: ShapeSerializer, schema: Schema, value: list[ActionSummary] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_actions( + deserializer: ShapeDeserializer, schema: Schema +) -> list[ActionSummary]: + result: list[ActionSummary] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(ActionSummary.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class S3: + """ + Information required for Amazon Q Business to find a specific file in an + Amazon S3 bucket. + """ + + bucket: str + """The name of the S3 bucket that contains the file.""" + + key: str + """The name of the file.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_S3, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string(_SCHEMA_S3.members["bucket"], self.bucket) + serializer.write_string(_SCHEMA_S3.members["key"], self.key) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["bucket"] = de.read_string(_SCHEMA_S3.members["bucket"]) + + case 1: + kwargs["key"] = de.read_string(_SCHEMA_S3.members["key"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_S3, consumer=_consumer) + return kwargs + + +@dataclass +class APISchemaPayload: + """ + The JSON or YAML-formatted payload defining the OpenAPI schema for a + custom plugin. + """ + + value: str + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_API_SCHEMA, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string(_SCHEMA_API_SCHEMA.members["payload"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls( + value=deserializer.read_string(_SCHEMA_API_SCHEMA.members["payload"]) + ) + + +@dataclass +class APISchemaS3: + """ + Contains details about the S3 object containing the OpenAPI schema for a + custom plugin. The schema could be in either JSON or YAML format. + """ + + value: S3 + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_API_SCHEMA, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_API_SCHEMA.members["s3"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=S3.deserialize(deserializer)) + + +@dataclass +class APISchemaUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +APISchema = Union[APISchemaPayload | APISchemaS3 | APISchemaUnknown] +""" +Contains details about the OpenAPI schema for a custom plugin. For more +information, see [custom plugin OpenAPI +schemas](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/custom-plugin.html#plugins-api-schema). +You can either include the schema directly in the payload field or you +can upload it to an S3 bucket and specify the S3 bucket location in the +`s3` field. +""" + + +class _APISchemaDeserializer: + _result: APISchema | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> APISchema: + self._result = None + deserializer.read_struct(_SCHEMA_API_SCHEMA, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(APISchemaPayload.deserialize(de)) + + case 1: + self._set_result(APISchemaS3.deserialize(de)) + + case _: + self._set_result(APISchemaUnknown(tag=schema.expect_member_name())) + + def _set_result(self, value: APISchema) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +class APISchemaType(StrEnum): + OPEN_API_V3 = "OPEN_API_V3" + + +class IdentityType(StrEnum): + AWS_IAM_IDP_SAML = "AWS_IAM_IDP_SAML" + AWS_IAM_IDP_OIDC = "AWS_IAM_IDP_OIDC" + AWS_IAM_IDC = "AWS_IAM_IDC" + AWS_QUICKSIGHT_IDP = "AWS_QUICKSIGHT_IDP" + ANONYMOUS = "ANONYMOUS" + + +@dataclass(kw_only=True) +class QuickSightConfiguration: + """ + The Amazon Quick Suite configuration for an Amazon Q Business + application that uses Quick Suite as the identity provider. For more + information, see [Creating an Amazon Quick Suite integrated + application](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/create-quicksight-integrated-application.html). + """ + + client_namespace: str + """ + The Amazon Quick Suite namespace that is used as the identity provider. + For more information about Quick Suite namespaces, see [Namespace + operations](https://docs.aws.amazon.com/quicksight/latest/developerguide/namespace-operations.html). + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_QUICK_SIGHT_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_QUICK_SIGHT_CONFIGURATION.members["clientNamespace"], + self.client_namespace, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["client_namespace"] = de.read_string( + _SCHEMA_QUICK_SIGHT_CONFIGURATION.members["clientNamespace"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_QUICK_SIGHT_CONFIGURATION, consumer=_consumer) + return kwargs + + +class ApplicationStatus(StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + FAILED = "FAILED" + UPDATING = "UPDATING" + + +@dataclass(kw_only=True) +class Application: + """Summary information for an Amazon Q Business application.""" + + display_name: str | None = None + """The name of the Amazon Q Business application.""" + + application_id: str | None = None + """The identifier for the Amazon Q Business application.""" + + created_at: datetime | None = None + """The Unix timestamp when the Amazon Q Business application was created.""" + + updated_at: datetime | None = None + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + + status: str | None = None + """ + The status of the Amazon Q Business application. The application is + ready to use when the status is `ACTIVE`. + """ + + identity_type: str | None = None + """The authentication type being used by a Amazon Q Business application.""" + + quick_sight_configuration: QuickSightConfiguration | None = None + """ + The Amazon Quick Suite configuration for an Amazon Q Business + application that uses Quick Suite as the identity provider. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_APPLICATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.display_name is not None: + serializer.write_string( + _SCHEMA_APPLICATION.members["displayName"], self.display_name + ) + + if self.application_id is not None: + serializer.write_string( + _SCHEMA_APPLICATION.members["applicationId"], self.application_id + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_APPLICATION.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_APPLICATION.members["updatedAt"], self.updated_at + ) + + if self.status is not None: + serializer.write_string(_SCHEMA_APPLICATION.members["status"], self.status) + + if self.identity_type is not None: + serializer.write_string( + _SCHEMA_APPLICATION.members["identityType"], self.identity_type + ) + + if self.quick_sight_configuration is not None: + serializer.write_struct( + _SCHEMA_APPLICATION.members["quickSightConfiguration"], + self.quick_sight_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["display_name"] = de.read_string( + _SCHEMA_APPLICATION.members["displayName"] + ) + + case 1: + kwargs["application_id"] = de.read_string( + _SCHEMA_APPLICATION.members["applicationId"] + ) + + case 2: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_APPLICATION.members["createdAt"] + ) + + case 3: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_APPLICATION.members["updatedAt"] + ) + + case 4: + kwargs["status"] = de.read_string( + _SCHEMA_APPLICATION.members["status"] + ) + + case 5: + kwargs["identity_type"] = de.read_string( + _SCHEMA_APPLICATION.members["identityType"] + ) + + case 6: + kwargs["quick_sight_configuration"] = ( + QuickSightConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_APPLICATION, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ConflictException(ServiceError): + """ + You are trying to perform an action that conflicts with the current + status of your resource. Fix any inconsistencies with your resources and + try again. + """ + + fault: Literal["client", "server"] | None = "client" + + resource_id: str + """The identifier of the resource affected.""" + + resource_type: str + """The type of the resource affected.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message + ) + serializer.write_string( + _SCHEMA_CONFLICT_EXCEPTION.members["resourceId"], self.resource_id + ) + serializer.write_string( + _SCHEMA_CONFLICT_EXCEPTION.members["resourceType"], self.resource_type + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string( + _SCHEMA_CONFLICT_EXCEPTION.members["message"] + ) + + case 1: + kwargs["resource_id"] = de.read_string( + _SCHEMA_CONFLICT_EXCEPTION.members["resourceId"] + ) + + case 2: + kwargs["resource_type"] = de.read_string( + _SCHEMA_CONFLICT_EXCEPTION.members["resourceType"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) + return kwargs + + +class AttachmentsControlMode(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +@dataclass(kw_only=True) +class AttachmentsConfiguration: + """Configuration information for the file upload during chat feature.""" + + attachments_control_mode: str + """ + Status information about whether file upload functionality is activated + or deactivated for your end user. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ATTACHMENTS_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_ATTACHMENTS_CONFIGURATION.members["attachmentsControlMode"], + self.attachments_control_mode, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["attachments_control_mode"] = de.read_string( + _SCHEMA_ATTACHMENTS_CONFIGURATION.members[ + "attachmentsControlMode" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ATTACHMENTS_CONFIGURATION, consumer=_consumer) + return kwargs + + +def _serialize_client_ids_for_oidc( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_client_ids_for_oidc( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class EncryptionConfiguration: + """ + Provides the identifier of the KMS key used to encrypt data indexed by + Amazon Q Business. Amazon Q Business doesn't support asymmetric keys. + """ + + kms_key_id: str | None = field(repr=False, default=None) + """ + The identifier of the KMS key. Amazon Q Business doesn't support + asymmetric keys. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ENCRYPTION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.kms_key_id is not None: + serializer.write_string( + _SCHEMA_ENCRYPTION_CONFIGURATION.members["kmsKeyId"], self.kms_key_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["kms_key_id"] = de.read_string( + _SCHEMA_ENCRYPTION_CONFIGURATION.members["kmsKeyId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ENCRYPTION_CONFIGURATION, consumer=_consumer) + return kwargs + + +class PersonalizationControlMode(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +@dataclass(kw_only=True) +class PersonalizationConfiguration: + """ + Configuration information about chat response personalization. For more + information, see [Personalizing chat + responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html). + """ + + personalization_control_mode: str + """ + An option to allow Amazon Q Business to customize chat responses using + user specific metadata---specifically, location and job information---in + your IAM Identity Center instance. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PERSONALIZATION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_PERSONALIZATION_CONFIGURATION.members["personalizationControlMode"], + self.personalization_control_mode, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["personalization_control_mode"] = de.read_string( + _SCHEMA_PERSONALIZATION_CONFIGURATION.members[ + "personalizationControlMode" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_PERSONALIZATION_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class QAppsControlMode(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +@dataclass(kw_only=True) +class QAppsConfiguration: + """Configuration information about Amazon Q Apps.""" + + q_apps_control_mode: str + """ + Status information about whether end users can create and use Amazon Q + Apps in the web experience. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_Q_APPS_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_Q_APPS_CONFIGURATION.members["qAppsControlMode"], + self.q_apps_control_mode, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["q_apps_control_mode"] = de.read_string( + _SCHEMA_Q_APPS_CONFIGURATION.members["qAppsControlMode"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_Q_APPS_CONFIGURATION, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class Tag: + """ + A list of key/value pairs that identify an index, FAQ, or data source. + Tag keys and values can consist of Unicode letters, digits, white space, + and any of the following symbols: _ . : / = + - @. + """ + + key: str + """ + The key for the tag. Keys are not case sensitive and must be unique for + the Amazon Q Business application or data source. + """ + + value: str + """ + The value associated with the tag. The value may be an empty string but + it can't be null. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_TAG, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string(_SCHEMA_TAG.members["key"], self.key) + serializer.write_string(_SCHEMA_TAG.members["value"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["key"] = de.read_string(_SCHEMA_TAG.members["key"]) + + case 1: + kwargs["value"] = de.read_string(_SCHEMA_TAG.members["value"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) + return kwargs + + +def _serialize_tags( + serializer: ShapeSerializer, schema: Schema, value: list[Tag] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_tags(deserializer: ShapeDeserializer, schema: Schema) -> list[Tag]: + result: list[Tag] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(Tag.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class CreateApplicationInput: + """Dataclass for CreateApplicationInput structure.""" + + display_name: str | None = None + """A name for the Amazon Q Business application.""" + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of an IAM role with permissions to access + your Amazon CloudWatch logs and metrics. If this property is not + specified, Amazon Q Business will create a [service linked role + (SLR)](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/using-service-linked-roles.html#slr-permissions) + and use it as the application's role. + """ + + identity_type: str | None = None + """The authentication type being used by a Amazon Q Business application.""" + + iam_identity_provider_arn: str | None = None + """ + The Amazon Resource Name (ARN) of an identity provider being used by an + Amazon Q Business application. + """ + + identity_center_instance_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the IAM Identity Center instance you + are either creating for---or connecting to---your Amazon Q Business + application. + """ + + client_ids_for_oidc: list[str] | None = None + """The OIDC client ID for a Amazon Q Business application.""" + + description: str | None = None + """A description for the Amazon Q Business application.""" + + encryption_configuration: EncryptionConfiguration | None = None + """ + The identifier of the KMS key that is used to encrypt your data. Amazon + Q Business doesn't support asymmetric keys. + """ + + tags: list[Tag] | None = None + """ + A list of key-value pairs that identify or categorize your Amazon Q + Business application. You can also use tags to help control access to + the application. Tag keys and values can consist of Unicode letters, + digits, white space, and any of the following symbols: _ . : / = + - @. + """ + + client_token: str | None = None + """ + A token that you provide to identify the request to create your Amazon Q + Business application. + """ + + attachments_configuration: AttachmentsConfiguration | None = None + """An option to allow end users to upload files directly during chat.""" + + q_apps_configuration: QAppsConfiguration | None = None + """ + An option to allow end users to create and use Amazon Q Apps in the web + experience. + """ + + personalization_configuration: PersonalizationConfiguration | None = None + """ + Configuration information about chat response personalization. For more + information, see [Personalizing chat + responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html) + """ + + quick_sight_configuration: QuickSightConfiguration | None = None + """ + The Amazon Quick Suite configuration for an Amazon Q Business + application that uses Quick Suite for authentication. This configuration + is required if your application uses Quick Suite as the identity + provider. For more information, see [Creating an Amazon Quick Suite + integrated + application](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/create-quicksight-integrated-application.html). + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_APPLICATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.display_name is not None: + serializer.write_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["displayName"], + self.display_name, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["roleArn"], self.role_arn + ) + + if self.identity_type is not None: + serializer.write_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["identityType"], + self.identity_type, + ) + + if self.iam_identity_provider_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["iamIdentityProviderArn"], + self.iam_identity_provider_arn, + ) + + if self.identity_center_instance_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["identityCenterInstanceArn"], + self.identity_center_instance_arn, + ) + + if self.client_ids_for_oidc is not None: + _serialize_client_ids_for_oidc( + serializer, + _SCHEMA_CREATE_APPLICATION_INPUT.members["clientIdsForOIDC"], + self.client_ids_for_oidc, + ) + + if self.description is not None: + serializer.write_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["description"], + self.description, + ) + + if self.encryption_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_APPLICATION_INPUT.members["encryptionConfiguration"], + self.encryption_configuration, + ) + + if self.tags is not None: + _serialize_tags( + serializer, _SCHEMA_CREATE_APPLICATION_INPUT.members["tags"], self.tags + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["clientToken"], + self.client_token, + ) + + if self.attachments_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_APPLICATION_INPUT.members["attachmentsConfiguration"], + self.attachments_configuration, + ) + + if self.q_apps_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_APPLICATION_INPUT.members["qAppsConfiguration"], + self.q_apps_configuration, + ) + + if self.personalization_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_APPLICATION_INPUT.members[ + "personalizationConfiguration" + ], + self.personalization_configuration, + ) + + if self.quick_sight_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_APPLICATION_INPUT.members["quickSightConfiguration"], + self.quick_sight_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["display_name"] = de.read_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["displayName"] + ) + + case 1: + kwargs["role_arn"] = de.read_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["roleArn"] + ) + + case 2: + kwargs["identity_type"] = de.read_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["identityType"] + ) + + case 3: + kwargs["iam_identity_provider_arn"] = de.read_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members[ + "iamIdentityProviderArn" + ] + ) + + case 4: + kwargs["identity_center_instance_arn"] = de.read_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members[ + "identityCenterInstanceArn" + ] + ) + + case 5: + kwargs["client_ids_for_oidc"] = _deserialize_client_ids_for_oidc( + de, _SCHEMA_CREATE_APPLICATION_INPUT.members["clientIdsForOIDC"] + ) + + case 6: + kwargs["description"] = de.read_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["description"] + ) + + case 7: + kwargs["encryption_configuration"] = ( + EncryptionConfiguration.deserialize(de) + ) + + case 8: + kwargs["tags"] = _deserialize_tags( + de, _SCHEMA_CREATE_APPLICATION_INPUT.members["tags"] + ) + + case 9: + kwargs["client_token"] = de.read_string( + _SCHEMA_CREATE_APPLICATION_INPUT.members["clientToken"] + ) + + case 10: + kwargs["attachments_configuration"] = ( + AttachmentsConfiguration.deserialize(de) + ) + + case 11: + kwargs["q_apps_configuration"] = QAppsConfiguration.deserialize(de) + + case 12: + kwargs["personalization_configuration"] = ( + PersonalizationConfiguration.deserialize(de) + ) + + case 13: + kwargs["quick_sight_configuration"] = ( + QuickSightConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_APPLICATION_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class CreateApplicationOutput: + """Dataclass for CreateApplicationOutput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application.""" + + application_arn: str | None = None + """The Amazon Resource Name (ARN) of the Amazon Q Business application.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_APPLICATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CREATE_APPLICATION_OUTPUT.members["applicationId"], + self.application_id, + ) + + if self.application_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_APPLICATION_OUTPUT.members["applicationArn"], + self.application_arn, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CREATE_APPLICATION_OUTPUT.members["applicationId"] + ) + + case 1: + kwargs["application_arn"] = de.read_string( + _SCHEMA_CREATE_APPLICATION_OUTPUT.members["applicationArn"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_APPLICATION_OUTPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class InternalServerException(ServiceError): + """ + An issue occurred with the internal server used for your Amazon Q + Business service. Wait some minutes and try again, or contact + [Support](http://aws.amazon.com/contact-us/) for help. + """ + + fault: Literal["client", "server"] | None = "server" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string( + _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError): + """ + The application or plugin resource you want to use doesn't exist. Make + sure you have provided the correct resource and try again. + """ + + fault: Literal["client", "server"] | None = "client" + + resource_id: str + """The identifier of the resource affected.""" + + resource_type: str + """The type of the resource affected.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message + ) + serializer.write_string( + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["resourceId"], self.resource_id + ) + serializer.write_string( + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["resourceType"], + self.resource_type, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string( + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] + ) + + case 1: + kwargs["resource_id"] = de.read_string( + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["resourceId"] + ) + + case 2: + kwargs["resource_type"] = de.read_string( + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["resourceType"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError): + """You have exceeded the set limits for your Amazon Q Business service.""" + + fault: Literal["client", "server"] | None = "client" + + resource_id: str + """The identifier of the resource affected.""" + + resource_type: str + """The type of the resource affected.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], self.message + ) + serializer.write_string( + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["resourceId"], + self.resource_id, + ) + serializer.write_string( + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["resourceType"], + self.resource_type, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string( + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] + ) + + case 1: + kwargs["resource_id"] = de.read_string( + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["resourceId"] + ) + + case 2: + kwargs["resource_type"] = de.read_string( + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["resourceType"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError): + """ + The request was denied due to throttling. Reduce the number of requests + and try again. + """ + + fault: Literal["client", "server"] | None = "client" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string( + _SCHEMA_THROTTLING_EXCEPTION.members["message"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ValidationExceptionField: + """ + The input failed to meet the constraints specified by Amazon Q Business + in a specified field. + """ + + name: str + """The field name where the invalid entry was detected.""" + + message: str + """A message about the validation exception.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"], self.name + ) + serializer.write_string( + _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"], self.message + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["name"] = de.read_string( + _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"] + ) + + case 1: + kwargs["message"] = de.read_string( + _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, consumer=_consumer) + return kwargs + + +def _serialize_validation_exception_fields( + serializer: ShapeSerializer, schema: Schema, value: list[ValidationExceptionField] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_validation_exception_fields( + deserializer: ShapeDeserializer, schema: Schema +) -> list[ValidationExceptionField]: + result: list[ValidationExceptionField] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(ValidationExceptionField.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +class ValidationExceptionReason(StrEnum): + CANNOT_PARSE = "CANNOT_PARSE" + FIELD_VALIDATION_FAILED = "FIELD_VALIDATION_FAILED" + UNKNOWN_OPERATION = "UNKNOWN_OPERATION" + + +@dataclass(kw_only=True) +class ValidationException(ServiceError): + """ + The input doesn't meet the constraints set by the Amazon Q Business + service. Provide the correct input and try again. + """ + + fault: Literal["client", "server"] | None = "client" + + reason: str + """The reason for the `ValidationException`.""" + + fields: list[ValidationExceptionField] | None = None + """The input field(s) that failed validation.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message + ) + serializer.write_string( + _SCHEMA_VALIDATION_EXCEPTION.members["reason"], self.reason + ) + if self.fields is not None: + _serialize_validation_exception_fields( + serializer, _SCHEMA_VALIDATION_EXCEPTION.members["fields"], self.fields + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string( + _SCHEMA_VALIDATION_EXCEPTION.members["message"] + ) + + case 1: + kwargs["reason"] = de.read_string( + _SCHEMA_VALIDATION_EXCEPTION.members["reason"] + ) + + case 2: + kwargs["fields"] = _deserialize_validation_exception_fields( + de, _SCHEMA_VALIDATION_EXCEPTION.members["fields"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) + return kwargs + + +CREATE_APPLICATION = APIOperation( + input=CreateApplicationInput, + output=CreateApplicationOutput, + schema=_SCHEMA_CREATE_APPLICATION, + input_schema=_SCHEMA_CREATE_APPLICATION_INPUT, + output_schema=_SCHEMA_CREATE_APPLICATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DataAccessorIdcTrustedTokenIssuerConfiguration: + """ + Configuration details for IAM Identity Center Trusted Token Issuer (TTI) + authentication. + """ + + idc_trusted_token_issuer_arn: str + """ + The Amazon Resource Name (ARN) of the IAM Identity Center Trusted Token + Issuer that will be used for authentication. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION, self + ) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION.members[ + "idcTrustedTokenIssuerArn" + ], + self.idc_trusted_token_issuer_arn, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["idc_trusted_token_issuer_arn"] = de.read_string( + _SCHEMA_DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION.members[ + "idcTrustedTokenIssuerArn" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION, + consumer=_consumer, + ) + return kwargs + + +@dataclass +class DataAccessorAuthenticationConfigurationIdcTrustedTokenIssuerConfiguration: + """ + Configuration for IAM Identity Center Trusted Token Issuer (TTI) + authentication used when the authentication type is `AWS_IAM_IDC_TTI`. + """ + + value: DataAccessorIdcTrustedTokenIssuerConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION, self + ) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION.members[ + "idcTrustedTokenIssuerConfiguration" + ], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls( + value=DataAccessorIdcTrustedTokenIssuerConfiguration.deserialize( + deserializer + ) + ) + + +@dataclass +class DataAccessorAuthenticationConfigurationUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +DataAccessorAuthenticationConfiguration = Union[ + DataAccessorAuthenticationConfigurationIdcTrustedTokenIssuerConfiguration + | DataAccessorAuthenticationConfigurationUnknown +] +""" +A union type that contains the specific authentication configuration +based on the authentication type selected. +""" + + +class _DataAccessorAuthenticationConfigurationDeserializer: + _result: DataAccessorAuthenticationConfiguration | None = None + + def deserialize( + self, deserializer: ShapeDeserializer + ) -> DataAccessorAuthenticationConfiguration: + self._result = None + deserializer.read_struct( + _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION, self._consumer + ) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result( + DataAccessorAuthenticationConfigurationIdcTrustedTokenIssuerConfiguration.deserialize( + de + ) + ) + + case _: + self._set_result( + DataAccessorAuthenticationConfigurationUnknown( + tag=schema.expect_member_name() + ) + ) + + def _set_result(self, value: DataAccessorAuthenticationConfiguration) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +class DataAccessorAuthenticationType(StrEnum): + """The type of authentication mechanism used by the data accessor.""" + + AWS_IAM_IDC_TTI = "AWS_IAM_IDC_TTI" + AWS_IAM_IDC_AUTH_CODE = "AWS_IAM_IDC_AUTH_CODE" + + +def _serialize_data_accessor_external_ids( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_data_accessor_external_ids( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class DataAccessorAuthenticationDetail: + """ + Contains the authentication configuration details for a data accessor. + This structure defines how the ISV authenticates when accessing data + through the data accessor. + """ + + authentication_type: str + """ + The type of authentication to use for the data accessor. This determines + how the ISV authenticates when accessing data. You can use one of two + authentication types: + + - `AWS_IAM_IDC_TTI` - Authentication using IAM Identity Center Trusted + Token Issuer (TTI). This authentication type allows the ISV to use a + trusted token issuer to generate tokens for accessing the data. + + - `AWS_IAM_IDC_AUTH_CODE` - Authentication using IAM Identity Center + authorization code flow. This authentication type uses the standard + OAuth 2.0 authorization code flow for authentication. + """ + + authentication_configuration: DataAccessorAuthenticationConfiguration | None = None + """ + The specific authentication configuration based on the authentication + type. + """ + + external_ids: list[str] | None = None + """ + A list of external identifiers associated with this authentication + configuration. These are used to correlate the data accessor with + external systems. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL.members["authenticationType"], + self.authentication_type, + ) + if self.authentication_configuration is not None: + serializer.write_struct( + _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL.members[ + "authenticationConfiguration" + ], + self.authentication_configuration, + ) + + if self.external_ids is not None: + _serialize_data_accessor_external_ids( + serializer, + _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL.members["externalIds"], + self.external_ids, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["authentication_type"] = de.read_string( + _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL.members[ + "authenticationType" + ] + ) + + case 1: + kwargs["authentication_configuration"] = ( + _DataAccessorAuthenticationConfigurationDeserializer().deserialize( + de + ) + ) + + case 2: + kwargs["external_ids"] = _deserialize_data_accessor_external_ids( + de, + _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL.members[ + "externalIds" + ], + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class CreateDataAccessorOutput: + """Dataclass for CreateDataAccessorOutput structure.""" + + data_accessor_id: str + """The unique identifier of the created data accessor.""" + + idc_application_arn: str + """ + The Amazon Resource Name (ARN) of the IAM Identity Center application + created for this data accessor. + """ + + data_accessor_arn: str + """The Amazon Resource Name (ARN) of the created data accessor.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["dataAccessorId"], + self.data_accessor_id, + ) + serializer.write_string( + _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["idcApplicationArn"], + self.idc_application_arn, + ) + serializer.write_string( + _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["dataAccessorArn"], + self.data_accessor_arn, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["data_accessor_id"] = de.read_string( + _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["dataAccessorId"] + ) + + case 1: + kwargs["idc_application_arn"] = de.read_string( + _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["idcApplicationArn"] + ) + + case 2: + kwargs["data_accessor_arn"] = de.read_string( + _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["dataAccessorArn"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class DeleteDataAccessorInput: + """Dataclass for DeleteDataAccessorInput structure.""" + + application_id: str | None = None + """The unique identifier of the Amazon Q Business application.""" + + data_accessor_id: str | None = None + """The unique identifier of the data accessor to delete.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_DATA_ACCESSOR_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_DATA_ACCESSOR_INPUT.members["applicationId"], + self.application_id, + ) + + if self.data_accessor_id is not None: + serializer.write_string( + _SCHEMA_DELETE_DATA_ACCESSOR_INPUT.members["dataAccessorId"], + self.data_accessor_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_DATA_ACCESSOR_INPUT.members["applicationId"] + ) + + case 1: + kwargs["data_accessor_id"] = de.read_string( + _SCHEMA_DELETE_DATA_ACCESSOR_INPUT.members["dataAccessorId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_DATA_ACCESSOR_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DeleteDataAccessorOutput: + """Dataclass for DeleteDataAccessorOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_DATA_ACCESSOR_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DELETE_DATA_ACCESSOR_OUTPUT, consumer=_consumer + ) + return kwargs + + +DELETE_DATA_ACCESSOR = APIOperation( + input=DeleteDataAccessorInput, + output=DeleteDataAccessorOutput, + schema=_SCHEMA_DELETE_DATA_ACCESSOR, + input_schema=_SCHEMA_DELETE_DATA_ACCESSOR_INPUT, + output_schema=_SCHEMA_DELETE_DATA_ACCESSOR_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetDataAccessorInput: + """Dataclass for GetDataAccessorInput structure.""" + + application_id: str | None = None + """The unique identifier of the Amazon Q Business application.""" + + data_accessor_id: str | None = None + """The unique identifier of the data accessor to retrieve.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_DATA_ACCESSOR_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_DATA_ACCESSOR_INPUT.members["applicationId"], + self.application_id, + ) + + if self.data_accessor_id is not None: + serializer.write_string( + _SCHEMA_GET_DATA_ACCESSOR_INPUT.members["dataAccessorId"], + self.data_accessor_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_DATA_ACCESSOR_INPUT.members["applicationId"] + ) + + case 1: + kwargs["data_accessor_id"] = de.read_string( + _SCHEMA_GET_DATA_ACCESSOR_INPUT.members["dataAccessorId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_DATA_ACCESSOR_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ListDataAccessorsInput: + """Dataclass for ListDataAccessorsInput structure.""" + + application_id: str | None = None + """The unique identifier of the Amazon Q Business application.""" + + next_token: str | None = None + """ + The token for the next set of results. (You received this token from a + previous call.) + """ + + max_results: int | None = None + """The maximum number of results to return in a single call.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_DATA_ACCESSORS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["applicationId"], + self.application_id, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["maxResults"], + self.max_results, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["applicationId"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["nextToken"] + ) + + case 2: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_DATA_ACCESSORS_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DataAccessor: + """Provides summary information about a data accessor.""" + + display_name: str | None = field(repr=False, default=None) + """The friendly name of the data accessor.""" + + data_accessor_id: str | None = None + """The unique identifier of the data accessor.""" + + data_accessor_arn: str | None = None + """The Amazon Resource Name (ARN) of the data accessor.""" + + idc_application_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the associated IAM Identity Center + application. + """ + + principal: str | None = None + """ + The Amazon Resource Name (ARN) of the IAM role for the ISV associated + with this data accessor. + """ + + authentication_detail: DataAccessorAuthenticationDetail | None = None + """ + The authentication configuration details for the data accessor. This + specifies how the ISV authenticates when accessing data through this + data accessor. + """ + + created_at: datetime | None = None + """The timestamp when the data accessor was created.""" + + updated_at: datetime | None = None + """The timestamp when the data accessor was last updated.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DATA_ACCESSOR, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.display_name is not None: + serializer.write_string( + _SCHEMA_DATA_ACCESSOR.members["displayName"], self.display_name + ) + + if self.data_accessor_id is not None: + serializer.write_string( + _SCHEMA_DATA_ACCESSOR.members["dataAccessorId"], self.data_accessor_id + ) + + if self.data_accessor_arn is not None: + serializer.write_string( + _SCHEMA_DATA_ACCESSOR.members["dataAccessorArn"], self.data_accessor_arn + ) + + if self.idc_application_arn is not None: + serializer.write_string( + _SCHEMA_DATA_ACCESSOR.members["idcApplicationArn"], + self.idc_application_arn, + ) + + if self.principal is not None: + serializer.write_string( + _SCHEMA_DATA_ACCESSOR.members["principal"], self.principal + ) + + if self.authentication_detail is not None: + serializer.write_struct( + _SCHEMA_DATA_ACCESSOR.members["authenticationDetail"], + self.authentication_detail, + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_DATA_ACCESSOR.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_DATA_ACCESSOR.members["updatedAt"], self.updated_at + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["display_name"] = de.read_string( + _SCHEMA_DATA_ACCESSOR.members["displayName"] + ) + + case 1: + kwargs["data_accessor_id"] = de.read_string( + _SCHEMA_DATA_ACCESSOR.members["dataAccessorId"] + ) + + case 2: + kwargs["data_accessor_arn"] = de.read_string( + _SCHEMA_DATA_ACCESSOR.members["dataAccessorArn"] + ) + + case 3: + kwargs["idc_application_arn"] = de.read_string( + _SCHEMA_DATA_ACCESSOR.members["idcApplicationArn"] + ) + + case 4: + kwargs["principal"] = de.read_string( + _SCHEMA_DATA_ACCESSOR.members["principal"] + ) + + case 5: + kwargs["authentication_detail"] = ( + DataAccessorAuthenticationDetail.deserialize(de) + ) + + case 6: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_DATA_ACCESSOR.members["createdAt"] + ) + + case 7: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_DATA_ACCESSOR.members["updatedAt"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DATA_ACCESSOR, consumer=_consumer) + return kwargs + + +def _serialize_data_accessors( + serializer: ShapeSerializer, schema: Schema, value: list[DataAccessor] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_data_accessors( + deserializer: ShapeDeserializer, schema: Schema +) -> list[DataAccessor]: + result: list[DataAccessor] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(DataAccessor.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ListDataAccessorsOutput: + """Dataclass for ListDataAccessorsOutput structure.""" + + data_accessors: list[DataAccessor] | None = None + """The list of data accessors.""" + + next_token: str | None = None + """The token to use to retrieve the next set of results, if there are any.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_DATA_ACCESSORS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.data_accessors is not None: + _serialize_data_accessors( + serializer, + _SCHEMA_LIST_DATA_ACCESSORS_OUTPUT.members["dataAccessors"], + self.data_accessors, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_ACCESSORS_OUTPUT.members["nextToken"], self.next_token + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["data_accessors"] = _deserialize_data_accessors( + de, _SCHEMA_LIST_DATA_ACCESSORS_OUTPUT.members["dataAccessors"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_DATA_ACCESSORS_OUTPUT.members["nextToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_DATA_ACCESSORS_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_DATA_ACCESSORS = APIOperation( + input=ListDataAccessorsInput, + output=ListDataAccessorsOutput, + schema=_SCHEMA_LIST_DATA_ACCESSORS, + input_schema=_SCHEMA_LIST_DATA_ACCESSORS_INPUT, + output_schema=_SCHEMA_LIST_DATA_ACCESSORS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class UpdateDataAccessorOutput: + """Dataclass for UpdateDataAccessorOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_DATA_ACCESSOR_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_UPDATE_DATA_ACCESSOR_OUTPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class DeleteApplicationInput: + """Dataclass for DeleteApplicationInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_APPLICATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_APPLICATION_INPUT.members["applicationId"], + self.application_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_APPLICATION_INPUT.members["applicationId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_APPLICATION_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DeleteApplicationOutput: + """Dataclass for DeleteApplicationOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_APPLICATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_APPLICATION_OUTPUT, consumer=_consumer) + return kwargs + + +DELETE_APPLICATION = APIOperation( + input=DeleteApplicationInput, + output=DeleteApplicationOutput, + schema=_SCHEMA_DELETE_APPLICATION, + input_schema=_SCHEMA_DELETE_APPLICATION_INPUT, + output_schema=_SCHEMA_DELETE_APPLICATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetApplicationInput: + """Dataclass for GetApplicationInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_APPLICATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_APPLICATION_INPUT.members["applicationId"], + self.application_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_APPLICATION_INPUT.members["applicationId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_APPLICATION_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class AppliedAttachmentsConfiguration: + """ + Configuration information about the file upload during chat feature for + your application. + """ + + attachments_control_mode: str | None = None + """ + Information about whether file upload during chat functionality is + activated for your application. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_APPLIED_ATTACHMENTS_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.attachments_control_mode is not None: + serializer.write_string( + _SCHEMA_APPLIED_ATTACHMENTS_CONFIGURATION.members[ + "attachmentsControlMode" + ], + self.attachments_control_mode, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["attachments_control_mode"] = de.read_string( + _SCHEMA_APPLIED_ATTACHMENTS_CONFIGURATION.members[ + "attachmentsControlMode" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_APPLIED_ATTACHMENTS_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class AutoSubscriptionStatus(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +class SubscriptionType(StrEnum): + Q_LITE = "Q_LITE" + Q_BUSINESS = "Q_BUSINESS" + + +@dataclass(kw_only=True) +class AutoSubscriptionConfiguration: + """ + Subscription configuration information for an Amazon Q Business + application using IAM identity federation for user management. + """ + + auto_subscribe: str + """ + Describes whether automatic subscriptions are enabled for an Amazon Q + Business application using IAM identity federation for user management. + """ + + default_subscription_type: str | None = None + """ + Describes the default subscription type assigned to an Amazon Q Business + application using IAM identity federation for user management. If the + value for `autoSubscribe` is set to `ENABLED` you must select a value + for this field. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION.members["autoSubscribe"], + self.auto_subscribe, + ) + if self.default_subscription_type is not None: + serializer.write_string( + _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION.members[ + "defaultSubscriptionType" + ], + self.default_subscription_type, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["auto_subscribe"] = de.read_string( + _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION.members["autoSubscribe"] + ) + + case 1: + kwargs["default_subscription_type"] = de.read_string( + _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION.members[ + "defaultSubscriptionType" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class ErrorCode(StrEnum): + INTERNAL_ERROR = "InternalError" + INVALID_REQUEST = "InvalidRequest" + RESOURCE_INACTIVE = "ResourceInactive" + RESOURCE_NOT_FOUND = "ResourceNotFound" + + +@dataclass(kw_only=True) +class ErrorDetail: + """Provides information about a Amazon Q Business request error.""" + + error_message: str | None = None + """The message explaining the Amazon Q Business request error.""" + + error_code: str | None = None + """The code associated with the Amazon Q Business request error.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ERROR_DETAIL, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.error_message is not None: + serializer.write_string( + _SCHEMA_ERROR_DETAIL.members["errorMessage"], self.error_message + ) + + if self.error_code is not None: + serializer.write_string( + _SCHEMA_ERROR_DETAIL.members["errorCode"], self.error_code + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["error_message"] = de.read_string( + _SCHEMA_ERROR_DETAIL.members["errorMessage"] + ) + + case 1: + kwargs["error_code"] = de.read_string( + _SCHEMA_ERROR_DETAIL.members["errorCode"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ERROR_DETAIL, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class GetApplicationOutput: + """Dataclass for GetApplicationOutput structure.""" + + display_name: str | None = None + """The name of the Amazon Q Business application.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application.""" + + application_arn: str | None = None + """The Amazon Resource Name (ARN) of the Amazon Q Business application.""" + + identity_type: str | None = None + """The authentication type being used by a Amazon Q Business application.""" + + iam_identity_provider_arn: str | None = None + """ + The Amazon Resource Name (ARN) of an identity provider being used by an + Amazon Q Business application. + """ + + identity_center_application_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the AWS IAM Identity Center instance + attached to your Amazon Q Business application. + """ + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the IAM with permissions to access + your CloudWatch logs and metrics. + """ + + status: str | None = None + """The status of the Amazon Q Business application.""" + + description: str | None = None + """A description for the Amazon Q Business application.""" + + encryption_configuration: EncryptionConfiguration | None = None + """ + The identifier of the Amazon Web Services KMS key that is used to + encrypt your data. Amazon Q Business doesn't support asymmetric keys. + """ + + created_at: datetime | None = None + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + + updated_at: datetime | None = None + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + + error: ErrorDetail | None = None + """ + If the `Status` field is set to `ERROR`, the `ErrorMessage` field + contains a description of the error that caused the synchronization to + fail. + """ + + attachments_configuration: AppliedAttachmentsConfiguration | None = None + """Settings for whether end users can upload files directly during chat.""" + + q_apps_configuration: QAppsConfiguration | None = None + """ + Settings for whether end users can create and use Amazon Q Apps in the + web experience. + """ + + personalization_configuration: PersonalizationConfiguration | None = None + """ + Configuration information about chat response personalization. For more + information, see [Personalizing chat + responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html). + """ + + auto_subscription_configuration: AutoSubscriptionConfiguration | None = None + """ + Settings for auto-subscription behavior for this application. This is + only applicable to SAML and OIDC applications. + """ + + client_ids_for_oidc: list[str] | None = None + """The OIDC client ID for a Amazon Q Business application.""" + + quick_sight_configuration: QuickSightConfiguration | None = None + """ + The Amazon Quick Suite authentication configuration for the Amazon Q + Business application. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_APPLICATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.display_name is not None: + serializer.write_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["displayName"], self.display_name + ) + + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["applicationId"], + self.application_id, + ) + + if self.application_arn is not None: + serializer.write_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["applicationArn"], + self.application_arn, + ) + + if self.identity_type is not None: + serializer.write_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["identityType"], + self.identity_type, + ) + + if self.iam_identity_provider_arn is not None: + serializer.write_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["iamIdentityProviderArn"], + self.iam_identity_provider_arn, + ) + + if self.identity_center_application_arn is not None: + serializer.write_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["identityCenterApplicationArn"], + self.identity_center_application_arn, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["roleArn"], self.role_arn + ) + + if self.status is not None: + serializer.write_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["status"], self.status + ) + + if self.description is not None: + serializer.write_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["description"], self.description + ) + + if self.encryption_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_APPLICATION_OUTPUT.members["encryptionConfiguration"], + self.encryption_configuration, + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_APPLICATION_OUTPUT.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_APPLICATION_OUTPUT.members["updatedAt"], self.updated_at + ) + + if self.error is not None: + serializer.write_struct( + _SCHEMA_GET_APPLICATION_OUTPUT.members["error"], self.error + ) + + if self.attachments_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_APPLICATION_OUTPUT.members["attachmentsConfiguration"], + self.attachments_configuration, + ) + + if self.q_apps_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_APPLICATION_OUTPUT.members["qAppsConfiguration"], + self.q_apps_configuration, + ) + + if self.personalization_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_APPLICATION_OUTPUT.members["personalizationConfiguration"], + self.personalization_configuration, + ) + + if self.auto_subscription_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_APPLICATION_OUTPUT.members["autoSubscriptionConfiguration"], + self.auto_subscription_configuration, + ) + + if self.client_ids_for_oidc is not None: + _serialize_client_ids_for_oidc( + serializer, + _SCHEMA_GET_APPLICATION_OUTPUT.members["clientIdsForOIDC"], + self.client_ids_for_oidc, + ) + + if self.quick_sight_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_APPLICATION_OUTPUT.members["quickSightConfiguration"], + self.quick_sight_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["display_name"] = de.read_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["displayName"] + ) + + case 1: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["applicationId"] + ) + + case 2: + kwargs["application_arn"] = de.read_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["applicationArn"] + ) + + case 3: + kwargs["identity_type"] = de.read_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["identityType"] + ) + + case 4: + kwargs["iam_identity_provider_arn"] = de.read_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["iamIdentityProviderArn"] + ) + + case 5: + kwargs["identity_center_application_arn"] = de.read_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members[ + "identityCenterApplicationArn" + ] + ) + + case 6: + kwargs["role_arn"] = de.read_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["roleArn"] + ) + + case 7: + kwargs["status"] = de.read_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["status"] + ) + + case 8: + kwargs["description"] = de.read_string( + _SCHEMA_GET_APPLICATION_OUTPUT.members["description"] + ) + + case 9: + kwargs["encryption_configuration"] = ( + EncryptionConfiguration.deserialize(de) + ) + + case 10: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_GET_APPLICATION_OUTPUT.members["createdAt"] + ) + + case 11: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_GET_APPLICATION_OUTPUT.members["updatedAt"] + ) + + case 12: + kwargs["error"] = ErrorDetail.deserialize(de) + + case 13: + kwargs["attachments_configuration"] = ( + AppliedAttachmentsConfiguration.deserialize(de) + ) + + case 14: + kwargs["q_apps_configuration"] = QAppsConfiguration.deserialize(de) + + case 15: + kwargs["personalization_configuration"] = ( + PersonalizationConfiguration.deserialize(de) + ) + + case 16: + kwargs["auto_subscription_configuration"] = ( + AutoSubscriptionConfiguration.deserialize(de) + ) + + case 17: + kwargs["client_ids_for_oidc"] = _deserialize_client_ids_for_oidc( + de, _SCHEMA_GET_APPLICATION_OUTPUT.members["clientIdsForOIDC"] + ) + + case 18: + kwargs["quick_sight_configuration"] = ( + QuickSightConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_APPLICATION_OUTPUT, consumer=_consumer) + return kwargs + + +GET_APPLICATION = APIOperation( + input=GetApplicationInput, + output=GetApplicationOutput, + schema=_SCHEMA_GET_APPLICATION, + input_schema=_SCHEMA_GET_APPLICATION_INPUT, + output_schema=_SCHEMA_GET_APPLICATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class IndexCapacityConfiguration: + """Provides information about index capacity configuration.""" + + units: int | None = None + """The number of storage units configured for an Amazon Q Business index.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_INDEX_CAPACITY_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.units is not None: + serializer.write_integer( + _SCHEMA_INDEX_CAPACITY_CONFIGURATION.members["units"], self.units + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["units"] = de.read_integer( + _SCHEMA_INDEX_CAPACITY_CONFIGURATION.members["units"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_INDEX_CAPACITY_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class IndexType(StrEnum): + ENTERPRISE = "ENTERPRISE" + STARTER = "STARTER" + + +@dataclass(kw_only=True) +class CreateIndexInput: + """Dataclass for CreateIndexInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application using the index.""" + + display_name: str | None = None + """A name for the Amazon Q Business index.""" + + description: str | None = None + """A description for the Amazon Q Business index.""" + + type: str | None = None + """ + The index type that's suitable for your needs. For more information on + what's included in each type of index, see [Amazon Q Business + tiers](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/tiers.html#index-tiers). + """ + + tags: list[Tag] | None = None + """ + A list of key-value pairs that identify or categorize the index. You can + also use tags to help control access to the index. Tag keys and values + can consist of Unicode letters, digits, white space, and any of the + following symbols: _ . : / = + - @. + """ + + capacity_configuration: IndexCapacityConfiguration | None = None + """ + The capacity units you want to provision for your index. You can add and + remove capacity to fit your usage needs. + """ + + client_token: str | None = None + """ + A token that you provide to identify the request to create an index. + Multiple calls to the `CreateIndex` API with the same client token will + create only one index. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_INDEX_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CREATE_INDEX_INPUT.members["applicationId"], self.application_id + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_CREATE_INDEX_INPUT.members["displayName"], self.display_name + ) + + if self.description is not None: + serializer.write_string( + _SCHEMA_CREATE_INDEX_INPUT.members["description"], self.description + ) + + if self.type is not None: + serializer.write_string( + _SCHEMA_CREATE_INDEX_INPUT.members["type"], self.type + ) + + if self.tags is not None: + _serialize_tags( + serializer, _SCHEMA_CREATE_INDEX_INPUT.members["tags"], self.tags + ) + + if self.capacity_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_INDEX_INPUT.members["capacityConfiguration"], + self.capacity_configuration, + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CREATE_INDEX_INPUT.members["clientToken"], self.client_token + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CREATE_INDEX_INPUT.members["applicationId"] + ) + + case 1: + kwargs["display_name"] = de.read_string( + _SCHEMA_CREATE_INDEX_INPUT.members["displayName"] + ) + + case 2: + kwargs["description"] = de.read_string( + _SCHEMA_CREATE_INDEX_INPUT.members["description"] + ) + + case 3: + kwargs["type"] = de.read_string( + _SCHEMA_CREATE_INDEX_INPUT.members["type"] + ) + + case 4: + kwargs["tags"] = _deserialize_tags( + de, _SCHEMA_CREATE_INDEX_INPUT.members["tags"] + ) + + case 5: + kwargs["capacity_configuration"] = ( + IndexCapacityConfiguration.deserialize(de) + ) + + case 6: + kwargs["client_token"] = de.read_string( + _SCHEMA_CREATE_INDEX_INPUT.members["clientToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_INDEX_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class CreateIndexOutput: + """Dataclass for CreateIndexOutput structure.""" + + index_id: str | None = None + """The identifier for the Amazon Q Business index.""" + + index_arn: str | None = None + """The Amazon Resource Name (ARN) of an Amazon Q Business index.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_INDEX_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.index_id is not None: + serializer.write_string( + _SCHEMA_CREATE_INDEX_OUTPUT.members["indexId"], self.index_id + ) + + if self.index_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_INDEX_OUTPUT.members["indexArn"], self.index_arn + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["index_id"] = de.read_string( + _SCHEMA_CREATE_INDEX_OUTPUT.members["indexId"] + ) + + case 1: + kwargs["index_arn"] = de.read_string( + _SCHEMA_CREATE_INDEX_OUTPUT.members["indexArn"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_INDEX_OUTPUT, consumer=_consumer) + return kwargs + + +CREATE_INDEX = APIOperation( + input=CreateIndexInput, + output=CreateIndexOutput, + schema=_SCHEMA_CREATE_INDEX, + input_schema=_SCHEMA_CREATE_INDEX_INPUT, + output_schema=_SCHEMA_CREATE_INDEX_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +class DocumentEnrichmentConditionOperator(StrEnum): + GREATER_THAN = "GREATER_THAN" + GREATER_THAN_OR_EQUALS = "GREATER_THAN_OR_EQUALS" + LESS_THAN = "LESS_THAN" + LESS_THAN_OR_EQUALS = "LESS_THAN_OR_EQUALS" + EQUALS = "EQUALS" + NOT_EQUALS = "NOT_EQUALS" + CONTAINS = "CONTAINS" + NOT_CONTAINS = "NOT_CONTAINS" + EXISTS = "EXISTS" + NOT_EXISTS = "NOT_EXISTS" + BEGINS_WITH = "BEGINS_WITH" + + +@dataclass(kw_only=True) +class DocumentAttributeCondition: + """ + The condition used for the target document attribute or metadata field + when ingesting documents into Amazon Q Business. You use this with + [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) + to apply the condition. + + For example, you can create the 'Department' target field and have it + prefill department names associated with the documents based on + information in the 'Source_URI' field. Set the condition that if the + 'Source_URI' field contains 'financial' in its URI value, then + prefill the target field 'Department' with the target value + 'Finance' for the document. + + Amazon Q Business can't create a target field if it has not already + been created as an index field. After you create your index field, you + can create a document metadata field using `DocumentAttributeTarget`. + Amazon Q Business then will map your newly created metadata field to + your index field. + """ + + key: str + """ + The identifier of the document attribute used for the condition. + + For example, 'Source_URI' could be an identifier for the attribute or + metadata field that contains source URIs associated with the documents. + + Amazon Q Business currently doesn't support `_document_body` as an + attribute key used for the condition. + """ + + operator: str + """ + The identifier of the document attribute used for the condition. + + For example, 'Source_URI' could be an identifier for the attribute or + metadata field that contains source URIs associated with the documents. + + Amazon Q Business currently does not support `_document_body` as an + attribute key used for the condition. + """ + + value: DocumentAttributeValue | None = None + """ + The value of a document attribute. You can only provide one value for a + document attribute. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION.members["key"], self.key + ) + serializer.write_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION.members["operator"], self.operator + ) + if self.value is not None: + serializer.write_struct( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION.members["value"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["key"] = de.read_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION.members["key"] + ) + + case 1: + kwargs["operator"] = de.read_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION.members["operator"] + ) + + case 2: + kwargs["value"] = _DocumentAttributeValueDeserializer().deserialize( + de + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION, consumer=_consumer + ) + return kwargs + + +class DocumentContentOperator(StrEnum): + DELETE = "DELETE" + + +class AttributeValueOperator(StrEnum): + DELETE = "DELETE" + + +@dataclass(kw_only=True) +class DocumentAttributeTarget: + """ + The target document attribute or metadata field you want to alter when + ingesting documents into Amazon Q Business. + + For example, you can delete all customer identification numbers + associated with the documents, stored in the document metadata field + called 'Customer_ID' by setting the target key as 'Customer_ID' and + the deletion flag to `TRUE`. This removes all customer ID values in the + field 'Customer_ID'. This would scrub personally identifiable + information from each document's metadata. + + Amazon Q Business can't create a target field if it has not already + been created as an index field. After you create your index field, you + can create a document metadata field using + [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) + . Amazon Q Business will then map your newly created document attribute + to your index field. + + You can also use this with + [`DocumentAttributeCondition`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeCondition.html) + . + """ + + key: str + """ + The identifier of the target document attribute or metadata field. For + example, 'Department' could be an identifier for the target attribute + or metadata field that includes the department names associated with the + documents. + """ + + value: DocumentAttributeValue | None = None + """ + The value of a document attribute. You can only provide one value for a + document attribute. + """ + + attribute_value_operator: str | None = None + """ + `TRUE` to delete the existing target value for your specified target + attribute key. You cannot create a target value and set this to `TRUE`. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_TARGET, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET.members["key"], self.key + ) + if self.value is not None: + serializer.write_struct( + _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET.members["value"], self.value + ) + + if self.attribute_value_operator is not None: + serializer.write_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET.members["attributeValueOperator"], + self.attribute_value_operator, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["key"] = de.read_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET.members["key"] + ) + + case 1: + kwargs["value"] = _DocumentAttributeValueDeserializer().deserialize( + de + ) + + case 2: + kwargs["attribute_value_operator"] = de.read_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET.members[ + "attributeValueOperator" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_TARGET, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class InlineDocumentEnrichmentConfiguration: + """ + Provides the configuration information for applying basic logic to alter + document metadata and content when ingesting documents into Amazon Q + Business. + + To apply advanced logic, to go beyond what you can do with basic logic, + see + [`HookConfiguration`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_HookConfiguration.html) + . + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + + condition: DocumentAttributeCondition | None = None + """ + The condition used for the target document attribute or metadata field + when ingesting documents into Amazon Q Business. You use this with + [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) + to apply the condition. + + For example, you can create the 'Department' target field and have it + prefill department names associated with the documents based on + information in the 'Source_URI' field. Set the condition that if the + 'Source_URI' field contains 'financial' in its URI value, then + prefill the target field 'Department' with the target value + 'Finance' for the document. + + Amazon Q Business can't create a target field if it has not already + been created as an index field. After you create your index field, you + can create a document metadata field using `DocumentAttributeTarget`. + Amazon Q Business then will map your newly created metadata field to + your index field. + """ + + target: DocumentAttributeTarget | None = None + """ + The target document attribute or metadata field you want to alter when + ingesting documents into Amazon Q Business. + + For example, you can delete all customer identification numbers + associated with the documents, stored in the document metadata field + called 'Customer_ID' by setting the target key as 'Customer_ID' and + the deletion flag to `TRUE`. This removes all customer ID values in the + field 'Customer_ID'. This would scrub personally identifiable + information from each document's metadata. + + Amazon Q Business can't create a target field if it has not already + been created as an index field. After you create your index field, you + can create a document metadata field using + [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) + . Amazon Q Business will then map your newly created document attribute + to your index field. + + You can also use this with + [`DocumentAttributeCondition`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeCondition.html) + . + """ + + document_content_operator: str | None = None + """ + `TRUE` to delete content if the condition used for the target attribute + is met. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.condition is not None: + serializer.write_struct( + _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION.members["condition"], + self.condition, + ) + + if self.target is not None: + serializer.write_struct( + _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION.members["target"], + self.target, + ) + + if self.document_content_operator is not None: + serializer.write_string( + _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ + "documentContentOperator" + ], + self.document_content_operator, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["condition"] = DocumentAttributeCondition.deserialize(de) + + case 1: + kwargs["target"] = DocumentAttributeTarget.deserialize(de) + + case 2: + kwargs["document_content_operator"] = de.read_string( + _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ + "documentContentOperator" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +def _serialize_inline_document_enrichment_configurations( + serializer: ShapeSerializer, + schema: Schema, + value: list[InlineDocumentEnrichmentConfiguration], +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_inline_document_enrichment_configurations( + deserializer: ShapeDeserializer, schema: Schema +) -> list[InlineDocumentEnrichmentConfiguration]: + result: list[InlineDocumentEnrichmentConfiguration] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(InlineDocumentEnrichmentConfiguration.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class HookConfiguration: + """ + Provides the configuration information for invoking a Lambda function in + Lambda to alter document metadata and content when ingesting documents + into Amazon Q Business. + + You can configure your Lambda function using the + `PreExtractionHookConfiguration` parameter if you want to apply advanced + alterations on the original or raw documents. + + If you want to apply advanced alterations on the Amazon Q Business + structured documents, you must configure your Lambda function using + `PostExtractionHookConfiguration`. + + You can only invoke one Lambda function. However, this function can + invoke other functions it requires. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + + invocation_condition: DocumentAttributeCondition | None = None + """ + The condition used for when a Lambda function should be invoked. + + For example, you can specify a condition that if there are empty + date-time values, then Amazon Q Business should invoke a function that + inserts the current date-time. + """ + + lambda_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the Lambda function during ingestion. + For more information, see [Using Lambda functions for Amazon Q Business + document + enrichment](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/cde-lambda-operations.html). + """ + + s3_bucket_name: str | None = None + """ + Stores the original, raw documents or the structured, parsed documents + before and after altering them. For more information, see [Data + contracts for Lambda + functions](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/cde-lambda-operations.html#cde-lambda-operations-data-contracts). + """ + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of a role with permission to run + `PreExtractionHookConfiguration` and `PostExtractionHookConfiguration` + for altering document metadata and content during the document ingestion + process. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_HOOK_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.invocation_condition is not None: + serializer.write_struct( + _SCHEMA_HOOK_CONFIGURATION.members["invocationCondition"], + self.invocation_condition, + ) + + if self.lambda_arn is not None: + serializer.write_string( + _SCHEMA_HOOK_CONFIGURATION.members["lambdaArn"], self.lambda_arn + ) + + if self.s3_bucket_name is not None: + serializer.write_string( + _SCHEMA_HOOK_CONFIGURATION.members["s3BucketName"], self.s3_bucket_name + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_HOOK_CONFIGURATION.members["roleArn"], self.role_arn + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["invocation_condition"] = ( + DocumentAttributeCondition.deserialize(de) + ) + + case 1: + kwargs["lambda_arn"] = de.read_string( + _SCHEMA_HOOK_CONFIGURATION.members["lambdaArn"] + ) + + case 2: + kwargs["s3_bucket_name"] = de.read_string( + _SCHEMA_HOOK_CONFIGURATION.members["s3BucketName"] + ) + + case 3: + kwargs["role_arn"] = de.read_string( + _SCHEMA_HOOK_CONFIGURATION.members["roleArn"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_HOOK_CONFIGURATION, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DocumentEnrichmentConfiguration: + """ + Provides the configuration information for altering document metadata + and content during the document ingestion process. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + + inline_configurations: list[InlineDocumentEnrichmentConfiguration] | None = None + """ + Configuration information to alter document attributes or metadata + fields and content when ingesting documents into Amazon Q Business. + """ + + pre_extraction_hook_configuration: HookConfiguration | None = None + """ + Provides the configuration information for invoking a Lambda function in + Lambda to alter document metadata and content when ingesting documents + into Amazon Q Business. + + You can configure your Lambda function using the + `PreExtractionHookConfiguration` parameter if you want to apply advanced + alterations on the original or raw documents. + + If you want to apply advanced alterations on the Amazon Q Business + structured documents, you must configure your Lambda function using + `PostExtractionHookConfiguration`. + + You can only invoke one Lambda function. However, this function can + invoke other functions it requires. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + + post_extraction_hook_configuration: HookConfiguration | None = None + """ + Provides the configuration information for invoking a Lambda function in + Lambda to alter document metadata and content when ingesting documents + into Amazon Q Business. + + You can configure your Lambda function using the + `PreExtractionHookConfiguration` parameter if you want to apply advanced + alterations on the original or raw documents. + + If you want to apply advanced alterations on the Amazon Q Business + structured documents, you must configure your Lambda function using + `PostExtractionHookConfiguration`. + + You can only invoke one Lambda function. However, this function can + invoke other functions it requires. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.inline_configurations is not None: + _serialize_inline_document_enrichment_configurations( + serializer, + _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ + "inlineConfigurations" + ], + self.inline_configurations, + ) + + if self.pre_extraction_hook_configuration is not None: + serializer.write_struct( + _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ + "preExtractionHookConfiguration" + ], + self.pre_extraction_hook_configuration, + ) + + if self.post_extraction_hook_configuration is not None: + serializer.write_struct( + _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ + "postExtractionHookConfiguration" + ], + self.post_extraction_hook_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["inline_configurations"] = ( + _deserialize_inline_document_enrichment_configurations( + de, + _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ + "inlineConfigurations" + ], + ) + ) + + case 1: + kwargs["pre_extraction_hook_configuration"] = ( + HookConfiguration.deserialize(de) + ) + + case 2: + kwargs["post_extraction_hook_configuration"] = ( + HookConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class AudioExtractionStatus(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +@dataclass(kw_only=True) +class AudioExtractionConfiguration: + """Configuration settings for audio content extraction and processing.""" + + audio_extraction_status: str + """ + The status of audio extraction (ENABLED or DISABLED) for processing + audio content from files. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_AUDIO_EXTRACTION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION.members["audioExtractionStatus"], + self.audio_extraction_status, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["audio_extraction_status"] = de.read_string( + _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION.members[ + "audioExtractionStatus" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class ImageExtractionStatus(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +@dataclass(kw_only=True) +class ImageExtractionConfiguration: + """ + The configuration for extracting semantic meaning from images in + documents. For more information, see [Extracting semantic meaning from + images and + visuals](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/extracting-meaning-from-images.html). + """ + + image_extraction_status: str + """ + Specify whether to extract semantic meaning from images and visuals from + documents. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_IMAGE_EXTRACTION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION.members["imageExtractionStatus"], + self.image_extraction_status, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["image_extraction_status"] = de.read_string( + _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION.members[ + "imageExtractionStatus" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class VideoExtractionStatus(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +@dataclass(kw_only=True) +class VideoExtractionConfiguration: + """Configuration settings for video content extraction and processing.""" + + video_extraction_status: str + """ + The status of video extraction (ENABLED or DISABLED) for processing + video content from files. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_VIDEO_EXTRACTION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION.members["videoExtractionStatus"], + self.video_extraction_status, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["video_extraction_status"] = de.read_string( + _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION.members[ + "videoExtractionStatus" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class MediaExtractionConfiguration: + """The configuration for extracting information from media in documents.""" + + image_extraction_configuration: ImageExtractionConfiguration | None = None + """ + The configuration for extracting semantic meaning from images in + documents. For more information, see [Extracting semantic meaning from + images and + visuals](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/extracting-meaning-from-images.html). + """ + + audio_extraction_configuration: AudioExtractionConfiguration | None = None + """ + Configuration settings for extracting and processing audio content from + media files. + """ + + video_extraction_configuration: VideoExtractionConfiguration | None = None + """ + Configuration settings for extracting and processing video content from + media files. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_MEDIA_EXTRACTION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.image_extraction_configuration is not None: + serializer.write_struct( + _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION.members[ + "imageExtractionConfiguration" + ], + self.image_extraction_configuration, + ) + + if self.audio_extraction_configuration is not None: + serializer.write_struct( + _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION.members[ + "audioExtractionConfiguration" + ], + self.audio_extraction_configuration, + ) + + if self.video_extraction_configuration is not None: + serializer.write_struct( + _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION.members[ + "videoExtractionConfiguration" + ], + self.video_extraction_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["image_extraction_configuration"] = ( + ImageExtractionConfiguration.deserialize(de) + ) + + case 1: + kwargs["audio_extraction_configuration"] = ( + AudioExtractionConfiguration.deserialize(de) + ) + + case 2: + kwargs["video_extraction_configuration"] = ( + VideoExtractionConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +def _serialize_security_group_ids( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_security_group_ids( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +def _serialize_subnet_ids( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_subnet_ids( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class DataSourceVpcConfiguration: + """ + Provides configuration information needed to connect to an Amazon VPC + (Virtual Private Cloud). + """ + + subnet_ids: list[str] + """ + A list of identifiers for subnets within your Amazon VPC. The subnets + should be able to connect to each other in the VPC, and they should have + outgoing access to the Internet through a NAT device. + """ + + security_group_ids: list[str] + """ + A list of identifiers of security groups within your Amazon VPC. The + security groups should enable Amazon Q Business to connect to the data + source. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DATA_SOURCE_VPC_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + _serialize_subnet_ids( + serializer, + _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION.members["subnetIds"], + self.subnet_ids, + ) + _serialize_security_group_ids( + serializer, + _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION.members["securityGroupIds"], + self.security_group_ids, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["subnet_ids"] = _deserialize_subnet_ids( + de, _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION.members["subnetIds"] + ) + + case 1: + kwargs["security_group_ids"] = _deserialize_security_group_ids( + de, + _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION.members[ + "securityGroupIds" + ], + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class CreateDataSourceInput: + """Dataclass for CreateDataSourceInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application the data source will + be attached to. + """ + + index_id: str | None = None + """ + The identifier of the index that you want to use with the data source + connector. + """ + + display_name: str | None = None + """A name for the data source connector.""" + + configuration: _Document | None = None + """ + Configuration information to connect your data source repository to + Amazon Q Business. Use this parameter to provide a JSON schema with + configuration information specific to your data source connector. + + Each data source has a JSON schema provided by Amazon Q Business that + you must use. For example, the Amazon S3 and Web Crawler connectors + require the following JSON schemas: + + - [Amazon S3 JSON + schema](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/s3-api.html) + + - [Web Crawler JSON + schema](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/web-crawler-api.html) + + You can find configuration templates for your specific data source using + the following steps: + + 1. Navigate to the [Supported + connectors](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connectors-list.html) + page in the Amazon Q Business User Guide, and select the data source + of your choice. + + 2. Then, from your specific data source connector page, select **Using + the API**. You will find the JSON schema for your data source, + including parameter descriptions, in this section. + """ + + vpc_configuration: DataSourceVpcConfiguration | None = None + """ + Configuration information for an Amazon VPC (Virtual Private Cloud) to + connect to your data source. For more information, see [Using Amazon VPC + with Amazon Q Business + connectors](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connector-vpc.html). + """ + + description: str | None = None + """A description for the data source connector.""" + + tags: list[Tag] | None = None + """ + A list of key-value pairs that identify or categorize the data source + connector. You can also use tags to help control access to the data + source connector. Tag keys and values can consist of Unicode letters, + digits, white space, and any of the following symbols: _ . : / = + - @. + """ + + sync_schedule: str | None = None + """ + Sets the frequency for Amazon Q Business to check the documents in your + data source repository and update your index. If you don't set a + schedule, Amazon Q Business won't periodically update the index. + + Specify a `cron-` format schedule string or an empty string to indicate + that the index is updated on demand. You can't specify the `Schedule` + parameter when the `Type` parameter is set to `CUSTOM`. If you do, you + receive a `ValidationException` exception. + """ + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of an IAM role with permission to access + the data source and required resources. This field is required for all + connector types except custom connectors, where it is optional. + """ + + client_token: str | None = None + """ + A token you provide to identify a request to create a data source + connector. Multiple calls to the `CreateDataSource` API with the same + client token will create only one data source connector. + """ + + document_enrichment_configuration: DocumentEnrichmentConfiguration | None = None + """ + Provides the configuration information for altering document metadata + and content during the document ingestion process. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + + media_extraction_configuration: MediaExtractionConfiguration | None = None + """ + The configuration for extracting information from media in documents + during ingestion. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_DATA_SOURCE_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["indexId"], self.index_id + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["displayName"], + self.display_name, + ) + + if self.configuration is not None: + serializer.write_document( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["configuration"], + self.configuration, + ) + + if self.vpc_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["vpcConfiguration"], + self.vpc_configuration, + ) + + if self.description is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["description"], + self.description, + ) + + if self.tags is not None: + _serialize_tags( + serializer, _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["tags"], self.tags + ) + + if self.sync_schedule is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["syncSchedule"], + self.sync_schedule, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["roleArn"], self.role_arn + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["clientToken"], + self.client_token, + ) + + if self.document_enrichment_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members[ + "documentEnrichmentConfiguration" + ], + self.document_enrichment_configuration, + ) + + if self.media_extraction_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members[ + "mediaExtractionConfiguration" + ], + self.media_extraction_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["indexId"] + ) + + case 2: + kwargs["display_name"] = de.read_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["displayName"] + ) + + case 3: + kwargs["configuration"] = de.read_document( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["configuration"] + ) + + case 4: + kwargs["vpc_configuration"] = ( + DataSourceVpcConfiguration.deserialize(de) + ) + + case 5: + kwargs["description"] = de.read_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["description"] + ) + + case 6: + kwargs["tags"] = _deserialize_tags( + de, _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["tags"] + ) + + case 7: + kwargs["sync_schedule"] = de.read_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["syncSchedule"] + ) + + case 8: + kwargs["role_arn"] = de.read_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["roleArn"] + ) + + case 9: + kwargs["client_token"] = de.read_string( + _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["clientToken"] + ) + + case 10: + kwargs["document_enrichment_configuration"] = ( + DocumentEnrichmentConfiguration.deserialize(de) + ) + + case 11: + kwargs["media_extraction_configuration"] = ( + MediaExtractionConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_DATA_SOURCE_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class CreateDataSourceOutput: + """Dataclass for CreateDataSourceOutput structure.""" + + data_source_id: str | None = None + """The identifier of the data source connector.""" + + data_source_arn: str | None = None + """ + The Amazon Resource Name (ARN) of a data source in an Amazon Q Business + application. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_DATA_SOURCE_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_SOURCE_OUTPUT.members["dataSourceId"], + self.data_source_id, + ) + + if self.data_source_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_SOURCE_OUTPUT.members["dataSourceArn"], + self.data_source_arn, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_CREATE_DATA_SOURCE_OUTPUT.members["dataSourceId"] + ) + + case 1: + kwargs["data_source_arn"] = de.read_string( + _SCHEMA_CREATE_DATA_SOURCE_OUTPUT.members["dataSourceArn"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_DATA_SOURCE_OUTPUT, consumer=_consumer) + return kwargs + + +CREATE_DATA_SOURCE = APIOperation( + input=CreateDataSourceInput, + output=CreateDataSourceOutput, + schema=_SCHEMA_CREATE_DATA_SOURCE, + input_schema=_SCHEMA_CREATE_DATA_SOURCE_INPUT, + output_schema=_SCHEMA_CREATE_DATA_SOURCE_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DeleteDataSourceInput: + """Dataclass for DeleteDataSourceInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application used with the data + source connector. + """ + + index_id: str | None = None + """The identifier of the index used with the data source connector.""" + + data_source_id: str | None = None + """The identifier of the data source connector that you want to delete.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_DATA_SOURCE_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["indexId"], self.index_id + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["dataSourceId"], + self.data_source_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["indexId"] + ) + + case 2: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["dataSourceId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_DATA_SOURCE_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DeleteDataSourceOutput: + """Dataclass for DeleteDataSourceOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_DATA_SOURCE_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_DATA_SOURCE_OUTPUT, consumer=_consumer) + return kwargs + + +DELETE_DATA_SOURCE = APIOperation( + input=DeleteDataSourceInput, + output=DeleteDataSourceOutput, + schema=_SCHEMA_DELETE_DATA_SOURCE, + input_schema=_SCHEMA_DELETE_DATA_SOURCE_INPUT, + output_schema=_SCHEMA_DELETE_DATA_SOURCE_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetDataSourceInput: + """Dataclass for GetDataSourceInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application.""" + + index_id: str | None = None + """The identfier of the index used with the data source connector.""" + + data_source_id: str | None = None + """The identifier of the data source connector.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_DATA_SOURCE_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_INPUT.members["indexId"], self.index_id + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_INPUT.members["dataSourceId"], + self.data_source_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_INPUT.members["indexId"] + ) + + case 2: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_INPUT.members["dataSourceId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_DATA_SOURCE_INPUT, consumer=_consumer) + return kwargs + + +class DataSourceStatus(StrEnum): + PENDING_CREATION = "PENDING_CREATION" + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + FAILED = "FAILED" + UPDATING = "UPDATING" + + +@dataclass(kw_only=True) +class GetDataSourceOutput: + """Dataclass for GetDataSourceOutput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application.""" + + index_id: str | None = None + """The identifier of the index linked to the data source connector.""" + + data_source_id: str | None = None + """The identifier of the data source connector.""" + + data_source_arn: str | None = None + """The Amazon Resource Name (ARN) of the data source.""" + + display_name: str | None = None + """The name for the data source connector.""" + + type: str | None = None + """The type of the data source connector. For example, `S3`.""" + + configuration: _Document | None = None + """The details of how the data source connector is configured.""" + + vpc_configuration: DataSourceVpcConfiguration | None = None + """ + Configuration information for an Amazon VPC (Virtual Private Cloud) to + connect to your data source. + """ + + created_at: datetime | None = None + """The Unix timestamp when the data source connector was created.""" + + updated_at: datetime | None = None + """The Unix timestamp when the data source connector was last updated.""" + + description: str | None = None + """The description for the data source connector.""" + + status: str | None = None + """ + The current status of the data source connector. When the `Status` field + value is `FAILED`, the `ErrorMessage` field contains a description of + the error that caused the data source connector to fail. + """ + + sync_schedule: str | None = None + """The schedule for Amazon Q Business to update the index.""" + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the role with permission to access the + data source and required resources. + """ + + error: ErrorDetail | None = None + """ + When the `Status` field value is `FAILED`, the `ErrorMessage` field + contains a description of the error that caused the data source + connector to fail. + """ + + document_enrichment_configuration: DocumentEnrichmentConfiguration | None = None + """ + Provides the configuration information for altering document metadata + and content during the document ingestion process. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + + media_extraction_configuration: MediaExtractionConfiguration | None = None + """ + The configuration for extracting information from media in documents for + the data source. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_DATA_SOURCE_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["indexId"], self.index_id + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["dataSourceId"], + self.data_source_id, + ) + + if self.data_source_arn is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["dataSourceArn"], + self.data_source_arn, + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["displayName"], self.display_name + ) + + if self.type is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["type"], self.type + ) + + if self.configuration is not None: + serializer.write_document( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["configuration"], + self.configuration, + ) + + if self.vpc_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["vpcConfiguration"], + self.vpc_configuration, + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["updatedAt"], self.updated_at + ) + + if self.description is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["description"], self.description + ) + + if self.status is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["status"], self.status + ) + + if self.sync_schedule is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["syncSchedule"], + self.sync_schedule, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["roleArn"], self.role_arn + ) + + if self.error is not None: + serializer.write_struct( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["error"], self.error + ) + + if self.document_enrichment_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members[ + "documentEnrichmentConfiguration" + ], + self.document_enrichment_configuration, + ) + + if self.media_extraction_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["mediaExtractionConfiguration"], + self.media_extraction_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["indexId"] + ) + + case 2: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["dataSourceId"] + ) + + case 3: + kwargs["data_source_arn"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["dataSourceArn"] + ) + + case 4: + kwargs["display_name"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["displayName"] + ) + + case 5: + kwargs["type"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["type"] + ) + + case 6: + kwargs["configuration"] = de.read_document( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["configuration"] + ) + + case 7: + kwargs["vpc_configuration"] = ( + DataSourceVpcConfiguration.deserialize(de) + ) + + case 8: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["createdAt"] + ) + + case 9: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["updatedAt"] + ) + + case 10: + kwargs["description"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["description"] + ) + + case 11: + kwargs["status"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["status"] + ) + + case 12: + kwargs["sync_schedule"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["syncSchedule"] + ) + + case 13: + kwargs["role_arn"] = de.read_string( + _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["roleArn"] + ) + + case 14: + kwargs["error"] = ErrorDetail.deserialize(de) + + case 15: + kwargs["document_enrichment_configuration"] = ( + DocumentEnrichmentConfiguration.deserialize(de) + ) + + case 16: + kwargs["media_extraction_configuration"] = ( + MediaExtractionConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_DATA_SOURCE_OUTPUT, consumer=_consumer) + return kwargs + + +GET_DATA_SOURCE = APIOperation( + input=GetDataSourceInput, + output=GetDataSourceOutput, + schema=_SCHEMA_GET_DATA_SOURCE, + input_schema=_SCHEMA_GET_DATA_SOURCE_INPUT, + output_schema=_SCHEMA_GET_DATA_SOURCE_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListDataSourcesInput: + """Dataclass for ListDataSourcesInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application linked to the data + source connectors. + """ + + index_id: str | None = None + """ + The identifier of the index used with one or more data source + connectors. + """ + + next_token: str | None = None + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business data source connectors. + """ + + max_results: int | None = None + """The maximum number of data source connectors to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_DATA_SOURCES_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_SOURCES_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_SOURCES_INPUT.members["indexId"], self.index_id + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_SOURCES_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_DATA_SOURCES_INPUT.members["maxResults"], self.max_results + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_DATA_SOURCES_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_LIST_DATA_SOURCES_INPUT.members["indexId"] + ) + + case 2: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_DATA_SOURCES_INPUT.members["nextToken"] + ) + + case 3: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_DATA_SOURCES_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_DATA_SOURCES_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DataSource: + """A data source in an Amazon Q Business application.""" + + display_name: str | None = None + """The name of the Amazon Q Business data source.""" + + data_source_id: str | None = None + """The identifier of the Amazon Q Business data source.""" + + type: str | None = None + """The type of the Amazon Q Business data source.""" + + created_at: datetime | None = None + """The Unix timestamp when the Amazon Q Business data source was created.""" + + updated_at: datetime | None = None + """ + The Unix timestamp when the Amazon Q Business data source was last + updated. + """ + + status: str | None = None + """The status of the Amazon Q Business data source.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DATA_SOURCE, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.display_name is not None: + serializer.write_string( + _SCHEMA_DATA_SOURCE.members["displayName"], self.display_name + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_DATA_SOURCE.members["dataSourceId"], self.data_source_id + ) + + if self.type is not None: + serializer.write_string(_SCHEMA_DATA_SOURCE.members["type"], self.type) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_DATA_SOURCE.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_DATA_SOURCE.members["updatedAt"], self.updated_at + ) + + if self.status is not None: + serializer.write_string(_SCHEMA_DATA_SOURCE.members["status"], self.status) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["display_name"] = de.read_string( + _SCHEMA_DATA_SOURCE.members["displayName"] + ) + + case 1: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_DATA_SOURCE.members["dataSourceId"] + ) + + case 2: + kwargs["type"] = de.read_string(_SCHEMA_DATA_SOURCE.members["type"]) + + case 3: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_DATA_SOURCE.members["createdAt"] + ) + + case 4: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_DATA_SOURCE.members["updatedAt"] + ) + + case 5: + kwargs["status"] = de.read_string( + _SCHEMA_DATA_SOURCE.members["status"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DATA_SOURCE, consumer=_consumer) + return kwargs + + +def _serialize_data_sources( + serializer: ShapeSerializer, schema: Schema, value: list[DataSource] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_data_sources( + deserializer: ShapeDeserializer, schema: Schema +) -> list[DataSource]: + result: list[DataSource] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(DataSource.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ListDataSourcesOutput: + """Dataclass for ListDataSourcesOutput structure.""" + + data_sources: list[DataSource] | None = None + """An array of summary information for one or more data source connector.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token. You + can use this token in a subsequent request to retrieve the next set of + data source connectors. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_DATA_SOURCES_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.data_sources is not None: + _serialize_data_sources( + serializer, + _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members["dataSources"], + self.data_sources, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members["nextToken"], self.next_token + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["data_sources"] = _deserialize_data_sources( + de, _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members["dataSources"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members["nextToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_DATA_SOURCES_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_DATA_SOURCES = APIOperation( + input=ListDataSourcesInput, + output=ListDataSourcesOutput, + schema=_SCHEMA_LIST_DATA_SOURCES, + input_schema=_SCHEMA_LIST_DATA_SOURCES_INPUT, + output_schema=_SCHEMA_LIST_DATA_SOURCES_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class UpdateDataSourceInput: + """Dataclass for UpdateDataSourceInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application the data source is + attached to. + """ + + index_id: str | None = None + """The identifier of the index attached to the data source connector.""" + + data_source_id: str | None = None + """The identifier of the data source connector.""" + + display_name: str | None = None + """A name of the data source connector.""" + + configuration: _Document | None = None + """ + Provides the configuration information for an Amazon Q Business data + source. + """ + + vpc_configuration: DataSourceVpcConfiguration | None = None + """ + Provides configuration information needed to connect to an Amazon VPC + (Virtual Private Cloud). + """ + + description: str | None = None + """The description of the data source connector.""" + + sync_schedule: str | None = None + """The chosen update frequency for your data source.""" + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of an IAM role with permission to access + the data source and required resources. + """ + + document_enrichment_configuration: DocumentEnrichmentConfiguration | None = None + """ + Provides the configuration information for altering document metadata + and content during the document ingestion process. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + + media_extraction_configuration: MediaExtractionConfiguration | None = None + """ + The configuration for extracting information from media in documents for + your data source. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_DATA_SOURCE_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["indexId"], self.index_id + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["dataSourceId"], + self.data_source_id, + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["displayName"], + self.display_name, + ) + + if self.configuration is not None: + serializer.write_document( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["configuration"], + self.configuration, + ) + + if self.vpc_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["vpcConfiguration"], + self.vpc_configuration, + ) + + if self.description is not None: + serializer.write_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["description"], + self.description, + ) + + if self.sync_schedule is not None: + serializer.write_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["syncSchedule"], + self.sync_schedule, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["roleArn"], self.role_arn + ) + + if self.document_enrichment_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members[ + "documentEnrichmentConfiguration" + ], + self.document_enrichment_configuration, + ) + + if self.media_extraction_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members[ + "mediaExtractionConfiguration" + ], + self.media_extraction_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["indexId"] + ) + + case 2: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["dataSourceId"] + ) + + case 3: + kwargs["display_name"] = de.read_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["displayName"] + ) + + case 4: + kwargs["configuration"] = de.read_document( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["configuration"] + ) + + case 5: + kwargs["vpc_configuration"] = ( + DataSourceVpcConfiguration.deserialize(de) + ) + + case 6: + kwargs["description"] = de.read_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["description"] + ) + + case 7: + kwargs["sync_schedule"] = de.read_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["syncSchedule"] + ) + + case 8: + kwargs["role_arn"] = de.read_string( + _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["roleArn"] + ) + + case 9: + kwargs["document_enrichment_configuration"] = ( + DocumentEnrichmentConfiguration.deserialize(de) + ) + + case 10: + kwargs["media_extraction_configuration"] = ( + MediaExtractionConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_DATA_SOURCE_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class UpdateDataSourceOutput: + """Dataclass for UpdateDataSourceOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, consumer=_consumer) + return kwargs + + +UPDATE_DATA_SOURCE = APIOperation( + input=UpdateDataSourceInput, + output=UpdateDataSourceOutput, + schema=_SCHEMA_UPDATE_DATA_SOURCE, + input_schema=_SCHEMA_UPDATE_DATA_SOURCE_INPUT, + output_schema=_SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DeleteIndexInput: + """Dataclass for DeleteIndexInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application the Amazon Q + Business index is linked to. + """ + + index_id: str | None = None + """The identifier of the Amazon Q Business index.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_INDEX_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_INDEX_INPUT.members["applicationId"], self.application_id + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_DELETE_INDEX_INPUT.members["indexId"], self.index_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_INDEX_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_DELETE_INDEX_INPUT.members["indexId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_INDEX_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DeleteIndexOutput: + """Dataclass for DeleteIndexOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_INDEX_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_INDEX_OUTPUT, consumer=_consumer) + return kwargs + + +DELETE_INDEX = APIOperation( + input=DeleteIndexInput, + output=DeleteIndexOutput, + schema=_SCHEMA_DELETE_INDEX, + input_schema=_SCHEMA_DELETE_INDEX_INPUT, + output_schema=_SCHEMA_DELETE_INDEX_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetIndexInput: + """Dataclass for GetIndexInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application connected to the + index. + """ + + index_id: str | None = None + """The identifier of the Amazon Q Business index you want information on.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_INDEX_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_INDEX_INPUT.members["applicationId"], self.application_id + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_GET_INDEX_INPUT.members["indexId"], self.index_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_INDEX_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_GET_INDEX_INPUT.members["indexId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_INDEX_INPUT, consumer=_consumer) + return kwargs + + +class Status(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +class AttributeType(StrEnum): + STRING = "STRING" + STRING_LIST = "STRING_LIST" + NUMBER = "NUMBER" + DATE = "DATE" + + +@dataclass(kw_only=True) +class DocumentAttributeConfiguration: + """ + Configuration information for document attributes. Document attributes + are metadata or fields associated with your documents. For example, the + company department name associated with each document. + + For more information, see [Understanding document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes.html). + """ + + name: str | None = None + """The name of the document attribute.""" + + type: str | None = None + """The type of document attribute.""" + + search: str | None = None + """ + Information about whether the document attribute can be used by an end + user to search for information on their web experience. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.name is not None: + serializer.write_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["name"], self.name + ) + + if self.type is not None: + serializer.write_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["type"], self.type + ) + + if self.search is not None: + serializer.write_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["search"], self.search + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["name"] = de.read_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["name"] + ) + + case 1: + kwargs["type"] = de.read_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["type"] + ) + + case 2: + kwargs["search"] = de.read_string( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["search"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +def _serialize_document_attribute_configurations( + serializer: ShapeSerializer, + schema: Schema, + value: list[DocumentAttributeConfiguration], +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_document_attribute_configurations( + deserializer: ShapeDeserializer, schema: Schema +) -> list[DocumentAttributeConfiguration]: + result: list[DocumentAttributeConfiguration] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(DocumentAttributeConfiguration.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class TextDocumentStatistics: + """Provides information about text documents in an index.""" + + indexed_text_bytes: int | None = None + """The total size, in bytes, of the indexed documents.""" + + indexed_text_document_count: int | None = None + """The number of text documents indexed.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_TEXT_DOCUMENT_STATISTICS, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.indexed_text_bytes is not None: + serializer.write_long( + _SCHEMA_TEXT_DOCUMENT_STATISTICS.members["indexedTextBytes"], + self.indexed_text_bytes, + ) + + if self.indexed_text_document_count is not None: + serializer.write_integer( + _SCHEMA_TEXT_DOCUMENT_STATISTICS.members["indexedTextDocumentCount"], + self.indexed_text_document_count, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["indexed_text_bytes"] = de.read_long( + _SCHEMA_TEXT_DOCUMENT_STATISTICS.members["indexedTextBytes"] + ) + + case 1: + kwargs["indexed_text_document_count"] = de.read_integer( + _SCHEMA_TEXT_DOCUMENT_STATISTICS.members[ + "indexedTextDocumentCount" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_TEXT_DOCUMENT_STATISTICS, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class IndexStatistics: + """Provides information about the number of documents in an index.""" + + text_document_statistics: TextDocumentStatistics | None = None + """The number of documents indexed.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_INDEX_STATISTICS, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.text_document_statistics is not None: + serializer.write_struct( + _SCHEMA_INDEX_STATISTICS.members["textDocumentStatistics"], + self.text_document_statistics, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["text_document_statistics"] = ( + TextDocumentStatistics.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_INDEX_STATISTICS, consumer=_consumer) + return kwargs + + +class IndexStatus(StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + FAILED = "FAILED" + UPDATING = "UPDATING" + + +@dataclass(kw_only=True) +class GetIndexOutput: + """Dataclass for GetIndexOutput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application associated with the + index. + """ + + index_id: str | None = None + """The identifier of the Amazon Q Business index.""" + + display_name: str | None = None + """The name of the Amazon Q Business index.""" + + index_arn: str | None = None + """The Amazon Resource Name (ARN) of the Amazon Q Business index.""" + + status: str | None = None + """ + The current status of the index. When the value is `ACTIVE`, the index + is ready for use. If the `Status` field value is `FAILED`, the + `ErrorMessage` field contains a message that explains why. + """ + + type: str | None = None + """The type of index attached to your Amazon Q Business application.""" + + description: str | None = None + """The description for the Amazon Q Business index.""" + + created_at: datetime | None = None + """The Unix timestamp when the Amazon Q Business index was created.""" + + updated_at: datetime | None = None + """The Unix timestamp when the Amazon Q Business index was last updated.""" + + capacity_configuration: IndexCapacityConfiguration | None = None + """The storage capacity units chosen for your Amazon Q Business index.""" + + document_attribute_configurations: list[DocumentAttributeConfiguration] | None = ( + None + ) + """ + Configuration information for document attributes or metadata. Document + metadata are fields associated with your documents. For example, the + company department name associated with each document. For more + information, see [Understanding document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes). + """ + + error: ErrorDetail | None = None + """ + When the `Status` field value is `FAILED`, the `ErrorMessage` field + contains a message that explains why. + """ + + index_statistics: IndexStatistics | None = None + """Provides information about the number of documents indexed.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_INDEX_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_INDEX_OUTPUT.members["applicationId"], self.application_id + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_GET_INDEX_OUTPUT.members["indexId"], self.index_id + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_GET_INDEX_OUTPUT.members["displayName"], self.display_name + ) + + if self.index_arn is not None: + serializer.write_string( + _SCHEMA_GET_INDEX_OUTPUT.members["indexArn"], self.index_arn + ) + + if self.status is not None: + serializer.write_string( + _SCHEMA_GET_INDEX_OUTPUT.members["status"], self.status + ) + + if self.type is not None: + serializer.write_string(_SCHEMA_GET_INDEX_OUTPUT.members["type"], self.type) + + if self.description is not None: + serializer.write_string( + _SCHEMA_GET_INDEX_OUTPUT.members["description"], self.description + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_INDEX_OUTPUT.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_INDEX_OUTPUT.members["updatedAt"], self.updated_at + ) + + if self.capacity_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_INDEX_OUTPUT.members["capacityConfiguration"], + self.capacity_configuration, + ) + + if self.document_attribute_configurations is not None: + _serialize_document_attribute_configurations( + serializer, + _SCHEMA_GET_INDEX_OUTPUT.members["documentAttributeConfigurations"], + self.document_attribute_configurations, + ) + + if self.error is not None: + serializer.write_struct( + _SCHEMA_GET_INDEX_OUTPUT.members["error"], self.error + ) + + if self.index_statistics is not None: + serializer.write_struct( + _SCHEMA_GET_INDEX_OUTPUT.members["indexStatistics"], + self.index_statistics, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_INDEX_OUTPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_GET_INDEX_OUTPUT.members["indexId"] + ) + + case 2: + kwargs["display_name"] = de.read_string( + _SCHEMA_GET_INDEX_OUTPUT.members["displayName"] + ) + + case 3: + kwargs["index_arn"] = de.read_string( + _SCHEMA_GET_INDEX_OUTPUT.members["indexArn"] + ) + + case 4: + kwargs["status"] = de.read_string( + _SCHEMA_GET_INDEX_OUTPUT.members["status"] + ) + + case 5: + kwargs["type"] = de.read_string( + _SCHEMA_GET_INDEX_OUTPUT.members["type"] + ) + + case 6: + kwargs["description"] = de.read_string( + _SCHEMA_GET_INDEX_OUTPUT.members["description"] + ) + + case 7: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_GET_INDEX_OUTPUT.members["createdAt"] + ) + + case 8: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_GET_INDEX_OUTPUT.members["updatedAt"] + ) + + case 9: + kwargs["capacity_configuration"] = ( + IndexCapacityConfiguration.deserialize(de) + ) + + case 10: + kwargs["document_attribute_configurations"] = ( + _deserialize_document_attribute_configurations( + de, + _SCHEMA_GET_INDEX_OUTPUT.members[ + "documentAttributeConfigurations" + ], + ) + ) + + case 11: + kwargs["error"] = ErrorDetail.deserialize(de) + + case 12: + kwargs["index_statistics"] = IndexStatistics.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_INDEX_OUTPUT, consumer=_consumer) + return kwargs + + +GET_INDEX = APIOperation( + input=GetIndexInput, + output=GetIndexOutput, + schema=_SCHEMA_GET_INDEX, + input_schema=_SCHEMA_GET_INDEX_INPUT, + output_schema=_SCHEMA_GET_INDEX_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListIndicesInput: + """Dataclass for ListIndicesInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application connected to the + index. + """ + + next_token: str | None = None + """ + If the maxResults response was incomplete because there is more data to + retrieve, Amazon Q Business returns a pagination token in the response. + You can use this pagination token to retrieve the next set of Amazon Q + Business indices. + """ + + max_results: int | None = None + """The maximum number of indices to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_INDICES_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_INDICES_INPUT.members["applicationId"], self.application_id + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_INDICES_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_INDICES_INPUT.members["maxResults"], self.max_results + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_INDICES_INPUT.members["applicationId"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_INDICES_INPUT.members["nextToken"] + ) + + case 2: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_INDICES_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_INDICES_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class Index: + """Summary information for your Amazon Q Business index.""" + + display_name: str | None = None + """The name of the index.""" + + index_id: str | None = None + """The identifier for the index.""" + + created_at: datetime | None = None + """The Unix timestamp when the index was created.""" + + updated_at: datetime | None = None + """The Unix timestamp when the index was last updated.""" + + status: str | None = None + """ + The current status of the index. When the status is `ACTIVE`, the index + is ready. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_INDEX, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.display_name is not None: + serializer.write_string( + _SCHEMA_INDEX.members["displayName"], self.display_name + ) + + if self.index_id is not None: + serializer.write_string(_SCHEMA_INDEX.members["indexId"], self.index_id) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_INDEX.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_INDEX.members["updatedAt"], self.updated_at + ) + + if self.status is not None: + serializer.write_string(_SCHEMA_INDEX.members["status"], self.status) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["display_name"] = de.read_string( + _SCHEMA_INDEX.members["displayName"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_INDEX.members["indexId"] + ) + + case 2: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_INDEX.members["createdAt"] + ) + + case 3: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_INDEX.members["updatedAt"] + ) + + case 4: + kwargs["status"] = de.read_string(_SCHEMA_INDEX.members["status"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_INDEX, consumer=_consumer) + return kwargs + + +def _serialize_indices( + serializer: ShapeSerializer, schema: Schema, value: list[Index] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_indices( + deserializer: ShapeDeserializer, schema: Schema +) -> list[Index]: + result: list[Index] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(Index.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ListIndicesOutput: + """Dataclass for ListIndicesOutput structure.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token that + you can use in the subsequent request to retrieve the next set of + indexes. + """ + + indices: list[Index] | None = None + """An array of information on the items in one or more indexes.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_INDICES_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_INDICES_OUTPUT.members["nextToken"], self.next_token + ) + + if self.indices is not None: + _serialize_indices( + serializer, _SCHEMA_LIST_INDICES_OUTPUT.members["indices"], self.indices + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_INDICES_OUTPUT.members["nextToken"] + ) + + case 1: + kwargs["indices"] = _deserialize_indices( + de, _SCHEMA_LIST_INDICES_OUTPUT.members["indices"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_INDICES_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_INDICES = APIOperation( + input=ListIndicesInput, + output=ListIndicesOutput, + schema=_SCHEMA_LIST_INDICES, + input_schema=_SCHEMA_LIST_INDICES_INPUT, + output_schema=_SCHEMA_LIST_INDICES_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class UpdateIndexInput: + """Dataclass for UpdateIndexInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application connected to the + index. + """ + + index_id: str | None = None + """The identifier of the Amazon Q Business index.""" + + display_name: str | None = None + """The name of the Amazon Q Business index.""" + + description: str | None = None + """The description of the Amazon Q Business index.""" + + capacity_configuration: IndexCapacityConfiguration | None = None + """ + The storage capacity units you want to provision for your Amazon Q + Business index. You can add and remove capacity to fit your usage needs. + """ + + document_attribute_configurations: list[DocumentAttributeConfiguration] | None = ( + None + ) + """ + Configuration information for document metadata or fields. Document + metadata are fields or attributes associated with your documents. For + example, the company department name associated with each document. For + more information, see [Understanding document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes). + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_INDEX_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_INDEX_INPUT.members["applicationId"], self.application_id + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_INDEX_INPUT.members["indexId"], self.index_id + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_UPDATE_INDEX_INPUT.members["displayName"], self.display_name + ) + + if self.description is not None: + serializer.write_string( + _SCHEMA_UPDATE_INDEX_INPUT.members["description"], self.description + ) + + if self.capacity_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_INDEX_INPUT.members["capacityConfiguration"], + self.capacity_configuration, + ) + + if self.document_attribute_configurations is not None: + _serialize_document_attribute_configurations( + serializer, + _SCHEMA_UPDATE_INDEX_INPUT.members["documentAttributeConfigurations"], + self.document_attribute_configurations, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_UPDATE_INDEX_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_UPDATE_INDEX_INPUT.members["indexId"] + ) + + case 2: + kwargs["display_name"] = de.read_string( + _SCHEMA_UPDATE_INDEX_INPUT.members["displayName"] + ) + + case 3: + kwargs["description"] = de.read_string( + _SCHEMA_UPDATE_INDEX_INPUT.members["description"] + ) + + case 4: + kwargs["capacity_configuration"] = ( + IndexCapacityConfiguration.deserialize(de) + ) + + case 5: + kwargs["document_attribute_configurations"] = ( + _deserialize_document_attribute_configurations( + de, + _SCHEMA_UPDATE_INDEX_INPUT.members[ + "documentAttributeConfigurations" + ], + ) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_INDEX_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class UpdateIndexOutput: + """Dataclass for UpdateIndexOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_INDEX_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_INDEX_OUTPUT, consumer=_consumer) + return kwargs + + +UPDATE_INDEX = APIOperation( + input=UpdateIndexInput, + output=UpdateIndexOutput, + schema=_SCHEMA_UPDATE_INDEX, + input_schema=_SCHEMA_UPDATE_INDEX_INPUT, + output_schema=_SCHEMA_UPDATE_INDEX_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListApplicationsInput: + """Dataclass for ListApplicationsInput structure.""" + + next_token: str | None = None + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business applications. + """ + + max_results: int | None = None + """The maximum number of Amazon Q Business applications to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_APPLICATIONS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_APPLICATIONS_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_APPLICATIONS_INPUT.members["maxResults"], self.max_results + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_APPLICATIONS_INPUT.members["nextToken"] + ) + + case 1: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_APPLICATIONS_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_APPLICATIONS_INPUT, consumer=_consumer) + return kwargs + + +def _serialize_applications( + serializer: ShapeSerializer, schema: Schema, value: list[Application] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_applications( + deserializer: ShapeDeserializer, schema: Schema +) -> list[Application]: + result: list[Application] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(Application.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ListApplicationsOutput: + """Dataclass for ListApplicationsOutput structure.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token. You + can use this token in a subsequent request to retrieve the next set of + applications. + """ + + applications: list[Application] | None = None + """ + An array of summary information on the configuration of one or more + Amazon Q Business applications. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_APPLICATIONS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_APPLICATIONS_OUTPUT.members["nextToken"], self.next_token + ) + + if self.applications is not None: + _serialize_applications( + serializer, + _SCHEMA_LIST_APPLICATIONS_OUTPUT.members["applications"], + self.applications, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_APPLICATIONS_OUTPUT.members["nextToken"] + ) + + case 1: + kwargs["applications"] = _deserialize_applications( + de, _SCHEMA_LIST_APPLICATIONS_OUTPUT.members["applications"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_APPLICATIONS_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_APPLICATIONS = APIOperation( + input=ListApplicationsInput, + output=ListApplicationsOutput, + schema=_SCHEMA_LIST_APPLICATIONS, + input_schema=_SCHEMA_LIST_APPLICATIONS_INPUT, + output_schema=_SCHEMA_LIST_APPLICATIONS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class BasicAuthConfiguration: + """ + Information about the basic authentication credentials used to configure + a plugin. + """ + + secret_arn: str + """ + The ARN of the Secrets Manager secret that stores the basic + authentication credentials used for plugin configuration.. + """ + + role_arn: str + """ + The ARN of an IAM role used by Amazon Q Business to access the basic + authentication credentials stored in a Secrets Manager secret. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_BASIC_AUTH_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_BASIC_AUTH_CONFIGURATION.members["secretArn"], self.secret_arn + ) + serializer.write_string( + _SCHEMA_BASIC_AUTH_CONFIGURATION.members["roleArn"], self.role_arn + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["secret_arn"] = de.read_string( + _SCHEMA_BASIC_AUTH_CONFIGURATION.members["secretArn"] + ) + + case 1: + kwargs["role_arn"] = de.read_string( + _SCHEMA_BASIC_AUTH_CONFIGURATION.members["roleArn"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_BASIC_AUTH_CONFIGURATION, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class IdcAuthConfiguration: + """ + Information about the IAM Identity Center Application used to configure + authentication for a plugin. + """ + + idc_application_arn: str + """ + The Amazon Resource Name (ARN) of the IAM Identity Center Application + used to configure authentication. + """ + + role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role with permissions to + perform actions on Amazon Web Services services on your behalf. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_IDC_AUTH_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_IDC_AUTH_CONFIGURATION.members["idcApplicationArn"], + self.idc_application_arn, + ) + serializer.write_string( + _SCHEMA_IDC_AUTH_CONFIGURATION.members["roleArn"], self.role_arn + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["idc_application_arn"] = de.read_string( + _SCHEMA_IDC_AUTH_CONFIGURATION.members["idcApplicationArn"] + ) + + case 1: + kwargs["role_arn"] = de.read_string( + _SCHEMA_IDC_AUTH_CONFIGURATION.members["roleArn"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_IDC_AUTH_CONFIGURATION, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class NoAuthConfiguration: + """ + Information about invoking a custom plugin without any authentication or + authorization requirement. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_NO_AUTH_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_NO_AUTH_CONFIGURATION, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class OAuth2ClientCredentialConfiguration: + """ + Information about the OAuth 2.0 authentication credential/token used to + configure a plugin. + """ + + secret_arn: str + """ + The ARN of the Secrets Manager secret that stores the OAuth 2.0 + credentials/token used for plugin configuration. + """ + + role_arn: str + """ + The ARN of an IAM role used by Amazon Q Business to access the OAuth 2.0 + authentication credentials stored in a Secrets Manager secret. + """ + + authorization_url: str | None = None + """ + The redirect URL required by the OAuth 2.0 protocol for Amazon Q + Business to authenticate a plugin user through a third party + authentication server. + """ + + token_url: str | None = None + """ + The URL required by the OAuth 2.0 protocol to exchange an end user + authorization code for an access token. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members["secretArn"], + self.secret_arn, + ) + serializer.write_string( + _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members["roleArn"], + self.role_arn, + ) + if self.authorization_url is not None: + serializer.write_string( + _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members[ + "authorizationUrl" + ], + self.authorization_url, + ) + + if self.token_url is not None: + serializer.write_string( + _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members["tokenUrl"], + self.token_url, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["secret_arn"] = de.read_string( + _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members[ + "secretArn" + ] + ) + + case 1: + kwargs["role_arn"] = de.read_string( + _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members[ + "roleArn" + ] + ) + + case 2: + kwargs["authorization_url"] = de.read_string( + _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members[ + "authorizationUrl" + ] + ) + + case 3: + kwargs["token_url"] = de.read_string( + _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members[ + "tokenUrl" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass +class PluginAuthConfigurationBasicAuthConfiguration: + """ + Information about the basic authentication credentials used to configure + a plugin. + """ + + value: BasicAuthConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PLUGIN_AUTH_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_PLUGIN_AUTH_CONFIGURATION.members["basicAuthConfiguration"], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=BasicAuthConfiguration.deserialize(deserializer)) + + +@dataclass +class PluginAuthConfigurationOAuth2ClientCredentialConfiguration: + """ + Information about the OAuth 2.0 authentication credential/token used to + configure a plugin. + """ + + value: OAuth2ClientCredentialConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PLUGIN_AUTH_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_PLUGIN_AUTH_CONFIGURATION.members[ + "oAuth2ClientCredentialConfiguration" + ], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=OAuth2ClientCredentialConfiguration.deserialize(deserializer)) + + +@dataclass +class PluginAuthConfigurationNoAuthConfiguration: + """Information about invoking a custom plugin without any authentication.""" + + value: NoAuthConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PLUGIN_AUTH_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_PLUGIN_AUTH_CONFIGURATION.members["noAuthConfiguration"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=NoAuthConfiguration.deserialize(deserializer)) + + +@dataclass +class PluginAuthConfigurationIdcAuthConfiguration: + """ + Information about the IAM Identity Center Application used to configure + authentication for a plugin. + """ + + value: IdcAuthConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PLUGIN_AUTH_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_PLUGIN_AUTH_CONFIGURATION.members["idcAuthConfiguration"], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=IdcAuthConfiguration.deserialize(deserializer)) + + +@dataclass +class PluginAuthConfigurationUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +PluginAuthConfiguration = Union[ + PluginAuthConfigurationBasicAuthConfiguration + | PluginAuthConfigurationOAuth2ClientCredentialConfiguration + | PluginAuthConfigurationNoAuthConfiguration + | PluginAuthConfigurationIdcAuthConfiguration + | PluginAuthConfigurationUnknown +] +""" +Authentication configuration information for an Amazon Q Business +plugin. +""" + + +class _PluginAuthConfigurationDeserializer: + _result: PluginAuthConfiguration | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> PluginAuthConfiguration: + self._result = None + deserializer.read_struct(_SCHEMA_PLUGIN_AUTH_CONFIGURATION, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result( + PluginAuthConfigurationBasicAuthConfiguration.deserialize(de) + ) + + case 1: + self._set_result( + PluginAuthConfigurationOAuth2ClientCredentialConfiguration.deserialize( + de + ) + ) + + case 2: + self._set_result( + PluginAuthConfigurationNoAuthConfiguration.deserialize(de) + ) + + case 3: + self._set_result( + PluginAuthConfigurationIdcAuthConfiguration.deserialize(de) + ) + + case _: + self._set_result( + PluginAuthConfigurationUnknown(tag=schema.expect_member_name()) + ) + + def _set_result(self, value: PluginAuthConfiguration) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +@dataclass(kw_only=True) +class CustomPluginConfiguration: + """Configuration information required to create a custom plugin.""" + + description: str + """A description for your custom plugin configuration.""" + + api_schema_type: str + """The type of OpenAPI schema to use.""" + + api_schema: APISchema | None = None + """ + Contains either details about the S3 object containing the OpenAPI + schema for the action group or the JSON or YAML-formatted payload + defining the schema. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CUSTOM_PLUGIN_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION.members["description"], self.description + ) + serializer.write_string( + _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION.members["apiSchemaType"], + self.api_schema_type, + ) + if self.api_schema is not None: + serializer.write_struct( + _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION.members["apiSchema"], + self.api_schema, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["description"] = de.read_string( + _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION.members["description"] + ) + + case 1: + kwargs["api_schema_type"] = de.read_string( + _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION.members["apiSchemaType"] + ) + + case 2: + kwargs["api_schema"] = _APISchemaDeserializer().deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class CreatePluginInput: + """Dataclass for CreatePluginInput structure.""" + + application_id: str | None = None + """The identifier of the application that will contain the plugin.""" + + display_name: str | None = None + """A the name for your plugin.""" + + type: str | None = None + """The type of plugin you want to create.""" + + auth_configuration: PluginAuthConfiguration | None = None + """ + Authentication configuration information for an Amazon Q Business + plugin. + """ + + server_url: str | None = None + """The source URL used for plugin configuration.""" + + custom_plugin_configuration: CustomPluginConfiguration | None = None + """Contains configuration for a custom plugin.""" + + tags: list[Tag] | None = None + """ + A list of key-value pairs that identify or categorize the data source + connector. You can also use tags to help control access to the data + source connector. Tag keys and values can consist of Unicode letters, + digits, white space, and any of the following symbols: _ . : / = + - @. + """ + + client_token: str | None = None + """ + A token that you provide to identify the request to create your Amazon Q + Business plugin. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_PLUGIN_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CREATE_PLUGIN_INPUT.members["applicationId"], + self.application_id, + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_CREATE_PLUGIN_INPUT.members["displayName"], self.display_name + ) + + if self.type is not None: + serializer.write_string( + _SCHEMA_CREATE_PLUGIN_INPUT.members["type"], self.type + ) + + if self.auth_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_PLUGIN_INPUT.members["authConfiguration"], + self.auth_configuration, + ) + + if self.server_url is not None: + serializer.write_string( + _SCHEMA_CREATE_PLUGIN_INPUT.members["serverUrl"], self.server_url + ) + + if self.custom_plugin_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_PLUGIN_INPUT.members["customPluginConfiguration"], + self.custom_plugin_configuration, + ) + + if self.tags is not None: + _serialize_tags( + serializer, _SCHEMA_CREATE_PLUGIN_INPUT.members["tags"], self.tags + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CREATE_PLUGIN_INPUT.members["clientToken"], self.client_token + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CREATE_PLUGIN_INPUT.members["applicationId"] + ) + + case 1: + kwargs["display_name"] = de.read_string( + _SCHEMA_CREATE_PLUGIN_INPUT.members["displayName"] + ) + + case 2: + kwargs["type"] = de.read_string( + _SCHEMA_CREATE_PLUGIN_INPUT.members["type"] + ) + + case 3: + kwargs["auth_configuration"] = ( + _PluginAuthConfigurationDeserializer().deserialize(de) + ) + + case 4: + kwargs["server_url"] = de.read_string( + _SCHEMA_CREATE_PLUGIN_INPUT.members["serverUrl"] + ) + + case 5: + kwargs["custom_plugin_configuration"] = ( + CustomPluginConfiguration.deserialize(de) + ) + + case 6: + kwargs["tags"] = _deserialize_tags( + de, _SCHEMA_CREATE_PLUGIN_INPUT.members["tags"] + ) + + case 7: + kwargs["client_token"] = de.read_string( + _SCHEMA_CREATE_PLUGIN_INPUT.members["clientToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_PLUGIN_INPUT, consumer=_consumer) + return kwargs + + +class PluginBuildStatus(StrEnum): + READY = "READY" + CREATE_IN_PROGRESS = "CREATE_IN_PROGRESS" + CREATE_FAILED = "CREATE_FAILED" + UPDATE_IN_PROGRESS = "UPDATE_IN_PROGRESS" + UPDATE_FAILED = "UPDATE_FAILED" + DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + DELETE_FAILED = "DELETE_FAILED" + + +@dataclass(kw_only=True) +class CreatePluginOutput: + """Dataclass for CreatePluginOutput structure.""" + + plugin_id: str | None = None + """The identifier of the plugin created.""" + + plugin_arn: str | None = None + """The Amazon Resource Name (ARN) of a plugin.""" + + build_status: str | None = None + """The current status of a plugin. A plugin is modified asynchronously.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_PLUGIN_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.plugin_id is not None: + serializer.write_string( + _SCHEMA_CREATE_PLUGIN_OUTPUT.members["pluginId"], self.plugin_id + ) + + if self.plugin_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_PLUGIN_OUTPUT.members["pluginArn"], self.plugin_arn + ) + + if self.build_status is not None: + serializer.write_string( + _SCHEMA_CREATE_PLUGIN_OUTPUT.members["buildStatus"], self.build_status + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_CREATE_PLUGIN_OUTPUT.members["pluginId"] + ) + + case 1: + kwargs["plugin_arn"] = de.read_string( + _SCHEMA_CREATE_PLUGIN_OUTPUT.members["pluginArn"] + ) + + case 2: + kwargs["build_status"] = de.read_string( + _SCHEMA_CREATE_PLUGIN_OUTPUT.members["buildStatus"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_PLUGIN_OUTPUT, consumer=_consumer) + return kwargs + + +CREATE_PLUGIN = APIOperation( + input=CreatePluginInput, + output=CreatePluginOutput, + schema=_SCHEMA_CREATE_PLUGIN, + input_schema=_SCHEMA_CREATE_PLUGIN_INPUT, + output_schema=_SCHEMA_CREATE_PLUGIN_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DeletePluginInput: + """Dataclass for DeletePluginInput structure.""" + + application_id: str | None = None + """The identifier the application attached to the Amazon Q Business plugin.""" + + plugin_id: str | None = None + """The identifier of the plugin being deleted.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_PLUGIN_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_PLUGIN_INPUT.members["applicationId"], + self.application_id, + ) + + if self.plugin_id is not None: + serializer.write_string( + _SCHEMA_DELETE_PLUGIN_INPUT.members["pluginId"], self.plugin_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_PLUGIN_INPUT.members["applicationId"] + ) + + case 1: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_DELETE_PLUGIN_INPUT.members["pluginId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_PLUGIN_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DeletePluginOutput: + """Dataclass for DeletePluginOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_PLUGIN_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_PLUGIN_OUTPUT, consumer=_consumer) + return kwargs + + +DELETE_PLUGIN = APIOperation( + input=DeletePluginInput, + output=DeletePluginOutput, + schema=_SCHEMA_DELETE_PLUGIN, + input_schema=_SCHEMA_DELETE_PLUGIN_INPUT, + output_schema=_SCHEMA_DELETE_PLUGIN_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetPluginInput: + """Dataclass for GetPluginInput structure.""" + + application_id: str | None = None + """The identifier of the application which contains the plugin.""" + + plugin_id: str | None = None + """The identifier of the plugin.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_PLUGIN_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_PLUGIN_INPUT.members["applicationId"], self.application_id + ) + + if self.plugin_id is not None: + serializer.write_string( + _SCHEMA_GET_PLUGIN_INPUT.members["pluginId"], self.plugin_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_PLUGIN_INPUT.members["applicationId"] + ) + + case 1: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_GET_PLUGIN_INPUT.members["pluginId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_PLUGIN_INPUT, consumer=_consumer) + return kwargs + + +class PluginState(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +@dataclass(kw_only=True) +class GetPluginOutput: + """Dataclass for GetPluginOutput structure.""" + + application_id: str | None = None + """The identifier of the application which contains the plugin.""" + + plugin_id: str | None = None + """The identifier of the plugin.""" + + display_name: str | None = None + """The name of the plugin.""" + + type: str | None = None + """The type of the plugin.""" + + server_url: str | None = None + """The source URL used for plugin configuration.""" + + auth_configuration: PluginAuthConfiguration | None = None + """ + Authentication configuration information for an Amazon Q Business + plugin. + """ + + custom_plugin_configuration: CustomPluginConfiguration | None = None + """Configuration information required to create a custom plugin.""" + + build_status: str | None = None + """The current status of a plugin. A plugin is modified asynchronously.""" + + plugin_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the role with permission to access + resources needed to create the plugin. + """ + + state: str | None = None + """The current state of the plugin.""" + + created_at: datetime | None = None + """The timestamp for when the plugin was created.""" + + updated_at: datetime | None = None + """The timestamp for when the plugin was last updated.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_PLUGIN_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["applicationId"], self.application_id + ) + + if self.plugin_id is not None: + serializer.write_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["pluginId"], self.plugin_id + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["displayName"], self.display_name + ) + + if self.type is not None: + serializer.write_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["type"], self.type + ) + + if self.server_url is not None: + serializer.write_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["serverUrl"], self.server_url + ) + + if self.auth_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_PLUGIN_OUTPUT.members["authConfiguration"], + self.auth_configuration, + ) + + if self.custom_plugin_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_PLUGIN_OUTPUT.members["customPluginConfiguration"], + self.custom_plugin_configuration, + ) + + if self.build_status is not None: + serializer.write_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["buildStatus"], self.build_status + ) + + if self.plugin_arn is not None: + serializer.write_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["pluginArn"], self.plugin_arn + ) + + if self.state is not None: + serializer.write_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["state"], self.state + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_PLUGIN_OUTPUT.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_PLUGIN_OUTPUT.members["updatedAt"], self.updated_at + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["applicationId"] + ) + + case 1: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["pluginId"] + ) + + case 2: + kwargs["display_name"] = de.read_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["displayName"] + ) + + case 3: + kwargs["type"] = de.read_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["type"] + ) + + case 4: + kwargs["server_url"] = de.read_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["serverUrl"] + ) + + case 5: + kwargs["auth_configuration"] = ( + _PluginAuthConfigurationDeserializer().deserialize(de) + ) + + case 6: + kwargs["custom_plugin_configuration"] = ( + CustomPluginConfiguration.deserialize(de) + ) + + case 7: + kwargs["build_status"] = de.read_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["buildStatus"] + ) + + case 8: + kwargs["plugin_arn"] = de.read_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["pluginArn"] + ) + + case 9: + kwargs["state"] = de.read_string( + _SCHEMA_GET_PLUGIN_OUTPUT.members["state"] + ) + + case 10: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_GET_PLUGIN_OUTPUT.members["createdAt"] + ) + + case 11: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_GET_PLUGIN_OUTPUT.members["updatedAt"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_PLUGIN_OUTPUT, consumer=_consumer) + return kwargs + + +GET_PLUGIN = APIOperation( + input=GetPluginInput, + output=GetPluginOutput, + schema=_SCHEMA_GET_PLUGIN, + input_schema=_SCHEMA_GET_PLUGIN_INPUT, + output_schema=_SCHEMA_GET_PLUGIN_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListPluginsInput: + """Dataclass for ListPluginsInput structure.""" + + application_id: str | None = None + """The identifier of the application the plugin is attached to.""" + + next_token: str | None = None + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + plugins. + """ + + max_results: int | None = None + """The maximum number of documents to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_PLUGINS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGINS_INPUT.members["applicationId"], self.application_id + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGINS_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_PLUGINS_INPUT.members["maxResults"], self.max_results + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_PLUGINS_INPUT.members["applicationId"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_PLUGINS_INPUT.members["nextToken"] + ) + + case 2: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_PLUGINS_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_PLUGINS_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class Plugin: + """Information about an Amazon Q Business plugin and its configuration.""" + + plugin_id: str | None = None + """The identifier of the plugin.""" + + display_name: str | None = None + """The name of the plugin.""" + + type: str | None = None + """The type of the plugin.""" + + server_url: str | None = None + """The plugin server URL used for configuration.""" + + state: str | None = None + """The current status of the plugin.""" + + build_status: str | None = None + """The status of the plugin.""" + + created_at: datetime | None = None + """The timestamp for when the plugin was created.""" + + updated_at: datetime | None = None + """The timestamp for when the plugin was last updated.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PLUGIN, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.plugin_id is not None: + serializer.write_string(_SCHEMA_PLUGIN.members["pluginId"], self.plugin_id) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_PLUGIN.members["displayName"], self.display_name + ) + + if self.type is not None: + serializer.write_string(_SCHEMA_PLUGIN.members["type"], self.type) + + if self.server_url is not None: + serializer.write_string( + _SCHEMA_PLUGIN.members["serverUrl"], self.server_url + ) + + if self.state is not None: + serializer.write_string(_SCHEMA_PLUGIN.members["state"], self.state) + + if self.build_status is not None: + serializer.write_string( + _SCHEMA_PLUGIN.members["buildStatus"], self.build_status + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_PLUGIN.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_PLUGIN.members["updatedAt"], self.updated_at + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_PLUGIN.members["pluginId"] + ) + + case 1: + kwargs["display_name"] = de.read_string( + _SCHEMA_PLUGIN.members["displayName"] + ) + + case 2: + kwargs["type"] = de.read_string(_SCHEMA_PLUGIN.members["type"]) + + case 3: + kwargs["server_url"] = de.read_string( + _SCHEMA_PLUGIN.members["serverUrl"] + ) + + case 4: + kwargs["state"] = de.read_string(_SCHEMA_PLUGIN.members["state"]) + + case 5: + kwargs["build_status"] = de.read_string( + _SCHEMA_PLUGIN.members["buildStatus"] + ) + + case 6: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_PLUGIN.members["createdAt"] + ) + + case 7: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_PLUGIN.members["updatedAt"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_PLUGIN, consumer=_consumer) + return kwargs + + +def _serialize_plugins( + serializer: ShapeSerializer, schema: Schema, value: list[Plugin] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_plugins( + deserializer: ShapeDeserializer, schema: Schema +) -> list[Plugin]: + result: list[Plugin] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(Plugin.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ListPluginsOutput: + """Dataclass for ListPluginsOutput structure.""" + + next_token: str | None = None + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + plugins. + """ + + plugins: list[Plugin] | None = None + """Information about a configured plugin.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_PLUGINS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGINS_OUTPUT.members["nextToken"], self.next_token + ) + + if self.plugins is not None: + _serialize_plugins( + serializer, _SCHEMA_LIST_PLUGINS_OUTPUT.members["plugins"], self.plugins + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_PLUGINS_OUTPUT.members["nextToken"] + ) + + case 1: + kwargs["plugins"] = _deserialize_plugins( + de, _SCHEMA_LIST_PLUGINS_OUTPUT.members["plugins"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_PLUGINS_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_PLUGINS = APIOperation( + input=ListPluginsInput, + output=ListPluginsOutput, + schema=_SCHEMA_LIST_PLUGINS, + input_schema=_SCHEMA_LIST_PLUGINS_INPUT, + output_schema=_SCHEMA_LIST_PLUGINS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class UpdatePluginInput: + """Dataclass for UpdatePluginInput structure.""" + + application_id: str | None = None + """The identifier of the application the plugin is attached to.""" + + plugin_id: str | None = None + """The identifier of the plugin.""" + + display_name: str | None = None + """The name of the plugin.""" + + state: str | None = None + """The status of the plugin.""" + + server_url: str | None = None + """The source URL used for plugin configuration.""" + + custom_plugin_configuration: CustomPluginConfiguration | None = None + """The configuration for a custom plugin.""" + + auth_configuration: PluginAuthConfiguration | None = None + """The authentication configuration the plugin is using.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_PLUGIN_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["applicationId"], + self.application_id, + ) + + if self.plugin_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["pluginId"], self.plugin_id + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["displayName"], self.display_name + ) + + if self.state is not None: + serializer.write_string( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["state"], self.state + ) + + if self.server_url is not None: + serializer.write_string( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["serverUrl"], self.server_url + ) + + if self.custom_plugin_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["customPluginConfiguration"], + self.custom_plugin_configuration, + ) + + if self.auth_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["authConfiguration"], + self.auth_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["applicationId"] + ) + + case 1: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["pluginId"] + ) + + case 2: + kwargs["display_name"] = de.read_string( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["displayName"] + ) + + case 3: + kwargs["state"] = de.read_string( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["state"] + ) + + case 4: + kwargs["server_url"] = de.read_string( + _SCHEMA_UPDATE_PLUGIN_INPUT.members["serverUrl"] + ) + + case 5: + kwargs["custom_plugin_configuration"] = ( + CustomPluginConfiguration.deserialize(de) + ) + + case 6: + kwargs["auth_configuration"] = ( + _PluginAuthConfigurationDeserializer().deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_PLUGIN_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class UpdatePluginOutput: + """Dataclass for UpdatePluginOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_PLUGIN_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_PLUGIN_OUTPUT, consumer=_consumer) + return kwargs + + +UPDATE_PLUGIN = APIOperation( + input=UpdatePluginInput, + output=UpdatePluginOutput, + schema=_SCHEMA_UPDATE_PLUGIN, + input_schema=_SCHEMA_UPDATE_PLUGIN_INPUT, + output_schema=_SCHEMA_UPDATE_PLUGIN_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class KendraIndexConfiguration: + """Stores an Amazon Kendra index as a retriever.""" + + index_id: str + """The identifier of the Amazon Kendra index.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_KENDRA_INDEX_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_KENDRA_INDEX_CONFIGURATION.members["indexId"], self.index_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["index_id"] = de.read_string( + _SCHEMA_KENDRA_INDEX_CONFIGURATION.members["indexId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_KENDRA_INDEX_CONFIGURATION, consumer=_consumer) + return kwargs + + +class DocumentAttributeBoostingLevel(StrEnum): + NONE = "NONE" + LOW = "LOW" + MEDIUM = "MEDIUM" + HIGH = "HIGH" + VERY_HIGH = "VERY_HIGH" + ONE = "ONE" + TWO = "TWO" + + +@dataclass(kw_only=True) +class DateAttributeBoostingConfiguration: + """ + Provides information on boosting `DATE` type document attributes. + + For more information on how boosting document attributes work in Amazon + Q Business, see [Boosting using document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). + """ + + boosting_level: str + """ + Specifies the priority tier ranking of boosting applied to document + attributes. For version 2, this parameter indicates the relative ranking + between boosted fields (ONE being highest priority, TWO being second + highest, etc.) and determines the order in which attributes influence + document ranking in search results. For version 1, this parameter + specifies the boosting intensity. For version 2, boosting intensity + (VERY HIGH, HIGH, MEDIUM, LOW, NONE) are not supported. Note that in + version 2, you are not allowed to boost on only one field and make this + value TWO. + """ + + boosting_duration_in_seconds: int | None = None + """ + Specifies the duration, in seconds, of a boost applies to a `DATE` type + document attribute. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION.members["boostingLevel"], + self.boosting_level, + ) + if self.boosting_duration_in_seconds is not None: + serializer.write_long( + _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "boostingDurationInSeconds" + ], + self.boosting_duration_in_seconds, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["boosting_level"] = de.read_string( + _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "boostingLevel" + ] + ) + + case 1: + kwargs["boosting_duration_in_seconds"] = de.read_long( + _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "boostingDurationInSeconds" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class NumberAttributeBoostingType(StrEnum): + PRIORITIZE_LARGER_VALUES = "PRIORITIZE_LARGER_VALUES" + PRIORITIZE_SMALLER_VALUES = "PRIORITIZE_SMALLER_VALUES" + + +@dataclass(kw_only=True) +class NumberAttributeBoostingConfiguration: + """ + Provides information on boosting `NUMBER` type document attributes. + + In the current boosting implementation, boosting focuses primarily on + `DATE` attributes for recency and `STRING` attributes for source + prioritization. `NUMBER` attributes can serve as additional boosting + factors when needed, but are not supported when using + `NativeIndexConfiguration` version 2. + + For more information on how boosting document attributes work in Amazon + Q Business, see [Boosting using document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). + """ + + boosting_level: str + """ + Specifies the priority of boosted document attributes in relation to + other boosted attributes. This parameter determines how strongly the + attribute influences document ranking in search results. `NUMBER` + attributes can serve as additional boosting factors when needed, but are + not supported when using `NativeIndexConfiguration` version 2. + """ + + boosting_type: str | None = None + """ + Specifies whether higher or lower numeric values should be prioritized + when boosting. Valid values are ASCENDING (higher numbers are more + important) and DESCENDING (lower numbers are more important). + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION.members["boostingLevel"], + self.boosting_level, + ) + if self.boosting_type is not None: + serializer.write_string( + _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION.members["boostingType"], + self.boosting_type, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["boosting_level"] = de.read_string( + _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "boostingLevel" + ] + ) + + case 1: + kwargs["boosting_type"] = de.read_string( + _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "boostingType" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class StringAttributeValueBoostingLevel(StrEnum): + LOW = "LOW" + MEDIUM = "MEDIUM" + HIGH = "HIGH" + VERY_HIGH = "VERY_HIGH" + ONE = "ONE" + TWO = "TWO" + THREE = "THREE" + FOUR = "FOUR" + FIVE = "FIVE" + + +def _serialize_string_attribute_value_boosting( + serializer: ShapeSerializer, schema: Schema, value: dict[str, str] +) -> None: + with serializer.begin_map(schema, len(value)) as m: + value_schema = schema.members["value"] + for k, v in value.items(): + m.entry(k, lambda vs: vs.write_string(value_schema, v)) + + +def _deserialize_string_attribute_value_boosting( + deserializer: ShapeDeserializer, schema: Schema +) -> dict[str, str]: + result: dict[str, str] = {} + value_schema = schema.members["value"] + + def _read_value(k: str, d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result[k] = d.read_string(value_schema) + + deserializer.read_map(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class StringAttributeBoostingConfiguration: + """ + Provides information on boosting `STRING` type document attributes. + + Note: + For `STRING` and `STRING_LIST` type document attributes to be used for + boosting on the console and the API, they must be enabled for search + using the + [DocumentAttributeConfiguration](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeConfiguration.html) + object of the + [UpdateIndex](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateIndex.html) + API. If you haven't enabled searching on these attributes, you can't + boost attributes of these data types on either the console or the API. + + For more information on how boosting document attributes work in Amazon + Q Business, see [Boosting using document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). + """ + + boosting_level: str + """ + Specifies the priority tier ranking of boosting applied to document + attributes. For version 2, this parameter indicates the relative ranking + between boosted fields (ONE being highest priority, TWO being second + highest, etc.) and determines the order in which attributes influence + document ranking in search results. For version 1, this parameter + specifies the boosting intensity. For version 2, boosting intensity + (VERY HIGH, HIGH, MEDIUM, LOW, NONE) are not supported. Note that in + version 2, you are not allowed to boost on only one field and make this + value TWO. + """ + + attribute_value_boosting: dict[str, str] | None = None + """ + Specifies specific values of a `STRING` type document attribute being + boosted. When using `NativeIndexConfiguration` version 2, you can + specify up to five values in order of priority. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION.members["boostingLevel"], + self.boosting_level, + ) + if self.attribute_value_boosting is not None: + _serialize_string_attribute_value_boosting( + serializer, + _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "attributeValueBoosting" + ], + self.attribute_value_boosting, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["boosting_level"] = de.read_string( + _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "boostingLevel" + ] + ) + + case 1: + kwargs["attribute_value_boosting"] = ( + _deserialize_string_attribute_value_boosting( + de, + _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "attributeValueBoosting" + ], + ) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class StringListAttributeBoostingConfiguration: + """ + Provides information on boosting `STRING_LIST` type document attributes. + + In the current boosting implementation, boosting focuses primarily on + `DATE` attributes for recency and `STRING` attributes for source + prioritization. `STRING_LIST` attributes can serve as additional + boosting factors when needed, but are not supported when using + `NativeIndexConfiguration` version 2. + + Note: + For `STRING` and `STRING_LIST` type document attributes to be used for + boosting on the console and the API, they must be enabled for search + using the + [DocumentAttributeConfiguration](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeConfiguration.html) + object of the + [UpdateIndex](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateIndex.html) + API. If you haven't enabled searching on these attributes, you can't + boost attributes of these data types on either the console or the API. + + For more information on how boosting document attributes work in Amazon + Q Business, see [Boosting using document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). + """ + + boosting_level: str + """ + Specifies the priority of boosted document attributes in relation to + other boosted attributes. This parameter determines how strongly the + attribute influences document ranking in search results. `STRING_LIST` + attributes can serve as additional boosting factors when needed, but are + not supported when using `NativeIndexConfiguration` version 2. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION, self + ) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "boostingLevel" + ], + self.boosting_level, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["boosting_level"] = de.read_string( + _SCHEMA_STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "boostingLevel" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass +class DocumentAttributeBoostingConfigurationNumberConfiguration: + """ + Provides information on boosting `NUMBER` type document attributes. + + `NUMBER` attributes are not supported when using + `NativeIndexConfiguration` version 2, which focuses on `DATE` attributes + for recency and `STRING` attributes for source prioritization. + """ + + value: NumberAttributeBoostingConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "numberConfiguration" + ], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=NumberAttributeBoostingConfiguration.deserialize(deserializer)) + + +@dataclass +class DocumentAttributeBoostingConfigurationStringConfiguration: + """ + Provides information on boosting `STRING` type document attributes. + + Version 2 assigns priority tiers to `STRING` attributes, establishing + clear hierarchical relationships with other boosted attributes. + """ + + value: StringAttributeBoostingConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "stringConfiguration" + ], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=StringAttributeBoostingConfiguration.deserialize(deserializer)) + + +@dataclass +class DocumentAttributeBoostingConfigurationDateConfiguration: + """ + Provides information on boosting `DATE` type document attributes. + + Version 2 assigns priority tiers to `DATE` attributes, establishing + clear hierarchical relationships with other boosted attributes. + """ + + value: DateAttributeBoostingConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "dateConfiguration" + ], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=DateAttributeBoostingConfiguration.deserialize(deserializer)) + + +@dataclass +class DocumentAttributeBoostingConfigurationStringListConfiguration: + """ + Provides information on boosting `STRING_LIST` type document attributes. + + `STRING_LIST` attributes are not supported when using + `NativeIndexConfiguration` version 2, which focuses on `DATE` attributes + for recency and `STRING` attributes for source prioritization. + """ + + value: StringListAttributeBoostingConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ + "stringListConfiguration" + ], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls( + value=StringListAttributeBoostingConfiguration.deserialize(deserializer) + ) + + +@dataclass +class DocumentAttributeBoostingConfigurationUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +DocumentAttributeBoostingConfiguration = Union[ + DocumentAttributeBoostingConfigurationNumberConfiguration + | DocumentAttributeBoostingConfigurationStringConfiguration + | DocumentAttributeBoostingConfigurationDateConfiguration + | DocumentAttributeBoostingConfigurationStringListConfiguration + | DocumentAttributeBoostingConfigurationUnknown +] +""" +Provides information on boosting supported Amazon Q Business document +attribute types. When an end user chat query matches document attributes +that have been boosted, Amazon Q Business prioritizes generating +responses from content that matches the boosted document attributes. + +In version 2, boosting uses numeric values (ONE, TWO) to indicate +priority tiers that establish clear hierarchical relationships between +boosted attributes. This allows for more precise control over how +different attributes influence search results. + +Note: + For `STRING` and `STRING_LIST` type document attributes to be used for + boosting on the console and the API, they must be enabled for search + using the + [DocumentAttributeConfiguration](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeConfiguration.html) + object of the + [UpdateIndex](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateIndex.html) + API. If you haven't enabled searching on these attributes, you can't + boost attributes of these data types on either the console or the API. + +For more information on how boosting document attributes work in Amazon +Q Business, see [Boosting using document +attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). +""" + + +class _DocumentAttributeBoostingConfigurationDeserializer: + _result: DocumentAttributeBoostingConfiguration | None = None + + def deserialize( + self, deserializer: ShapeDeserializer + ) -> DocumentAttributeBoostingConfiguration: + self._result = None + deserializer.read_struct( + _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, self._consumer + ) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result( + DocumentAttributeBoostingConfigurationNumberConfiguration.deserialize( + de + ) + ) + + case 1: + self._set_result( + DocumentAttributeBoostingConfigurationStringConfiguration.deserialize( + de + ) + ) + + case 2: + self._set_result( + DocumentAttributeBoostingConfigurationDateConfiguration.deserialize( + de + ) + ) + + case 3: + self._set_result( + DocumentAttributeBoostingConfigurationStringListConfiguration.deserialize( + de + ) + ) + + case _: + self._set_result( + DocumentAttributeBoostingConfigurationUnknown( + tag=schema.expect_member_name() + ) + ) + + def _set_result(self, value: DocumentAttributeBoostingConfiguration) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +def _serialize_document_attribute_boosting_override_map( + serializer: ShapeSerializer, + schema: Schema, + value: dict[str, DocumentAttributeBoostingConfiguration], +) -> None: + with serializer.begin_map(schema, len(value)) as m: + value_schema = schema.members["value"] + for k, v in value.items(): + m.entry(k, lambda vs: vs.write_struct(value_schema, v)) + + +def _deserialize_document_attribute_boosting_override_map( + deserializer: ShapeDeserializer, schema: Schema +) -> dict[str, DocumentAttributeBoostingConfiguration]: + result: dict[str, DocumentAttributeBoostingConfiguration] = {} + value_schema = schema.members["value"] + + def _read_value(k: str, d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result[k] = ( + _DocumentAttributeBoostingConfigurationDeserializer().deserialize(d) + ) + + deserializer.read_map(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class NativeIndexConfiguration: + """Configuration information for an Amazon Q Business index.""" + + index_id: str + """The identifier for the Amazon Q Business index.""" + + version: int | None = None + """ + A read-only field that specifies the version of the + `NativeIndexConfiguration`. + + Amazon Q Business introduces enhanced document retrieval capabilities in + version 2 of `NativeIndexConfiguration`, focusing on streamlined + metadata boosting that prioritizes recency and source relevance to + deliver more accurate responses to your queries. Version 2 has the + following differences from version 1: + + - Version 2 supports a single Date field (created_at OR last_updated_at) + for recency boosting + + - Version 2 supports a single String field with an ordered list of up to + 5 values + + - Version 2 introduces number-based boost levels (ONE, TWO) alongside + the text-based levels + + - Version 2 allows specifying prioritization between Date and String + fields + + - Version 2 maintains backward compatibility with existing + configurations + """ + + boosting_override: dict[str, DocumentAttributeBoostingConfiguration] | None = None + """ + Overrides the default boosts applied by Amazon Q Business to supported + document attribute data types. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_NATIVE_INDEX_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_NATIVE_INDEX_CONFIGURATION.members["indexId"], self.index_id + ) + if self.version is not None: + serializer.write_long( + _SCHEMA_NATIVE_INDEX_CONFIGURATION.members["version"], self.version + ) + + if self.boosting_override is not None: + _serialize_document_attribute_boosting_override_map( + serializer, + _SCHEMA_NATIVE_INDEX_CONFIGURATION.members["boostingOverride"], + self.boosting_override, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["index_id"] = de.read_string( + _SCHEMA_NATIVE_INDEX_CONFIGURATION.members["indexId"] + ) + + case 1: + kwargs["version"] = de.read_long( + _SCHEMA_NATIVE_INDEX_CONFIGURATION.members["version"] + ) + + case 2: + kwargs["boosting_override"] = ( + _deserialize_document_attribute_boosting_override_map( + de, + _SCHEMA_NATIVE_INDEX_CONFIGURATION.members[ + "boostingOverride" + ], + ) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_NATIVE_INDEX_CONFIGURATION, consumer=_consumer) + return kwargs + + +@dataclass +class RetrieverConfigurationNativeIndexConfiguration: + """ + Provides information on how a Amazon Q Business index used as a + retriever for your Amazon Q Business application is configured. + """ + + value: NativeIndexConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RETRIEVER_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_RETRIEVER_CONFIGURATION.members["nativeIndexConfiguration"], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=NativeIndexConfiguration.deserialize(deserializer)) + + +@dataclass +class RetrieverConfigurationKendraIndexConfiguration: + """ + Provides information on how the Amazon Kendra index used as a retriever + for your Amazon Q Business application is configured. + """ + + value: KendraIndexConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RETRIEVER_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_RETRIEVER_CONFIGURATION.members["kendraIndexConfiguration"], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=KendraIndexConfiguration.deserialize(deserializer)) + + +@dataclass +class RetrieverConfigurationUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +RetrieverConfiguration = Union[ + RetrieverConfigurationNativeIndexConfiguration + | RetrieverConfigurationKendraIndexConfiguration + | RetrieverConfigurationUnknown +] +""" +Provides information on how the retriever used for your Amazon Q +Business application is configured. +""" + + +class _RetrieverConfigurationDeserializer: + _result: RetrieverConfiguration | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> RetrieverConfiguration: + self._result = None + deserializer.read_struct(_SCHEMA_RETRIEVER_CONFIGURATION, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result( + RetrieverConfigurationNativeIndexConfiguration.deserialize(de) + ) + + case 1: + self._set_result( + RetrieverConfigurationKendraIndexConfiguration.deserialize(de) + ) + + case _: + self._set_result( + RetrieverConfigurationUnknown(tag=schema.expect_member_name()) + ) + + def _set_result(self, value: RetrieverConfiguration) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +class RetrieverType(StrEnum): + NATIVE_INDEX = "NATIVE_INDEX" + KENDRA_INDEX = "KENDRA_INDEX" + + +@dataclass(kw_only=True) +class CreateRetrieverInput: + """Dataclass for CreateRetrieverInput structure.""" + + application_id: str | None = None + """The identifier of your Amazon Q Business application.""" + + type: str | None = None + """The type of retriever you are using.""" + + display_name: str | None = None + """The name of your retriever.""" + + configuration: RetrieverConfiguration | None = None + """ + Provides information on how the retriever used for your Amazon Q + Business application is configured. + """ + + role_arn: str | None = None + """ + The ARN of an IAM role used by Amazon Q Business to access the basic + authentication credentials stored in a Secrets Manager secret. + """ + + client_token: str | None = None + """ + A token that you provide to identify the request to create your Amazon Q + Business application retriever. + """ + + tags: list[Tag] | None = None + """ + A list of key-value pairs that identify or categorize the retriever. You + can also use tags to help control access to the retriever. Tag keys and + values can consist of Unicode letters, digits, white space, and any of + the following symbols: _ . : / = + - @. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_RETRIEVER_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CREATE_RETRIEVER_INPUT.members["applicationId"], + self.application_id, + ) + + if self.type is not None: + serializer.write_string( + _SCHEMA_CREATE_RETRIEVER_INPUT.members["type"], self.type + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_CREATE_RETRIEVER_INPUT.members["displayName"], self.display_name + ) + + if self.configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_RETRIEVER_INPUT.members["configuration"], + self.configuration, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_RETRIEVER_INPUT.members["roleArn"], self.role_arn + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CREATE_RETRIEVER_INPUT.members["clientToken"], self.client_token + ) + + if self.tags is not None: + _serialize_tags( + serializer, _SCHEMA_CREATE_RETRIEVER_INPUT.members["tags"], self.tags + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CREATE_RETRIEVER_INPUT.members["applicationId"] + ) + + case 1: + kwargs["type"] = de.read_string( + _SCHEMA_CREATE_RETRIEVER_INPUT.members["type"] + ) + + case 2: + kwargs["display_name"] = de.read_string( + _SCHEMA_CREATE_RETRIEVER_INPUT.members["displayName"] + ) + + case 3: + kwargs["configuration"] = ( + _RetrieverConfigurationDeserializer().deserialize(de) + ) + + case 4: + kwargs["role_arn"] = de.read_string( + _SCHEMA_CREATE_RETRIEVER_INPUT.members["roleArn"] + ) + + case 5: + kwargs["client_token"] = de.read_string( + _SCHEMA_CREATE_RETRIEVER_INPUT.members["clientToken"] + ) + + case 6: + kwargs["tags"] = _deserialize_tags( + de, _SCHEMA_CREATE_RETRIEVER_INPUT.members["tags"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_RETRIEVER_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class CreateRetrieverOutput: + """Dataclass for CreateRetrieverOutput structure.""" + + retriever_id: str | None = None + """The identifier of the retriever you are using.""" + + retriever_arn: str | None = None + """ + The Amazon Resource Name (ARN) of an IAM role associated with a + retriever. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_RETRIEVER_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.retriever_id is not None: + serializer.write_string( + _SCHEMA_CREATE_RETRIEVER_OUTPUT.members["retrieverId"], + self.retriever_id, + ) + + if self.retriever_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_RETRIEVER_OUTPUT.members["retrieverArn"], + self.retriever_arn, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["retriever_id"] = de.read_string( + _SCHEMA_CREATE_RETRIEVER_OUTPUT.members["retrieverId"] + ) + + case 1: + kwargs["retriever_arn"] = de.read_string( + _SCHEMA_CREATE_RETRIEVER_OUTPUT.members["retrieverArn"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_RETRIEVER_OUTPUT, consumer=_consumer) + return kwargs + + +CREATE_RETRIEVER = APIOperation( + input=CreateRetrieverInput, + output=CreateRetrieverOutput, + schema=_SCHEMA_CREATE_RETRIEVER, + input_schema=_SCHEMA_CREATE_RETRIEVER_INPUT, + output_schema=_SCHEMA_CREATE_RETRIEVER_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DeleteRetrieverInput: + """Dataclass for DeleteRetrieverInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application using the retriever.""" + + retriever_id: str | None = None + """The identifier of the retriever being deleted.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_RETRIEVER_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_RETRIEVER_INPUT.members["applicationId"], + self.application_id, + ) + + if self.retriever_id is not None: + serializer.write_string( + _SCHEMA_DELETE_RETRIEVER_INPUT.members["retrieverId"], self.retriever_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_RETRIEVER_INPUT.members["applicationId"] + ) + + case 1: + kwargs["retriever_id"] = de.read_string( + _SCHEMA_DELETE_RETRIEVER_INPUT.members["retrieverId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_RETRIEVER_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DeleteRetrieverOutput: + """Dataclass for DeleteRetrieverOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_RETRIEVER_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_RETRIEVER_OUTPUT, consumer=_consumer) + return kwargs + + +DELETE_RETRIEVER = APIOperation( + input=DeleteRetrieverInput, + output=DeleteRetrieverOutput, + schema=_SCHEMA_DELETE_RETRIEVER, + input_schema=_SCHEMA_DELETE_RETRIEVER_INPUT, + output_schema=_SCHEMA_DELETE_RETRIEVER_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetRetrieverInput: + """Dataclass for GetRetrieverInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application using the retriever.""" + + retriever_id: str | None = None + """The identifier of the retriever.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_RETRIEVER_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_RETRIEVER_INPUT.members["applicationId"], + self.application_id, + ) + + if self.retriever_id is not None: + serializer.write_string( + _SCHEMA_GET_RETRIEVER_INPUT.members["retrieverId"], self.retriever_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_RETRIEVER_INPUT.members["applicationId"] + ) + + case 1: + kwargs["retriever_id"] = de.read_string( + _SCHEMA_GET_RETRIEVER_INPUT.members["retrieverId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_RETRIEVER_INPUT, consumer=_consumer) + return kwargs + + +class RetrieverStatus(StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + FAILED = "FAILED" + + +@dataclass(kw_only=True) +class GetRetrieverOutput: + """Dataclass for GetRetrieverOutput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application using the retriever.""" + + retriever_id: str | None = None + """The identifier of the retriever.""" + + retriever_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the IAM role associated with the + retriever. + """ + + type: str | None = None + """The type of the retriever.""" + + status: str | None = None + """The status of the retriever.""" + + display_name: str | None = None + """The name of the retriever.""" + + configuration: RetrieverConfiguration | None = None + """ + Provides information on how the retriever used for your Amazon Q + Business application is configured. + """ + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the role with the permission to access + the retriever and required resources. + """ + + created_at: datetime | None = None + """The Unix timestamp when the retriever was created.""" + + updated_at: datetime | None = None + """The Unix timestamp when the retriever was last updated.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_RETRIEVER_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["applicationId"], + self.application_id, + ) + + if self.retriever_id is not None: + serializer.write_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["retrieverId"], self.retriever_id + ) + + if self.retriever_arn is not None: + serializer.write_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["retrieverArn"], self.retriever_arn + ) + + if self.type is not None: + serializer.write_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["type"], self.type + ) + + if self.status is not None: + serializer.write_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["status"], self.status + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["displayName"], self.display_name + ) + + if self.configuration is not None: + serializer.write_struct( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["configuration"], + self.configuration, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["roleArn"], self.role_arn + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["updatedAt"], self.updated_at + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["applicationId"] + ) + + case 1: + kwargs["retriever_id"] = de.read_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["retrieverId"] + ) + + case 2: + kwargs["retriever_arn"] = de.read_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["retrieverArn"] + ) + + case 3: + kwargs["type"] = de.read_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["type"] + ) + + case 4: + kwargs["status"] = de.read_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["status"] + ) + + case 5: + kwargs["display_name"] = de.read_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["displayName"] + ) + + case 6: + kwargs["configuration"] = ( + _RetrieverConfigurationDeserializer().deserialize(de) + ) + + case 7: + kwargs["role_arn"] = de.read_string( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["roleArn"] + ) + + case 8: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["createdAt"] + ) + + case 9: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_GET_RETRIEVER_OUTPUT.members["updatedAt"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_RETRIEVER_OUTPUT, consumer=_consumer) + return kwargs + + +GET_RETRIEVER = APIOperation( + input=GetRetrieverInput, + output=GetRetrieverOutput, + schema=_SCHEMA_GET_RETRIEVER, + input_schema=_SCHEMA_GET_RETRIEVER_INPUT, + output_schema=_SCHEMA_GET_RETRIEVER_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListRetrieversInput: + """Dataclass for ListRetrieversInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application using the retriever.""" + + next_token: str | None = None + """ + If the number of retrievers returned exceeds `maxResults`, Amazon Q + Business returns a next token as a pagination token to retrieve the next + set of retrievers. + """ + + max_results: int | None = None + """The maximum number of retrievers returned.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_RETRIEVERS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_RETRIEVERS_INPUT.members["applicationId"], + self.application_id, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_RETRIEVERS_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_RETRIEVERS_INPUT.members["maxResults"], self.max_results + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_RETRIEVERS_INPUT.members["applicationId"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_RETRIEVERS_INPUT.members["nextToken"] + ) + + case 2: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_RETRIEVERS_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_RETRIEVERS_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class Retriever: + """ + Summary information for the retriever used for your Amazon Q Business + application. + """ + + application_id: str | None = None + """The identifier of the Amazon Q Business application using the retriever.""" + + retriever_id: str | None = None + """ + The identifier of the retriever used by your Amazon Q Business + application. + """ + + type: str | None = None + """The type of your retriever.""" + + status: str | None = None + """The status of your retriever.""" + + display_name: str | None = None + """The name of your retriever.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RETRIEVER, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_RETRIEVER.members["applicationId"], self.application_id + ) + + if self.retriever_id is not None: + serializer.write_string( + _SCHEMA_RETRIEVER.members["retrieverId"], self.retriever_id + ) + + if self.type is not None: + serializer.write_string(_SCHEMA_RETRIEVER.members["type"], self.type) + + if self.status is not None: + serializer.write_string(_SCHEMA_RETRIEVER.members["status"], self.status) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_RETRIEVER.members["displayName"], self.display_name + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_RETRIEVER.members["applicationId"] + ) + + case 1: + kwargs["retriever_id"] = de.read_string( + _SCHEMA_RETRIEVER.members["retrieverId"] + ) + + case 2: + kwargs["type"] = de.read_string(_SCHEMA_RETRIEVER.members["type"]) + + case 3: + kwargs["status"] = de.read_string( + _SCHEMA_RETRIEVER.members["status"] + ) + + case 4: + kwargs["display_name"] = de.read_string( + _SCHEMA_RETRIEVER.members["displayName"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_RETRIEVER, consumer=_consumer) + return kwargs + + +def _serialize_retrievers( + serializer: ShapeSerializer, schema: Schema, value: list[Retriever] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_retrievers( + deserializer: ShapeDeserializer, schema: Schema +) -> list[Retriever]: + result: list[Retriever] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(Retriever.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ListRetrieversOutput: + """Dataclass for ListRetrieversOutput structure.""" + + retrievers: list[Retriever] | None = None + """An array of summary information for one or more retrievers.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of retrievers. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_RETRIEVERS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.retrievers is not None: + _serialize_retrievers( + serializer, + _SCHEMA_LIST_RETRIEVERS_OUTPUT.members["retrievers"], + self.retrievers, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_RETRIEVERS_OUTPUT.members["nextToken"], self.next_token + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["retrievers"] = _deserialize_retrievers( + de, _SCHEMA_LIST_RETRIEVERS_OUTPUT.members["retrievers"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_RETRIEVERS_OUTPUT.members["nextToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_RETRIEVERS_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_RETRIEVERS = APIOperation( + input=ListRetrieversInput, + output=ListRetrieversOutput, + schema=_SCHEMA_LIST_RETRIEVERS, + input_schema=_SCHEMA_LIST_RETRIEVERS_INPUT, + output_schema=_SCHEMA_LIST_RETRIEVERS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class UpdateRetrieverInput: + """Dataclass for UpdateRetrieverInput structure.""" + + application_id: str | None = None + """The identifier of your Amazon Q Business application.""" + + retriever_id: str | None = None + """The identifier of your retriever.""" + + configuration: RetrieverConfiguration | None = None + """ + Provides information on how the retriever used for your Amazon Q + Business application is configured. + """ + + display_name: str | None = None + """The name of your retriever.""" + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of an IAM role with permission to access + the retriever and required resources. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_RETRIEVER_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_RETRIEVER_INPUT.members["applicationId"], + self.application_id, + ) + + if self.retriever_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_RETRIEVER_INPUT.members["retrieverId"], self.retriever_id + ) + + if self.configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_RETRIEVER_INPUT.members["configuration"], + self.configuration, + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_UPDATE_RETRIEVER_INPUT.members["displayName"], self.display_name + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_UPDATE_RETRIEVER_INPUT.members["roleArn"], self.role_arn + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_UPDATE_RETRIEVER_INPUT.members["applicationId"] + ) + + case 1: + kwargs["retriever_id"] = de.read_string( + _SCHEMA_UPDATE_RETRIEVER_INPUT.members["retrieverId"] + ) + + case 2: + kwargs["configuration"] = ( + _RetrieverConfigurationDeserializer().deserialize(de) + ) + + case 3: + kwargs["display_name"] = de.read_string( + _SCHEMA_UPDATE_RETRIEVER_INPUT.members["displayName"] + ) + + case 4: + kwargs["role_arn"] = de.read_string( + _SCHEMA_UPDATE_RETRIEVER_INPUT.members["roleArn"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_RETRIEVER_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class UpdateRetrieverOutput: + """Dataclass for UpdateRetrieverOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_RETRIEVER_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_RETRIEVER_OUTPUT, consumer=_consumer) + return kwargs + + +UPDATE_RETRIEVER = APIOperation( + input=UpdateRetrieverInput, + output=UpdateRetrieverOutput, + schema=_SCHEMA_UPDATE_RETRIEVER, + input_schema=_SCHEMA_UPDATE_RETRIEVER_INPUT, + output_schema=_SCHEMA_UPDATE_RETRIEVER_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class UpdateApplicationInput: + """Dataclass for UpdateApplicationInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application.""" + + identity_center_instance_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the IAM Identity Center instance you + are either creating for---or connecting to---your Amazon Q Business + application. + """ + + display_name: str | None = None + """A name for the Amazon Q Business application.""" + + description: str | None = None + """A description for the Amazon Q Business application.""" + + role_arn: str | None = None + """ + An Amazon Web Services Identity and Access Management (IAM) role that + gives Amazon Q Business permission to access Amazon CloudWatch logs and + metrics. + """ + + attachments_configuration: AttachmentsConfiguration | None = None + """An option to allow end users to upload files directly during chat.""" + + q_apps_configuration: QAppsConfiguration | None = None + """ + An option to allow end users to create and use Amazon Q Apps in the web + experience. + """ + + personalization_configuration: PersonalizationConfiguration | None = None + """ + Configuration information about chat response personalization. For more + information, see [Personalizing chat + responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html). + """ + + auto_subscription_configuration: AutoSubscriptionConfiguration | None = None + """ + An option to enable updating the default subscription type assigned to + an Amazon Q Business application using IAM identity federation for user + management. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_APPLICATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_APPLICATION_INPUT.members["applicationId"], + self.application_id, + ) + + if self.identity_center_instance_arn is not None: + serializer.write_string( + _SCHEMA_UPDATE_APPLICATION_INPUT.members["identityCenterInstanceArn"], + self.identity_center_instance_arn, + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_UPDATE_APPLICATION_INPUT.members["displayName"], + self.display_name, + ) + + if self.description is not None: + serializer.write_string( + _SCHEMA_UPDATE_APPLICATION_INPUT.members["description"], + self.description, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_UPDATE_APPLICATION_INPUT.members["roleArn"], self.role_arn + ) + + if self.attachments_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_APPLICATION_INPUT.members["attachmentsConfiguration"], + self.attachments_configuration, + ) + + if self.q_apps_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_APPLICATION_INPUT.members["qAppsConfiguration"], + self.q_apps_configuration, + ) + + if self.personalization_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_APPLICATION_INPUT.members[ + "personalizationConfiguration" + ], + self.personalization_configuration, + ) + + if self.auto_subscription_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_APPLICATION_INPUT.members[ + "autoSubscriptionConfiguration" + ], + self.auto_subscription_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_UPDATE_APPLICATION_INPUT.members["applicationId"] + ) + + case 1: + kwargs["identity_center_instance_arn"] = de.read_string( + _SCHEMA_UPDATE_APPLICATION_INPUT.members[ + "identityCenterInstanceArn" + ] + ) + + case 2: + kwargs["display_name"] = de.read_string( + _SCHEMA_UPDATE_APPLICATION_INPUT.members["displayName"] + ) + + case 3: + kwargs["description"] = de.read_string( + _SCHEMA_UPDATE_APPLICATION_INPUT.members["description"] + ) + + case 4: + kwargs["role_arn"] = de.read_string( + _SCHEMA_UPDATE_APPLICATION_INPUT.members["roleArn"] + ) + + case 5: + kwargs["attachments_configuration"] = ( + AttachmentsConfiguration.deserialize(de) + ) + + case 6: + kwargs["q_apps_configuration"] = QAppsConfiguration.deserialize(de) + + case 7: + kwargs["personalization_configuration"] = ( + PersonalizationConfiguration.deserialize(de) + ) + + case 8: + kwargs["auto_subscription_configuration"] = ( + AutoSubscriptionConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_APPLICATION_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class UpdateApplicationOutput: + """Dataclass for UpdateApplicationOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_APPLICATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_APPLICATION_OUTPUT, consumer=_consumer) + return kwargs + + +UPDATE_APPLICATION = APIOperation( + input=UpdateApplicationInput, + output=UpdateApplicationOutput, + schema=_SCHEMA_UPDATE_APPLICATION, + input_schema=_SCHEMA_UPDATE_APPLICATION_INPUT, + output_schema=_SCHEMA_UPDATE_APPLICATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +def _serialize_browser_extension_list( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_browser_extension_list( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class BrowserExtensionConfiguration: + """ + The container for browser extension configuration for an Amazon Q + Business web experience. + """ + + enabled_browser_extensions: list[str] + """ + Specify the browser extensions allowed for your Amazon Q web experience. + + - `CHROME` --- Enables the extension for Chromium-based browsers (Google + Chrome, Microsoft Edge, Opera, etc.). + + - `FIREFOX` --- Enables the extension for Mozilla Firefox. + + - `CHROME` and `FIREFOX` --- Enable the extension for Chromium-based + browsers and Mozilla Firefox. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_BROWSER_EXTENSION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + _serialize_browser_extension_list( + serializer, + _SCHEMA_BROWSER_EXTENSION_CONFIGURATION.members["enabledBrowserExtensions"], + self.enabled_browser_extensions, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["enabled_browser_extensions"] = ( + _deserialize_browser_extension_list( + de, + _SCHEMA_BROWSER_EXTENSION_CONFIGURATION.members[ + "enabledBrowserExtensions" + ], + ) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_BROWSER_EXTENSION_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class CustomizationConfiguration: + """ + Contains the configuration information to customize the logo, font, and + color of an Amazon Q Business web experience with individual files for + each property or a CSS file for them all. + """ + + custom_css_url: str | None = None + """ + Provides the URL where the custom CSS file is hosted for an Amazon Q web + experience. + """ + + logo_url: str | None = None + """ + Provides the URL where the custom logo file is hosted for an Amazon Q + web experience. + """ + + font_url: str | None = None + """ + Provides the URL where the custom font file is hosted for an Amazon Q + web experience. + """ + + favicon_url: str | None = None + """ + Provides the URL where the custom favicon file is hosted for an Amazon Q + web experience. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CUSTOMIZATION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.custom_css_url is not None: + serializer.write_string( + _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["customCSSUrl"], + self.custom_css_url, + ) + + if self.logo_url is not None: + serializer.write_string( + _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["logoUrl"], self.logo_url + ) + + if self.font_url is not None: + serializer.write_string( + _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["fontUrl"], self.font_url + ) + + if self.favicon_url is not None: + serializer.write_string( + _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["faviconUrl"], + self.favicon_url, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["custom_css_url"] = de.read_string( + _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["customCSSUrl"] + ) + + case 1: + kwargs["logo_url"] = de.read_string( + _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["logoUrl"] + ) + + case 2: + kwargs["font_url"] = de.read_string( + _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["fontUrl"] + ) + + case 3: + kwargs["favicon_url"] = de.read_string( + _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["faviconUrl"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CUSTOMIZATION_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class OpenIDConnectProviderConfiguration: + """ + Information about the OIDC-compliant identity provider (IdP) used to + authenticate end users of an Amazon Q Business web experience. + """ + + secrets_arn: str + """ + The Amazon Resource Name (ARN) of a Secrets Manager secret containing + the OIDC client secret. + """ + + secrets_role: str + """ + An IAM role with permissions to access KMS to decrypt the Secrets + Manager secret containing your OIDC client secret. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION.members["secretsArn"], + self.secrets_arn, + ) + serializer.write_string( + _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION.members["secretsRole"], + self.secrets_role, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["secrets_arn"] = de.read_string( + _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION.members[ + "secretsArn" + ] + ) + + case 1: + kwargs["secrets_role"] = de.read_string( + _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION.members[ + "secretsRole" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class SamlProviderConfiguration: + """ + Information about the SAML 2.0-compliant identity provider (IdP) used to + authenticate end users of an Amazon Q Business web experience. + """ + + authentication_url: str + """ + The URL where Amazon Q Business end users will be redirected for + authentication. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SAML_PROVIDER_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_SAML_PROVIDER_CONFIGURATION.members["authenticationUrl"], + self.authentication_url, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["authentication_url"] = de.read_string( + _SCHEMA_SAML_PROVIDER_CONFIGURATION.members["authenticationUrl"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_SAML_PROVIDER_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass +class IdentityProviderConfigurationSamlConfiguration: + """ + Information about the SAML 2.0-compliant identity provider (IdP) used to + authenticate end users of an Amazon Q Business web experience. + """ + + value: SamlProviderConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_IDENTITY_PROVIDER_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_IDENTITY_PROVIDER_CONFIGURATION.members["samlConfiguration"], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=SamlProviderConfiguration.deserialize(deserializer)) + + +@dataclass +class IdentityProviderConfigurationOpenIDConnectConfiguration: + """ + Information about the OIDC-compliant identity provider (IdP) used to + authenticate end users of an Amazon Q Business web experience. + """ + + value: OpenIDConnectProviderConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_IDENTITY_PROVIDER_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_IDENTITY_PROVIDER_CONFIGURATION.members[ + "openIDConnectConfiguration" + ], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=OpenIDConnectProviderConfiguration.deserialize(deserializer)) + + +@dataclass +class IdentityProviderConfigurationUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +IdentityProviderConfiguration = Union[ + IdentityProviderConfigurationSamlConfiguration + | IdentityProviderConfigurationOpenIDConnectConfiguration + | IdentityProviderConfigurationUnknown +] +""" +Provides information about the identity provider (IdP) used to +authenticate end users of an Amazon Q Business web experience. +""" + + +class _IdentityProviderConfigurationDeserializer: + _result: IdentityProviderConfiguration | None = None + + def deserialize( + self, deserializer: ShapeDeserializer + ) -> IdentityProviderConfiguration: + self._result = None + deserializer.read_struct( + _SCHEMA_IDENTITY_PROVIDER_CONFIGURATION, self._consumer + ) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result( + IdentityProviderConfigurationSamlConfiguration.deserialize(de) + ) + + case 1: + self._set_result( + IdentityProviderConfigurationOpenIDConnectConfiguration.deserialize( + de + ) + ) + + case _: + self._set_result( + IdentityProviderConfigurationUnknown( + tag=schema.expect_member_name() + ) + ) + + def _set_result(self, value: IdentityProviderConfiguration) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +def _serialize_web_experience_origins( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_web_experience_origins( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +class WebExperienceSamplePromptsControlMode(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +@dataclass(kw_only=True) +class CreateWebExperienceInput: + """Dataclass for CreateWebExperienceInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business web experience.""" + + title: str | None = None + """The title for your Amazon Q Business web experience.""" + + subtitle: str | None = None + """A subtitle to personalize your Amazon Q Business web experience.""" + + welcome_message: str | None = None + """ + The customized welcome message for end users of an Amazon Q Business web + experience. + """ + + sample_prompts_control_mode: str | None = None + """ + Determines whether sample prompts are enabled in the web experience for + an end user. + """ + + origins: list[str] | None = None + """ + Sets the website domain origins that are allowed to embed the Amazon Q + Business web experience. The *domain origin* refers to the base URL for + accessing a website including the protocol (`http/https`), the domain + name, and the port number (if specified). + + Note: + You must only submit a *base URL* and not a full path. For example, + `https://docs.aws.amazon.com`. + """ + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the service role attached to your web + experience. + + Note: + The `roleArn` parameter is required when your Amazon Q Business + application is created with IAM Identity Center. It is not required for + SAML-based applications. + """ + + tags: list[Tag] | None = None + """ + A list of key-value pairs that identify or categorize your Amazon Q + Business web experience. You can also use tags to help control access to + the web experience. Tag keys and values can consist of Unicode letters, + digits, white space, and any of the following symbols: _ . : / = + - @. + """ + + client_token: str | None = None + """ + A token you provide to identify a request to create an Amazon Q Business + web experience. + """ + + identity_provider_configuration: IdentityProviderConfiguration | None = None + """ + Information about the identity provider (IdP) used to authenticate end + users of an Amazon Q Business web experience. + """ + + browser_extension_configuration: BrowserExtensionConfiguration | None = None + """ + The browser extension configuration for an Amazon Q Business web + experience. + + Note: + For Amazon Q Business application using external OIDC-compliant identity + providers (IdPs). The IdP administrator must add the browser extension + sign-in redirect URLs to the IdP application. For more information, see + [Configure external OIDC identity provider for your browser + extensions.](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/browser-extensions.html). + """ + + customization_configuration: CustomizationConfiguration | None = None + """ + Sets the custom logo, favicon, font, and color used in the Amazon Q web + experience. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_WEB_EXPERIENCE_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["applicationId"], + self.application_id, + ) + + if self.title is not None: + serializer.write_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["title"], self.title + ) + + if self.subtitle is not None: + serializer.write_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["subtitle"], self.subtitle + ) + + if self.welcome_message is not None: + serializer.write_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["welcomeMessage"], + self.welcome_message, + ) + + if self.sample_prompts_control_mode is not None: + serializer.write_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["samplePromptsControlMode"], + self.sample_prompts_control_mode, + ) + + if self.origins is not None: + _serialize_web_experience_origins( + serializer, + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["origins"], + self.origins, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["roleArn"], self.role_arn + ) + + if self.tags is not None: + _serialize_tags( + serializer, + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["tags"], + self.tags, + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["clientToken"], + self.client_token, + ) + + if self.identity_provider_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members[ + "identityProviderConfiguration" + ], + self.identity_provider_configuration, + ) + + if self.browser_extension_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members[ + "browserExtensionConfiguration" + ], + self.browser_extension_configuration, + ) + + if self.customization_configuration is not None: + serializer.write_struct( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members[ + "customizationConfiguration" + ], + self.customization_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["applicationId"] + ) + + case 1: + kwargs["title"] = de.read_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["title"] + ) + + case 2: + kwargs["subtitle"] = de.read_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["subtitle"] + ) + + case 3: + kwargs["welcome_message"] = de.read_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["welcomeMessage"] + ) + + case 4: + kwargs["sample_prompts_control_mode"] = de.read_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members[ + "samplePromptsControlMode" + ] + ) + + case 5: + kwargs["origins"] = _deserialize_web_experience_origins( + de, _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["origins"] + ) + + case 6: + kwargs["role_arn"] = de.read_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["roleArn"] + ) + + case 7: + kwargs["tags"] = _deserialize_tags( + de, _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["tags"] + ) + + case 8: + kwargs["client_token"] = de.read_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["clientToken"] + ) + + case 9: + kwargs["identity_provider_configuration"] = ( + _IdentityProviderConfigurationDeserializer().deserialize(de) + ) + + case 10: + kwargs["browser_extension_configuration"] = ( + BrowserExtensionConfiguration.deserialize(de) + ) + + case 11: + kwargs["customization_configuration"] = ( + CustomizationConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class CreateWebExperienceOutput: + """Dataclass for CreateWebExperienceOutput structure.""" + + web_experience_id: str | None = None + """The identifier of the Amazon Q Business web experience.""" + + web_experience_arn: str | None = None + """The Amazon Resource Name (ARN) of an Amazon Q Business web experience.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.web_experience_id is not None: + serializer.write_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT.members["webExperienceId"], + self.web_experience_id, + ) + + if self.web_experience_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT.members["webExperienceArn"], + self.web_experience_arn, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["web_experience_id"] = de.read_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT.members["webExperienceId"] + ) + + case 1: + kwargs["web_experience_arn"] = de.read_string( + _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT.members["webExperienceArn"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT, consumer=_consumer + ) + return kwargs + + +CREATE_WEB_EXPERIENCE = APIOperation( + input=CreateWebExperienceInput, + output=CreateWebExperienceOutput, + schema=_SCHEMA_CREATE_WEB_EXPERIENCE, + input_schema=_SCHEMA_CREATE_WEB_EXPERIENCE_INPUT, + output_schema=_SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DeleteWebExperienceInput: + """Dataclass for DeleteWebExperienceInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application linked to the Amazon + Q Business web experience. + """ + + web_experience_id: str | None = None + """The identifier of the Amazon Q Business web experience being deleted.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_WEB_EXPERIENCE_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT.members["applicationId"], + self.application_id, + ) + + if self.web_experience_id is not None: + serializer.write_string( + _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT.members["webExperienceId"], + self.web_experience_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT.members["applicationId"] + ) + + case 1: + kwargs["web_experience_id"] = de.read_string( + _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT.members["webExperienceId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class DeleteWebExperienceOutput: + """Dataclass for DeleteWebExperienceOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_WEB_EXPERIENCE_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DELETE_WEB_EXPERIENCE_OUTPUT, consumer=_consumer + ) + return kwargs + + +DELETE_WEB_EXPERIENCE = APIOperation( + input=DeleteWebExperienceInput, + output=DeleteWebExperienceOutput, + schema=_SCHEMA_DELETE_WEB_EXPERIENCE, + input_schema=_SCHEMA_DELETE_WEB_EXPERIENCE_INPUT, + output_schema=_SCHEMA_DELETE_WEB_EXPERIENCE_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetWebExperienceInput: + """Dataclass for GetWebExperienceInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application linked to the web + experience. + """ + + web_experience_id: str | None = None + """The identifier of the Amazon Q Business web experience.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_WEB_EXPERIENCE_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_INPUT.members["applicationId"], + self.application_id, + ) + + if self.web_experience_id is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_INPUT.members["webExperienceId"], + self.web_experience_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_INPUT.members["applicationId"] + ) + + case 1: + kwargs["web_experience_id"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_INPUT.members["webExperienceId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_WEB_EXPERIENCE_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class SamlConfiguration: + """ + Provides the SAML 2.0 compliant identity provider (IdP) configuration + information Amazon Q Business needs to deploy a Amazon Q Business web + experience. + """ + + metadata_xml: str + """The metadata XML that your IdP generated.""" + + role_arn: str + """ + The Amazon Resource Name (ARN) of an IAM role assumed by users when they + authenticate into their Amazon Q Business web experience, containing the + relevant Amazon Q Business permissions for conversing with Amazon Q + Business. + """ + + user_id_attribute: str + """The user attribute name in your IdP that maps to the user email.""" + + user_group_attribute: str | None = None + """The group attribute name in your IdP that maps to user groups.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SAML_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_SAML_CONFIGURATION.members["metadataXML"], self.metadata_xml + ) + serializer.write_string( + _SCHEMA_SAML_CONFIGURATION.members["roleArn"], self.role_arn + ) + serializer.write_string( + _SCHEMA_SAML_CONFIGURATION.members["userIdAttribute"], + self.user_id_attribute, + ) + if self.user_group_attribute is not None: + serializer.write_string( + _SCHEMA_SAML_CONFIGURATION.members["userGroupAttribute"], + self.user_group_attribute, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["metadata_xml"] = de.read_string( + _SCHEMA_SAML_CONFIGURATION.members["metadataXML"] + ) + + case 1: + kwargs["role_arn"] = de.read_string( + _SCHEMA_SAML_CONFIGURATION.members["roleArn"] + ) + + case 2: + kwargs["user_id_attribute"] = de.read_string( + _SCHEMA_SAML_CONFIGURATION.members["userIdAttribute"] + ) + + case 3: + kwargs["user_group_attribute"] = de.read_string( + _SCHEMA_SAML_CONFIGURATION.members["userGroupAttribute"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_SAML_CONFIGURATION, consumer=_consumer) + return kwargs + + +@dataclass +class WebExperienceAuthConfigurationSamlConfiguration: + """ + Provides the SAML 2.0 compliant identity provider (IdP) configuration + information Amazon Q Business needs to deploy a Amazon Q Business web + experience. + """ + + value: SamlConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_WEB_EXPERIENCE_AUTH_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_WEB_EXPERIENCE_AUTH_CONFIGURATION.members["samlConfiguration"], + self.value, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=SamlConfiguration.deserialize(deserializer)) + + +@dataclass +class WebExperienceAuthConfigurationUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +WebExperienceAuthConfiguration = Union[ + WebExperienceAuthConfigurationSamlConfiguration + | WebExperienceAuthConfigurationUnknown +] +""" +Provides the authorization configuration information needed to deploy a +Amazon Q Business web experience to end users. +""" + + +class _WebExperienceAuthConfigurationDeserializer: + _result: WebExperienceAuthConfiguration | None = None + + def deserialize( + self, deserializer: ShapeDeserializer + ) -> WebExperienceAuthConfiguration: + self._result = None + deserializer.read_struct( + _SCHEMA_WEB_EXPERIENCE_AUTH_CONFIGURATION, self._consumer + ) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result( + WebExperienceAuthConfigurationSamlConfiguration.deserialize(de) + ) + + case _: + self._set_result( + WebExperienceAuthConfigurationUnknown( + tag=schema.expect_member_name() + ) + ) + + def _set_result(self, value: WebExperienceAuthConfiguration) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +class WebExperienceStatus(StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + FAILED = "FAILED" + PENDING_AUTH_CONFIG = "PENDING_AUTH_CONFIG" + + +@dataclass(kw_only=True) +class GetWebExperienceOutput: + """Dataclass for GetWebExperienceOutput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application linked to the web + experience. + """ + + web_experience_id: str | None = None + """The identifier of the Amazon Q Business web experience.""" + + web_experience_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the role with the permission to access + the Amazon Q Business web experience and required resources. + """ + + default_endpoint: str | None = None + """The endpoint of your Amazon Q Business web experience.""" + + status: str | None = None + """ + The current status of the Amazon Q Business web experience. When the + `Status` field value is `FAILED`, the `ErrorMessage` field contains a + description of the error that caused the data source connector to fail. + """ + + created_at: datetime | None = None + """ + The Unix timestamp when the Amazon Q Business web experience was last + created. + """ + + updated_at: datetime | None = None + """ + The Unix timestamp when the Amazon Q Business web experience was last + updated. + """ + + title: str | None = None + """The title for your Amazon Q Business web experience.""" + + subtitle: str | None = None + """The subtitle for your Amazon Q Business web experience.""" + + welcome_message: str | None = None + """ + The customized welcome message for end users of an Amazon Q Business web + experience. + """ + + sample_prompts_control_mode: str | None = None + """ + Determines whether sample prompts are enabled in the web experience for + an end user. + """ + + origins: list[str] | None = None + """ + Gets the website domain origins that are allowed to embed the Amazon Q + Business web experience. The *domain origin* refers to the base URL for + accessing a website including the protocol (`http/https`), the domain + name, and the port number (if specified). + """ + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the service role attached to your web + experience. + """ + + identity_provider_configuration: IdentityProviderConfiguration | None = None + """ + Information about the identity provider (IdP) used to authenticate end + users of an Amazon Q Business web experience. + """ + + authentication_configuration: WebExperienceAuthConfiguration | None = None + """ + The authentication configuration information for your Amazon Q Business + web experience. + """ + + error: ErrorDetail | None = None + """ + When the `Status` field value is `FAILED`, the `ErrorMessage` field + contains a description of the error that caused the data source + connector to fail. + """ + + browser_extension_configuration: BrowserExtensionConfiguration | None = None + """ + The browser extension configuration for an Amazon Q Business web + experience. + """ + + customization_configuration: CustomizationConfiguration | None = None + """ + Gets the custom logo, favicon, font, and color used in the Amazon Q web + experience. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_WEB_EXPERIENCE_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["applicationId"], + self.application_id, + ) + + if self.web_experience_id is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["webExperienceId"], + self.web_experience_id, + ) + + if self.web_experience_arn is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["webExperienceArn"], + self.web_experience_arn, + ) + + if self.default_endpoint is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["defaultEndpoint"], + self.default_endpoint, + ) + + if self.status is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["status"], self.status + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["updatedAt"], self.updated_at + ) + + if self.title is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["title"], self.title + ) + + if self.subtitle is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["subtitle"], self.subtitle + ) + + if self.welcome_message is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["welcomeMessage"], + self.welcome_message, + ) + + if self.sample_prompts_control_mode is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["samplePromptsControlMode"], + self.sample_prompts_control_mode, + ) + + if self.origins is not None: + _serialize_web_experience_origins( + serializer, + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["origins"], + self.origins, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["roleArn"], self.role_arn + ) + + if self.identity_provider_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members[ + "identityProviderConfiguration" + ], + self.identity_provider_configuration, + ) + + if self.authentication_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members[ + "authenticationConfiguration" + ], + self.authentication_configuration, + ) + + if self.error is not None: + serializer.write_struct( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["error"], self.error + ) + + if self.browser_extension_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members[ + "browserExtensionConfiguration" + ], + self.browser_extension_configuration, + ) + + if self.customization_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["customizationConfiguration"], + self.customization_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["applicationId"] + ) + + case 1: + kwargs["web_experience_id"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["webExperienceId"] + ) + + case 2: + kwargs["web_experience_arn"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["webExperienceArn"] + ) + + case 3: + kwargs["default_endpoint"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["defaultEndpoint"] + ) + + case 4: + kwargs["status"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["status"] + ) + + case 5: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["createdAt"] + ) + + case 6: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["updatedAt"] + ) + + case 7: + kwargs["title"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["title"] + ) + + case 8: + kwargs["subtitle"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["subtitle"] + ) + + case 9: + kwargs["welcome_message"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["welcomeMessage"] + ) + + case 10: + kwargs["sample_prompts_control_mode"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members[ + "samplePromptsControlMode" + ] + ) + + case 11: + kwargs["origins"] = _deserialize_web_experience_origins( + de, _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["origins"] + ) + + case 12: + kwargs["role_arn"] = de.read_string( + _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["roleArn"] + ) + + case 13: + kwargs["identity_provider_configuration"] = ( + _IdentityProviderConfigurationDeserializer().deserialize(de) + ) + + case 14: + kwargs["authentication_configuration"] = ( + _WebExperienceAuthConfigurationDeserializer().deserialize(de) + ) + + case 15: + kwargs["error"] = ErrorDetail.deserialize(de) + + case 16: + kwargs["browser_extension_configuration"] = ( + BrowserExtensionConfiguration.deserialize(de) + ) + + case 17: + kwargs["customization_configuration"] = ( + CustomizationConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_WEB_EXPERIENCE_OUTPUT, consumer=_consumer) + return kwargs + + +GET_WEB_EXPERIENCE = APIOperation( + input=GetWebExperienceInput, + output=GetWebExperienceOutput, + schema=_SCHEMA_GET_WEB_EXPERIENCE, + input_schema=_SCHEMA_GET_WEB_EXPERIENCE_INPUT, + output_schema=_SCHEMA_GET_WEB_EXPERIENCE_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListWebExperiencesInput: + """Dataclass for ListWebExperiencesInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application linked to the listed + web experiences. + """ + + next_token: str | None = None + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business conversations. + """ + + max_results: int | None = None + """The maximum number of Amazon Q Business Web Experiences to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_WEB_EXPERIENCES_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["applicationId"], + self.application_id, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["maxResults"], + self.max_results, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["applicationId"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["nextToken"] + ) + + case 2: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_WEB_EXPERIENCES_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class WebExperience: + """Provides information for an Amazon Q Business web experience.""" + + web_experience_id: str | None = None + """The identifier of your Amazon Q Business web experience.""" + + created_at: datetime | None = None + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + + updated_at: datetime | None = None + """ + The Unix timestamp when your Amazon Q Business web experience was + updated. + """ + + default_endpoint: str | None = None + """ + The endpoint URLs for your Amazon Q Business web experience. The URLs + are unique and fully hosted by Amazon Web Services. + """ + + status: str | None = None + """The status of your Amazon Q Business web experience.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_WEB_EXPERIENCE, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.web_experience_id is not None: + serializer.write_string( + _SCHEMA_WEB_EXPERIENCE.members["webExperienceId"], + self.web_experience_id, + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_WEB_EXPERIENCE.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_WEB_EXPERIENCE.members["updatedAt"], self.updated_at + ) + + if self.default_endpoint is not None: + serializer.write_string( + _SCHEMA_WEB_EXPERIENCE.members["defaultEndpoint"], self.default_endpoint + ) + + if self.status is not None: + serializer.write_string( + _SCHEMA_WEB_EXPERIENCE.members["status"], self.status + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["web_experience_id"] = de.read_string( + _SCHEMA_WEB_EXPERIENCE.members["webExperienceId"] + ) + + case 1: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_WEB_EXPERIENCE.members["createdAt"] + ) + + case 2: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_WEB_EXPERIENCE.members["updatedAt"] + ) + + case 3: + kwargs["default_endpoint"] = de.read_string( + _SCHEMA_WEB_EXPERIENCE.members["defaultEndpoint"] + ) + + case 4: + kwargs["status"] = de.read_string( + _SCHEMA_WEB_EXPERIENCE.members["status"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_WEB_EXPERIENCE, consumer=_consumer) + return kwargs + + +def _serialize_web_experiences( + serializer: ShapeSerializer, schema: Schema, value: list[WebExperience] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_web_experiences( + deserializer: ShapeDeserializer, schema: Schema +) -> list[WebExperience]: + result: list[WebExperience] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(WebExperience.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ListWebExperiencesOutput: + """Dataclass for ListWebExperiencesOutput structure.""" + + web_experiences: list[WebExperience] | None = None + """ + An array of summary information for one or more Amazon Q Business + experiences. + """ + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of messages. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.web_experiences is not None: + _serialize_web_experiences( + serializer, + _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT.members["webExperiences"], + self.web_experiences, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT.members["nextToken"], + self.next_token, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["web_experiences"] = _deserialize_web_experiences( + de, + _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT.members["webExperiences"], + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT.members["nextToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT, consumer=_consumer + ) + return kwargs + + +LIST_WEB_EXPERIENCES = APIOperation( + input=ListWebExperiencesInput, + output=ListWebExperiencesOutput, + schema=_SCHEMA_LIST_WEB_EXPERIENCES, + input_schema=_SCHEMA_LIST_WEB_EXPERIENCES_INPUT, + output_schema=_SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class UpdateWebExperienceInput: + """Dataclass for UpdateWebExperienceInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application attached to the web + experience. + """ + + web_experience_id: str | None = None + """The identifier of the Amazon Q Business web experience.""" + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the role with permission to access the + Amazon Q Business web experience and required resources. + """ + + authentication_configuration: WebExperienceAuthConfiguration | None = None + """ + The authentication configuration of the Amazon Q Business web + experience. + """ + + title: str | None = None + """The title of the Amazon Q Business web experience.""" + + subtitle: str | None = None + """The subtitle of the Amazon Q Business web experience.""" + + welcome_message: str | None = None + """ + A customized welcome message for an end user in an Amazon Q Business web + experience. + """ + + sample_prompts_control_mode: str | None = None + """ + Determines whether sample prompts are enabled in the web experience for + an end user. + """ + + identity_provider_configuration: IdentityProviderConfiguration | None = None + """ + Information about the identity provider (IdP) used to authenticate end + users of an Amazon Q Business web experience. + """ + + origins: list[str] | None = None + """ + Updates the website domain origins that are allowed to embed the Amazon + Q Business web experience. The *domain origin* refers to the *base URL* + for accessing a website including the protocol (`http/https`), the + domain name, and the port number (if specified). + + Note: + - Any values except `null` submitted as part of this update will replace + all previous values. + + - You must only submit a *base URL* and not a full path. For example, + `https://docs.aws.amazon.com`. + """ + + browser_extension_configuration: BrowserExtensionConfiguration | None = None + """ + The browser extension configuration for an Amazon Q Business web + experience. + + Note: + For Amazon Q Business application using external OIDC-compliant identity + providers (IdPs). The IdP administrator must add the browser extension + sign-in redirect URLs to the IdP application. For more information, see + [Configure external OIDC identity provider for your browser + extensions.](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/browser-extensions.html). + """ + + customization_configuration: CustomizationConfiguration | None = None + """ + Updates the custom logo, favicon, font, and color used in the Amazon Q + web experience. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["applicationId"], + self.application_id, + ) + + if self.web_experience_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["webExperienceId"], + self.web_experience_id, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["roleArn"], self.role_arn + ) + + if self.authentication_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members[ + "authenticationConfiguration" + ], + self.authentication_configuration, + ) + + if self.title is not None: + serializer.write_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["title"], self.title + ) + + if self.subtitle is not None: + serializer.write_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["subtitle"], self.subtitle + ) + + if self.welcome_message is not None: + serializer.write_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["welcomeMessage"], + self.welcome_message, + ) + + if self.sample_prompts_control_mode is not None: + serializer.write_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["samplePromptsControlMode"], + self.sample_prompts_control_mode, + ) + + if self.identity_provider_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members[ + "identityProviderConfiguration" + ], + self.identity_provider_configuration, + ) + + if self.origins is not None: + _serialize_web_experience_origins( + serializer, + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["origins"], + self.origins, + ) + + if self.browser_extension_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members[ + "browserExtensionConfiguration" + ], + self.browser_extension_configuration, + ) + + if self.customization_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members[ + "customizationConfiguration" + ], + self.customization_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["applicationId"] + ) + + case 1: + kwargs["web_experience_id"] = de.read_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["webExperienceId"] + ) + + case 2: + kwargs["role_arn"] = de.read_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["roleArn"] + ) + + case 3: + kwargs["authentication_configuration"] = ( + _WebExperienceAuthConfigurationDeserializer().deserialize(de) + ) + + case 4: + kwargs["title"] = de.read_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["title"] + ) + + case 5: + kwargs["subtitle"] = de.read_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["subtitle"] + ) + + case 6: + kwargs["welcome_message"] = de.read_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["welcomeMessage"] + ) + + case 7: + kwargs["sample_prompts_control_mode"] = de.read_string( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members[ + "samplePromptsControlMode" + ] + ) + + case 8: + kwargs["identity_provider_configuration"] = ( + _IdentityProviderConfigurationDeserializer().deserialize(de) + ) + + case 9: + kwargs["origins"] = _deserialize_web_experience_origins( + de, _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["origins"] + ) + + case 10: + kwargs["browser_extension_configuration"] = ( + BrowserExtensionConfiguration.deserialize(de) + ) + + case 11: + kwargs["customization_configuration"] = ( + CustomizationConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class UpdateWebExperienceOutput: + """Dataclass for UpdateWebExperienceOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_WEB_EXPERIENCE_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_UPDATE_WEB_EXPERIENCE_OUTPUT, consumer=_consumer + ) + return kwargs + + +UPDATE_WEB_EXPERIENCE = APIOperation( + input=UpdateWebExperienceInput, + output=UpdateWebExperienceOutput, + schema=_SCHEMA_UPDATE_WEB_EXPERIENCE, + input_schema=_SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT, + output_schema=_SCHEMA_UPDATE_WEB_EXPERIENCE_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +class CreatorModeControl(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +@dataclass(kw_only=True) +class AppliedCreatorModeConfiguration: + """ + The creator mode specific admin controls configured for an Amazon Q + Business application. Determines whether an end user can generate + LLM-only responses when they use the web experience. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) + and [Conversation + settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + + creator_mode_control: str + """ + Information about whether creator mode is enabled or disabled for an + Amazon Q Business application. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_APPLIED_CREATOR_MODE_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_APPLIED_CREATOR_MODE_CONFIGURATION.members["creatorModeControl"], + self.creator_mode_control, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["creator_mode_control"] = de.read_string( + _SCHEMA_APPLIED_CREATOR_MODE_CONFIGURATION.members[ + "creatorModeControl" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_APPLIED_CREATOR_MODE_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class OrchestrationControl(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +@dataclass(kw_only=True) +class AppliedOrchestrationConfiguration: + """ + The chat orchestration specific admin controls configured for an Amazon + Q Business application. Determines whether Amazon Q Business + automatically routes chat requests across configured plugins and data + sources in your Amazon Q Business application. + + For more information, see [Chat orchestration + settings](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails-global-controls.html#guardrails-global-orchestration). + """ + + control: str + """ + Information about whether chat orchestration is enabled or disabled for + an Amazon Q Business application. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_APPLIED_ORCHESTRATION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_APPLIED_ORCHESTRATION_CONFIGURATION.members["control"], self.control + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["control"] = de.read_string( + _SCHEMA_APPLIED_ORCHESTRATION_CONFIGURATION.members["control"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_APPLIED_ORCHESTRATION_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class AssociatedGroup: + """ + Represents a group associated with a given user in the access control + system. + """ + + name: str | None = None + """ + The name of the group associated with the user. This is used to identify + the group in access control decisions. + """ + + type: str | None = None + """ + The type of the associated group. This indicates the scope of the + group's applicability. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ASSOCIATED_GROUP, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.name is not None: + serializer.write_string(_SCHEMA_ASSOCIATED_GROUP.members["name"], self.name) + + if self.type is not None: + serializer.write_string(_SCHEMA_ASSOCIATED_GROUP.members["type"], self.type) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["name"] = de.read_string( + _SCHEMA_ASSOCIATED_GROUP.members["name"] + ) + + case 1: + kwargs["type"] = de.read_string( + _SCHEMA_ASSOCIATED_GROUP.members["type"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ASSOCIATED_GROUP, consumer=_consumer) + return kwargs + + +def _serialize_associated_groups( + serializer: ShapeSerializer, schema: Schema, value: list[AssociatedGroup] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_associated_groups( + deserializer: ShapeDeserializer, schema: Schema +) -> list[AssociatedGroup]: + result: list[AssociatedGroup] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(AssociatedGroup.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class AssociatedUser: + """Represents an associated user in the access control system.""" + + id: str | None = None + """ + The unique identifier of the associated user. This is used to identify + the user in access control decisions. + """ + + type: str | None = None + """ + The type of the associated user. This indicates the scope of the user's + association. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ASSOCIATED_USER, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.id is not None: + serializer.write_string(_SCHEMA_ASSOCIATED_USER.members["id"], self.id) + + if self.type is not None: + serializer.write_string(_SCHEMA_ASSOCIATED_USER.members["type"], self.type) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["id"] = de.read_string(_SCHEMA_ASSOCIATED_USER.members["id"]) + + case 1: + kwargs["type"] = de.read_string( + _SCHEMA_ASSOCIATED_USER.members["type"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ASSOCIATED_USER, consumer=_consumer) + return kwargs + + +def _serialize_associated_users( + serializer: ShapeSerializer, schema: Schema, value: list[AssociatedUser] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_associated_users( + deserializer: ShapeDeserializer, schema: Schema +) -> list[AssociatedUser]: + result: list[AssociatedUser] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(AssociatedUser.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +def _serialize_q_iam_actions( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_q_iam_actions( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +class PermissionConditionOperator(StrEnum): + STRING_EQUALS = "StringEquals" + + +def _serialize_permission_condition_values( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_permission_condition_values( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class PermissionCondition: + """ + Defines a condition that restricts when a permission is effective. + Conditions allow you to control access based on specific attributes of + the request. + """ + + condition_operator: str + """ + The operator to use for the condition evaluation. This determines how + the condition values are compared. + """ + + condition_key: str + """ + The key for the condition. This identifies the attribute that the + condition applies to. + """ + + condition_values: list[str] + """The values to compare against using the specified condition operator.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PERMISSION_CONDITION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_PERMISSION_CONDITION.members["conditionOperator"], + self.condition_operator, + ) + serializer.write_string( + _SCHEMA_PERMISSION_CONDITION.members["conditionKey"], self.condition_key + ) + _serialize_permission_condition_values( + serializer, + _SCHEMA_PERMISSION_CONDITION.members["conditionValues"], + self.condition_values, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["condition_operator"] = de.read_string( + _SCHEMA_PERMISSION_CONDITION.members["conditionOperator"] + ) + + case 1: + kwargs["condition_key"] = de.read_string( + _SCHEMA_PERMISSION_CONDITION.members["conditionKey"] + ) + + case 2: + kwargs["condition_values"] = ( + _deserialize_permission_condition_values( + de, _SCHEMA_PERMISSION_CONDITION.members["conditionValues"] + ) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_PERMISSION_CONDITION, consumer=_consumer) + return kwargs + + +def _serialize_permission_conditions( + serializer: ShapeSerializer, schema: Schema, value: list[PermissionCondition] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_permission_conditions( + deserializer: ShapeDeserializer, schema: Schema +) -> list[PermissionCondition]: + result: list[PermissionCondition] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(PermissionCondition.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class AssociatePermissionInput: + """Dataclass for AssociatePermissionInput structure.""" + + application_id: str | None = None + """The unique identifier of the Amazon Q Business application.""" + + statement_id: str | None = None + """A unique identifier for the policy statement.""" + + actions: list[str] | None = None + """ + The list of Amazon Q Business actions that the ISV is allowed to + perform. + """ + + conditions: list[PermissionCondition] | None = None + """ + The conditions that restrict when the permission is effective. These + conditions can be used to limit the permission based on specific + attributes of the request. + """ + + principal: str | None = None + """ + The Amazon Resource Name of the IAM role for the ISV that is being + granted permission. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ASSOCIATE_PERMISSION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["applicationId"], + self.application_id, + ) + + if self.statement_id is not None: + serializer.write_string( + _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["statementId"], + self.statement_id, + ) + + if self.actions is not None: + _serialize_q_iam_actions( + serializer, + _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["actions"], + self.actions, + ) + + if self.conditions is not None: + _serialize_permission_conditions( + serializer, + _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["conditions"], + self.conditions, + ) + + if self.principal is not None: + serializer.write_string( + _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["principal"], self.principal + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["applicationId"] + ) + + case 1: + kwargs["statement_id"] = de.read_string( + _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["statementId"] + ) + + case 2: + kwargs["actions"] = _deserialize_q_iam_actions( + de, _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["actions"] + ) + + case 3: + kwargs["conditions"] = _deserialize_permission_conditions( + de, _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["conditions"] + ) + + case 4: + kwargs["principal"] = de.read_string( + _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["principal"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ASSOCIATE_PERMISSION_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class AssociatePermissionOutput: + """Dataclass for AssociatePermissionOutput structure.""" + + statement: str | None = None + """The JSON representation of the added permission statement.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ASSOCIATE_PERMISSION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.statement is not None: + serializer.write_string( + _SCHEMA_ASSOCIATE_PERMISSION_OUTPUT.members["statement"], self.statement + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["statement"] = de.read_string( + _SCHEMA_ASSOCIATE_PERMISSION_OUTPUT.members["statement"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_ASSOCIATE_PERMISSION_OUTPUT, consumer=_consumer + ) + return kwargs + + +ASSOCIATE_PERMISSION = APIOperation( + input=AssociatePermissionInput, + output=AssociatePermissionOutput, + schema=_SCHEMA_ASSOCIATE_PERMISSION, + input_schema=_SCHEMA_ASSOCIATE_PERMISSION_INPUT, + output_schema=_SCHEMA_ASSOCIATE_PERMISSION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ConversationSource: + """ + The source reference for an existing attachment in an existing + conversation. + """ + + conversation_id: str + """The unique identifier of the Amazon Q Business conversation.""" + + attachment_id: str + """The unique identifier of the Amazon Q Business attachment.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CONVERSATION_SOURCE, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_CONVERSATION_SOURCE.members["conversationId"], self.conversation_id + ) + serializer.write_string( + _SCHEMA_CONVERSATION_SOURCE.members["attachmentId"], self.attachment_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_CONVERSATION_SOURCE.members["conversationId"] + ) + + case 1: + kwargs["attachment_id"] = de.read_string( + _SCHEMA_CONVERSATION_SOURCE.members["attachmentId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CONVERSATION_SOURCE, consumer=_consumer) + return kwargs + + +@dataclass +class CopyFromSourceConversation: + """A reference to an attachment in an existing conversation.""" + + value: ConversationSource + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_COPY_FROM_SOURCE, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_COPY_FROM_SOURCE.members["conversation"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=ConversationSource.deserialize(deserializer)) + + +@dataclass +class CopyFromSourceUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +CopyFromSource = Union[CopyFromSourceConversation | CopyFromSourceUnknown] +"""The source reference for an existing attachment.""" + + +class _CopyFromSourceDeserializer: + _result: CopyFromSource | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> CopyFromSource: + self._result = None + deserializer.read_struct(_SCHEMA_COPY_FROM_SOURCE, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(CopyFromSourceConversation.deserialize(de)) + + case _: + self._set_result(CopyFromSourceUnknown(tag=schema.expect_member_name())) + + def _set_result(self, value: CopyFromSource) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +class AttachmentStatus(StrEnum): + FAILED = "FAILED" + SUCCESS = "SUCCESS" + + +@dataclass(kw_only=True) +class Attachment: + """An attachment in an Amazon Q Business conversation.""" + + attachment_id: str | None = None + """The identifier of the Amazon Q Business attachment.""" + + conversation_id: str | None = None + """ + The identifier of the Amazon Q Business conversation the attachment is + associated with. + """ + + name: str | None = None + """Filename of the Amazon Q Business attachment.""" + + copy_from: CopyFromSource | None = None + """ + A CopyFromSource containing a reference to the original source of the + Amazon Q Business attachment. + """ + + file_type: str | None = None + """Filetype of the Amazon Q Business attachment.""" + + file_size: int | None = None + """Size in bytes of the Amazon Q Business attachment.""" + + md5chksum: str | None = None + """MD5 checksum of the Amazon Q Business attachment contents.""" + + created_at: datetime | None = None + """The Unix timestamp when the Amazon Q Business attachment was created.""" + + status: str | None = None + """AttachmentStatus of the Amazon Q Business attachment.""" + + error: ErrorDetail | None = None + """ + ErrorDetail providing information about a Amazon Q Business attachment + error. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ATTACHMENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.attachment_id is not None: + serializer.write_string( + _SCHEMA_ATTACHMENT.members["attachmentId"], self.attachment_id + ) + + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_ATTACHMENT.members["conversationId"], self.conversation_id + ) + + if self.name is not None: + serializer.write_string(_SCHEMA_ATTACHMENT.members["name"], self.name) + + if self.copy_from is not None: + serializer.write_struct( + _SCHEMA_ATTACHMENT.members["copyFrom"], self.copy_from + ) + + if self.file_type is not None: + serializer.write_string( + _SCHEMA_ATTACHMENT.members["fileType"], self.file_type + ) + + if self.file_size is not None: + serializer.write_integer( + _SCHEMA_ATTACHMENT.members["fileSize"], self.file_size + ) + + if self.md5chksum is not None: + serializer.write_string( + _SCHEMA_ATTACHMENT.members["md5chksum"], self.md5chksum + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_ATTACHMENT.members["createdAt"], self.created_at + ) + + if self.status is not None: + serializer.write_string(_SCHEMA_ATTACHMENT.members["status"], self.status) + + if self.error is not None: + serializer.write_struct(_SCHEMA_ATTACHMENT.members["error"], self.error) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["attachment_id"] = de.read_string( + _SCHEMA_ATTACHMENT.members["attachmentId"] + ) + + case 1: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_ATTACHMENT.members["conversationId"] + ) + + case 2: + kwargs["name"] = de.read_string(_SCHEMA_ATTACHMENT.members["name"]) + + case 3: + kwargs["copy_from"] = _CopyFromSourceDeserializer().deserialize(de) + + case 4: + kwargs["file_type"] = de.read_string( + _SCHEMA_ATTACHMENT.members["fileType"] + ) + + case 5: + kwargs["file_size"] = de.read_integer( + _SCHEMA_ATTACHMENT.members["fileSize"] + ) + + case 6: + kwargs["md5chksum"] = de.read_string( + _SCHEMA_ATTACHMENT.members["md5chksum"] + ) + + case 7: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_ATTACHMENT.members["createdAt"] + ) + + case 8: + kwargs["status"] = de.read_string( + _SCHEMA_ATTACHMENT.members["status"] + ) + + case 9: + kwargs["error"] = ErrorDetail.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ATTACHMENT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class AttachmentInput: + """ + This is either a file directly uploaded into a web experience chat or a + reference to an existing attachment that is part of a web experience + chat. + """ + + data: bytes | None = None + """The contents of the attachment.""" + + name: str | None = None + """The filename of the attachment.""" + + copy_from: CopyFromSource | None = None + """A reference to an existing attachment.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ATTACHMENT_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.data is not None: + serializer.write_blob(_SCHEMA_ATTACHMENT_INPUT.members["data"], self.data) + + if self.name is not None: + serializer.write_string(_SCHEMA_ATTACHMENT_INPUT.members["name"], self.name) + + if self.copy_from is not None: + serializer.write_struct( + _SCHEMA_ATTACHMENT_INPUT.members["copyFrom"], self.copy_from + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["data"] = de.read_blob( + _SCHEMA_ATTACHMENT_INPUT.members["data"] + ) + + case 1: + kwargs["name"] = de.read_string( + _SCHEMA_ATTACHMENT_INPUT.members["name"] + ) + + case 2: + kwargs["copy_from"] = _CopyFromSourceDeserializer().deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ATTACHMENT_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class AttachmentInputEvent: + """ + A file input event activated by a end user request to upload files into + their web experience chat. + """ + + attachment: AttachmentInput | None = None + """ + This is either a file directly uploaded into a web experience chat or a + reference to an existing attachment that is part of a web experience + chat. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ATTACHMENT_INPUT_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.attachment is not None: + serializer.write_struct( + _SCHEMA_ATTACHMENT_INPUT_EVENT.members["attachment"], self.attachment + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["attachment"] = AttachmentInput.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ATTACHMENT_INPUT_EVENT, consumer=_consumer) + return kwargs + + +def _serialize_attachment_list( + serializer: ShapeSerializer, schema: Schema, value: list[Attachment] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_attachment_list( + deserializer: ShapeDeserializer, schema: Schema +) -> list[Attachment]: + result: list[Attachment] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(Attachment.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class AttachmentOutput: + """The details of a file uploaded during chat.""" + + name: str | None = None + """The name of a file uploaded during chat.""" + + status: str | None = None + """The status of a file uploaded during chat.""" + + error: ErrorDetail | None = None + """An error associated with a file uploaded during chat.""" + + attachment_id: str | None = None + """The unique identifier of the Amazon Q Business attachment.""" + + conversation_id: str | None = None + """The unique identifier of the Amazon Q Business conversation.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ATTACHMENT_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.name is not None: + serializer.write_string( + _SCHEMA_ATTACHMENT_OUTPUT.members["name"], self.name + ) + + if self.status is not None: + serializer.write_string( + _SCHEMA_ATTACHMENT_OUTPUT.members["status"], self.status + ) + + if self.error is not None: + serializer.write_struct( + _SCHEMA_ATTACHMENT_OUTPUT.members["error"], self.error + ) + + if self.attachment_id is not None: + serializer.write_string( + _SCHEMA_ATTACHMENT_OUTPUT.members["attachmentId"], self.attachment_id + ) + + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_ATTACHMENT_OUTPUT.members["conversationId"], + self.conversation_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["name"] = de.read_string( + _SCHEMA_ATTACHMENT_OUTPUT.members["name"] + ) + + case 1: + kwargs["status"] = de.read_string( + _SCHEMA_ATTACHMENT_OUTPUT.members["status"] + ) + + case 2: + kwargs["error"] = ErrorDetail.deserialize(de) + + case 3: + kwargs["attachment_id"] = de.read_string( + _SCHEMA_ATTACHMENT_OUTPUT.members["attachmentId"] + ) + + case 4: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_ATTACHMENT_OUTPUT.members["conversationId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ATTACHMENT_OUTPUT, consumer=_consumer) + return kwargs + + +def _serialize_attachments_input( + serializer: ShapeSerializer, schema: Schema, value: list[AttachmentInput] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_attachments_input( + deserializer: ShapeDeserializer, schema: Schema +) -> list[AttachmentInput]: + result: list[AttachmentInput] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(AttachmentInput.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +def _serialize_attachments_output( + serializer: ShapeSerializer, schema: Schema, value: list[AttachmentOutput] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_attachments_output( + deserializer: ShapeDeserializer, schema: Schema +) -> list[AttachmentOutput]: + result: list[AttachmentOutput] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(AttachmentOutput.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +class AudioExtractionType(StrEnum): + TRANSCRIPT = "TRANSCRIPT" + SUMMARY = "SUMMARY" + + +@dataclass(kw_only=True) +class AudioSourceDetails: + """ + Details about an audio source, including its identifier, format, and + time information. + """ + + media_id: str | None = None + """Unique identifier for the audio media file.""" + + media_mime_type: str | None = None + """The MIME type of the audio file (e.g., audio/mp3, audio/wav).""" + + start_time_milliseconds: int | None = None + """The starting timestamp in milliseconds for the relevant audio segment.""" + + end_time_milliseconds: int | None = None + """The ending timestamp in milliseconds for the relevant audio segment.""" + + audio_extraction_type: str | None = None + """The type of audio extraction performed on the content.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_AUDIO_SOURCE_DETAILS, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.media_id is not None: + serializer.write_string( + _SCHEMA_AUDIO_SOURCE_DETAILS.members["mediaId"], self.media_id + ) + + if self.media_mime_type is not None: + serializer.write_string( + _SCHEMA_AUDIO_SOURCE_DETAILS.members["mediaMimeType"], + self.media_mime_type, + ) + + if self.start_time_milliseconds is not None: + serializer.write_long( + _SCHEMA_AUDIO_SOURCE_DETAILS.members["startTimeMilliseconds"], + self.start_time_milliseconds, + ) + + if self.end_time_milliseconds is not None: + serializer.write_long( + _SCHEMA_AUDIO_SOURCE_DETAILS.members["endTimeMilliseconds"], + self.end_time_milliseconds, + ) + + if self.audio_extraction_type is not None: + serializer.write_string( + _SCHEMA_AUDIO_SOURCE_DETAILS.members["audioExtractionType"], + self.audio_extraction_type, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["media_id"] = de.read_string( + _SCHEMA_AUDIO_SOURCE_DETAILS.members["mediaId"] + ) + + case 1: + kwargs["media_mime_type"] = de.read_string( + _SCHEMA_AUDIO_SOURCE_DETAILS.members["mediaMimeType"] + ) + + case 2: + kwargs["start_time_milliseconds"] = de.read_long( + _SCHEMA_AUDIO_SOURCE_DETAILS.members["startTimeMilliseconds"] + ) + + case 3: + kwargs["end_time_milliseconds"] = de.read_long( + _SCHEMA_AUDIO_SOURCE_DETAILS.members["endTimeMilliseconds"] + ) + + case 4: + kwargs["audio_extraction_type"] = de.read_string( + _SCHEMA_AUDIO_SOURCE_DETAILS.members["audioExtractionType"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_AUDIO_SOURCE_DETAILS, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class AuthChallengeRequest: + """ + A request made by Amazon Q Business to a third paty authentication + server to authenticate a custom plugin user. + """ + + authorization_url: str + """ + The URL sent by Amazon Q Business to the third party authentication + server to authenticate a custom plugin user through an OAuth protocol. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_AUTH_CHALLENGE_REQUEST, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_AUTH_CHALLENGE_REQUEST.members["authorizationUrl"], + self.authorization_url, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["authorization_url"] = de.read_string( + _SCHEMA_AUTH_CHALLENGE_REQUEST.members["authorizationUrl"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_AUTH_CHALLENGE_REQUEST, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class AuthChallengeRequestEvent: + """ + An authentication verification event activated by an end user request to + use a custom plugin. + """ + + authorization_url: str + """ + The URL sent by Amazon Q Business to a third party authentication server + in response to an authentication verification event activated by an end + user request to use a custom plugin. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_AUTH_CHALLENGE_REQUEST_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_AUTH_CHALLENGE_REQUEST_EVENT.members["authorizationUrl"], + self.authorization_url, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["authorization_url"] = de.read_string( + _SCHEMA_AUTH_CHALLENGE_REQUEST_EVENT.members["authorizationUrl"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_AUTH_CHALLENGE_REQUEST_EVENT, consumer=_consumer + ) + return kwargs + + +def _serialize_authorization_response_map( + serializer: ShapeSerializer, schema: Schema, value: dict[str, str] +) -> None: + with serializer.begin_map(schema, len(value)) as m: + value_schema = schema.members["value"] + for k, v in value.items(): + m.entry(k, lambda vs: vs.write_string(value_schema, v)) + + +def _deserialize_authorization_response_map( + deserializer: ShapeDeserializer, schema: Schema +) -> dict[str, str]: + result: dict[str, str] = {} + value_schema = schema.members["value"] + + def _read_value(k: str, d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result[k] = d.read_string(value_schema) + + deserializer.read_map(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class AuthChallengeResponse: + """ + Contains details of the authentication information received from a third + party authentication server in response to an authentication challenge. + """ + + response_map: dict[str, str] + """The mapping of key-value pairs in an authentication challenge response.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_AUTH_CHALLENGE_RESPONSE, self) + + def serialize_members(self, serializer: ShapeSerializer): + _serialize_authorization_response_map( + serializer, + _SCHEMA_AUTH_CHALLENGE_RESPONSE.members["responseMap"], + self.response_map, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["response_map"] = _deserialize_authorization_response_map( + de, _SCHEMA_AUTH_CHALLENGE_RESPONSE.members["responseMap"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_AUTH_CHALLENGE_RESPONSE, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class AuthChallengeResponseEvent: + """ + An authentication verification event response by a third party + authentication server to Amazon Q Business. + """ + + response_map: dict[str, str] + """The mapping of key-value pairs in an authentication challenge response.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_AUTH_CHALLENGE_RESPONSE_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + _serialize_authorization_response_map( + serializer, + _SCHEMA_AUTH_CHALLENGE_RESPONSE_EVENT.members["responseMap"], + self.response_map, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["response_map"] = _deserialize_authorization_response_map( + de, _SCHEMA_AUTH_CHALLENGE_RESPONSE_EVENT.members["responseMap"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_AUTH_CHALLENGE_RESPONSE_EVENT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class DeleteDocument: + """A document deleted from an Amazon Q Business data source connector.""" + + document_id: str + """The identifier of the deleted document.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_DOCUMENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_DELETE_DOCUMENT.members["documentId"], self.document_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["document_id"] = de.read_string( + _SCHEMA_DELETE_DOCUMENT.members["documentId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_DOCUMENT, consumer=_consumer) + return kwargs + + +def _serialize_delete_documents( + serializer: ShapeSerializer, schema: Schema, value: list[DeleteDocument] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_delete_documents( + deserializer: ShapeDeserializer, schema: Schema +) -> list[DeleteDocument]: + result: list[DeleteDocument] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(DeleteDocument.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class BatchDeleteDocumentInput: + """Dataclass for BatchDeleteDocumentInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application.""" + + index_id: str | None = None + """ + The identifier of the Amazon Q Business index that contains the + documents to delete. + """ + + documents: list[DeleteDocument] | None = None + """Documents deleted from the Amazon Q Business index.""" + + data_source_sync_id: str | None = None + """ + The identifier of the data source sync during which the documents were + deleted. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_BATCH_DELETE_DOCUMENT_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["indexId"], self.index_id + ) + + if self.documents is not None: + _serialize_delete_documents( + serializer, + _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["documents"], + self.documents, + ) + + if self.data_source_sync_id is not None: + serializer.write_string( + _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["dataSourceSyncId"], + self.data_source_sync_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["indexId"] + ) + + case 2: + kwargs["documents"] = _deserialize_delete_documents( + de, _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["documents"] + ) + + case 3: + kwargs["data_source_sync_id"] = de.read_string( + _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["dataSourceSyncId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class FailedDocument: + """ + A list of documents that could not be removed from an Amazon Q Business + index. Each entry contains an error message that indicates why the + document couldn't be removed from the index. + """ + + id: str | None = None + """ + The identifier of the document that couldn't be removed from the Amazon + Q Business index. + """ + + error: ErrorDetail | None = None + """An explanation for why the document couldn't be removed from the index.""" + + data_source_id: str | None = None + """ + The identifier of the Amazon Q Business data source connector that + contains the failed document. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_FAILED_DOCUMENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.id is not None: + serializer.write_string(_SCHEMA_FAILED_DOCUMENT.members["id"], self.id) + + if self.error is not None: + serializer.write_struct( + _SCHEMA_FAILED_DOCUMENT.members["error"], self.error + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_FAILED_DOCUMENT.members["dataSourceId"], self.data_source_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["id"] = de.read_string(_SCHEMA_FAILED_DOCUMENT.members["id"]) + + case 1: + kwargs["error"] = ErrorDetail.deserialize(de) + + case 2: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_FAILED_DOCUMENT.members["dataSourceId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_FAILED_DOCUMENT, consumer=_consumer) + return kwargs + + +def _serialize_failed_documents( + serializer: ShapeSerializer, schema: Schema, value: list[FailedDocument] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_failed_documents( + deserializer: ShapeDeserializer, schema: Schema +) -> list[FailedDocument]: + result: list[FailedDocument] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(FailedDocument.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class BatchDeleteDocumentOutput: + """Dataclass for BatchDeleteDocumentOutput structure.""" + + failed_documents: list[FailedDocument] | None = None + """ + A list of documents that couldn't be removed from the Amazon Q Business + index. Each entry contains an error message that indicates why the + document couldn't be removed from the index. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.failed_documents is not None: + _serialize_failed_documents( + serializer, + _SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT.members["failedDocuments"], + self.failed_documents, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["failed_documents"] = _deserialize_failed_documents( + de, + _SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT.members["failedDocuments"], + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT, consumer=_consumer + ) + return kwargs + + +BATCH_DELETE_DOCUMENT = APIOperation( + input=BatchDeleteDocumentInput, + output=BatchDeleteDocumentOutput, + schema=_SCHEMA_BATCH_DELETE_DOCUMENT, + input_schema=_SCHEMA_BATCH_DELETE_DOCUMENT_INPUT, + output_schema=_SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +def _serialize_document_attributes( + serializer: ShapeSerializer, schema: Schema, value: list[DocumentAttribute] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_document_attributes( + deserializer: ShapeDeserializer, schema: Schema +) -> list[DocumentAttribute]: + result: list[DocumentAttribute] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(DocumentAttribute.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass +class DocumentContentBlob: + """ + The contents of the document. Documents passed to the `blob` parameter + must be base64 encoded. Your code might not need to encode the document + file bytes if you're using an Amazon Web Services SDK to call Amazon Q + Business APIs. If you are calling the Amazon Q Business endpoint + directly using REST, you must base64 encode the contents before sending. + """ + + value: bytes + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_CONTENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_blob(_SCHEMA_DOCUMENT_CONTENT.members["blob"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls( + value=deserializer.read_blob(_SCHEMA_DOCUMENT_CONTENT.members["blob"]) + ) + + +@dataclass +class DocumentContentS3: + """The path to the document in an Amazon S3 bucket.""" + + value: S3 + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_CONTENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_CONTENT.members["s3"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=S3.deserialize(deserializer)) + + +@dataclass +class DocumentContentUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +DocumentContent = Union[ + DocumentContentBlob | DocumentContentS3 | DocumentContentUnknown +] +""" +The contents of a document. + +Note: + Documents have size limitations. The maximum file size for a document is + 50 MB. The maximum amount of text that can be extracted from a single + document is 5 MB. For more information, see [Supported document formats + in Amazon Q + Business](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/doc-types.html). +""" + + +class _DocumentContentDeserializer: + _result: DocumentContent | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> DocumentContent: + self._result = None + deserializer.read_struct(_SCHEMA_DOCUMENT_CONTENT, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(DocumentContentBlob.deserialize(de)) + + case 1: + self._set_result(DocumentContentS3.deserialize(de)) + + case _: + self._set_result( + DocumentContentUnknown(tag=schema.expect_member_name()) + ) + + def _set_result(self, value: DocumentContent) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +class ContentType(StrEnum): + PDF = "PDF" + HTML = "HTML" + MS_WORD = "MS_WORD" + PLAIN_TEXT = "PLAIN_TEXT" + PPT = "PPT" + RTF = "RTF" + XML = "XML" + XSLT = "XSLT" + MS_EXCEL = "MS_EXCEL" + CSV = "CSV" + JSON = "JSON" + MD = "MD" + + +@dataclass(kw_only=True) +class Document: + """A document in an Amazon Q Business application.""" + + id: str + """The identifier of the document.""" + + attributes: list[DocumentAttribute] | None = None + """ + Custom attributes to apply to the document for refining Amazon Q + Business web experience responses. + """ + + content: DocumentContent | None = None + """The contents of the document.""" + + content_type: str | None = None + """ + The file type of the document in the Blob field. + + If you want to index snippets or subsets of HTML documents instead of + the entirety of the HTML documents, you add the `HTML` start and closing + tags (`content`) around the content. + """ + + title: str | None = None + """The title of the document.""" + + access_configuration: AccessConfiguration | None = None + """Configuration information for access permission to a document.""" + + document_enrichment_configuration: DocumentEnrichmentConfiguration | None = None + """ + The configuration information for altering document metadata and content + during the document ingestion process. + """ + + media_extraction_configuration: MediaExtractionConfiguration | None = None + """The configuration for extracting information from media in the document.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string(_SCHEMA_DOCUMENT.members["id"], self.id) + if self.attributes is not None: + _serialize_document_attributes( + serializer, _SCHEMA_DOCUMENT.members["attributes"], self.attributes + ) + + if self.content is not None: + serializer.write_struct(_SCHEMA_DOCUMENT.members["content"], self.content) + + if self.content_type is not None: + serializer.write_string( + _SCHEMA_DOCUMENT.members["contentType"], self.content_type + ) + + if self.title is not None: + serializer.write_string(_SCHEMA_DOCUMENT.members["title"], self.title) + + if self.access_configuration is not None: + serializer.write_struct( + _SCHEMA_DOCUMENT.members["accessConfiguration"], + self.access_configuration, + ) + + if self.document_enrichment_configuration is not None: + serializer.write_struct( + _SCHEMA_DOCUMENT.members["documentEnrichmentConfiguration"], + self.document_enrichment_configuration, + ) + + if self.media_extraction_configuration is not None: + serializer.write_struct( + _SCHEMA_DOCUMENT.members["mediaExtractionConfiguration"], + self.media_extraction_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["id"] = de.read_string(_SCHEMA_DOCUMENT.members["id"]) + + case 1: + kwargs["attributes"] = _deserialize_document_attributes( + de, _SCHEMA_DOCUMENT.members["attributes"] + ) + + case 2: + kwargs["content"] = _DocumentContentDeserializer().deserialize(de) + + case 3: + kwargs["content_type"] = de.read_string( + _SCHEMA_DOCUMENT.members["contentType"] + ) + + case 4: + kwargs["title"] = de.read_string(_SCHEMA_DOCUMENT.members["title"]) + + case 5: + kwargs["access_configuration"] = AccessConfiguration.deserialize(de) + + case 6: + kwargs["document_enrichment_configuration"] = ( + DocumentEnrichmentConfiguration.deserialize(de) + ) + + case 7: + kwargs["media_extraction_configuration"] = ( + MediaExtractionConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DOCUMENT, consumer=_consumer) + return kwargs + + +def _serialize_documents( + serializer: ShapeSerializer, schema: Schema, value: list[Document] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_documents( + deserializer: ShapeDeserializer, schema: Schema +) -> list[Document]: + result: list[Document] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(Document.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class BatchPutDocumentInput: + """Dataclass for BatchPutDocumentInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application.""" + + index_id: str | None = None + """The identifier of the Amazon Q Business index to add the documents to.""" + + documents: list[Document] | None = None + """ + One or more documents to add to the index. + + Warning: + Ensure that the name of your document doesn't contain any confidential + information. Amazon Q Business returns document names in chat responses + and citations when relevant. + """ + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of an IAM role with permission to access + your S3 bucket. + """ + + data_source_sync_id: str | None = None + """ + The identifier of the data source sync during which the documents were + added. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_BATCH_PUT_DOCUMENT_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["indexId"], self.index_id + ) + + if self.documents is not None: + _serialize_documents( + serializer, + _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["documents"], + self.documents, + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["roleArn"], self.role_arn + ) + + if self.data_source_sync_id is not None: + serializer.write_string( + _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["dataSourceSyncId"], + self.data_source_sync_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["indexId"] + ) + + case 2: + kwargs["documents"] = _deserialize_documents( + de, _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["documents"] + ) + + case 3: + kwargs["role_arn"] = de.read_string( + _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["roleArn"] + ) + + case 4: + kwargs["data_source_sync_id"] = de.read_string( + _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["dataSourceSyncId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_BATCH_PUT_DOCUMENT_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class BatchPutDocumentOutput: + """Dataclass for BatchPutDocumentOutput structure.""" + + failed_documents: list[FailedDocument] | None = None + """ + A list of documents that were not added to the Amazon Q Business index + because the document failed a validation check. Each document contains + an error message that indicates why the document couldn't be added to + the index. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.failed_documents is not None: + _serialize_failed_documents( + serializer, + _SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT.members["failedDocuments"], + self.failed_documents, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["failed_documents"] = _deserialize_failed_documents( + de, _SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT.members["failedDocuments"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT, consumer=_consumer) + return kwargs + + +BATCH_PUT_DOCUMENT = APIOperation( + input=BatchPutDocumentInput, + output=BatchPutDocumentOutput, + schema=_SCHEMA_BATCH_PUT_DOCUMENT, + input_schema=_SCHEMA_BATCH_PUT_DOCUMENT_INPUT, + output_schema=_SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +def _serialize_blocked_phrases( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_blocked_phrases( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class BlockedPhrasesConfiguration: + """ + Provides information about the phrases blocked from chat by your chat + control configuration. + """ + + blocked_phrases: list[str] | None = None + """ + A list of phrases blocked from a Amazon Q Business web experience chat. + + Note: + Each phrase can contain a maximum of 36 characters. The list can contain + a maximum of 20 phrases. + """ + + system_message_override: str | None = None + """ + The configured custom message displayed to an end user informing them + that they've used a blocked phrase during chat. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_BLOCKED_PHRASES_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.blocked_phrases is not None: + _serialize_blocked_phrases( + serializer, + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION.members["blockedPhrases"], + self.blocked_phrases, + ) + + if self.system_message_override is not None: + serializer.write_string( + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION.members["systemMessageOverride"], + self.system_message_override, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["blocked_phrases"] = _deserialize_blocked_phrases( + de, + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION.members["blockedPhrases"], + ) + + case 1: + kwargs["system_message_override"] = de.read_string( + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION.members[ + "systemMessageOverride" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class BlockedPhrasesConfigurationUpdate: + """ + Updates a blocked phrases configuration in your Amazon Q Business + application. + """ + + blocked_phrases_to_create_or_update: list[str] | None = None + """ + Creates or updates a blocked phrases configuration in your Amazon Q + Business application. + """ + + blocked_phrases_to_delete: list[str] | None = None + """ + Deletes a blocked phrases configuration in your Amazon Q Business + application. + """ + + system_message_override: str | None = None + """ + The configured custom message displayed to your end user when they use + blocked phrase during chat. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.blocked_phrases_to_create_or_update is not None: + _serialize_blocked_phrases( + serializer, + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ + "blockedPhrasesToCreateOrUpdate" + ], + self.blocked_phrases_to_create_or_update, + ) + + if self.blocked_phrases_to_delete is not None: + _serialize_blocked_phrases( + serializer, + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ + "blockedPhrasesToDelete" + ], + self.blocked_phrases_to_delete, + ) + + if self.system_message_override is not None: + serializer.write_string( + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ + "systemMessageOverride" + ], + self.system_message_override, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["blocked_phrases_to_create_or_update"] = ( + _deserialize_blocked_phrases( + de, + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ + "blockedPhrasesToCreateOrUpdate" + ], + ) + ) + + case 1: + kwargs["blocked_phrases_to_delete"] = _deserialize_blocked_phrases( + de, + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ + "blockedPhrasesToDelete" + ], + ) + + case 2: + kwargs["system_message_override"] = de.read_string( + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ + "systemMessageOverride" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class CancelSubscriptionInput: + """Dataclass for CancelSubscriptionInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application for which the + subscription is being cancelled. + """ + + subscription_id: str | None = None + """The identifier of the Amazon Q Business subscription being cancelled.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CANCEL_SUBSCRIPTION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CANCEL_SUBSCRIPTION_INPUT.members["applicationId"], + self.application_id, + ) + + if self.subscription_id is not None: + serializer.write_string( + _SCHEMA_CANCEL_SUBSCRIPTION_INPUT.members["subscriptionId"], + self.subscription_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CANCEL_SUBSCRIPTION_INPUT.members["applicationId"] + ) + + case 1: + kwargs["subscription_id"] = de.read_string( + _SCHEMA_CANCEL_SUBSCRIPTION_INPUT.members["subscriptionId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CANCEL_SUBSCRIPTION_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class SubscriptionDetails: + """The details of an Amazon Q Business subscription.""" + + type: str | None = None + """The type of an Amazon Q Business subscription.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SUBSCRIPTION_DETAILS, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.type is not None: + serializer.write_string( + _SCHEMA_SUBSCRIPTION_DETAILS.members["type"], self.type + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["type"] = de.read_string( + _SCHEMA_SUBSCRIPTION_DETAILS.members["type"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_SUBSCRIPTION_DETAILS, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class CancelSubscriptionOutput: + """Dataclass for CancelSubscriptionOutput structure.""" + + subscription_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the Amazon Q Business subscription + being cancelled. + """ + + current_subscription: SubscriptionDetails | None = None + """The type of your current Amazon Q Business subscription.""" + + next_subscription: SubscriptionDetails | None = None + """The type of the Amazon Q Business subscription for the next month.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.subscription_arn is not None: + serializer.write_string( + _SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT.members["subscriptionArn"], + self.subscription_arn, + ) + + if self.current_subscription is not None: + serializer.write_struct( + _SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT.members["currentSubscription"], + self.current_subscription, + ) + + if self.next_subscription is not None: + serializer.write_struct( + _SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT.members["nextSubscription"], + self.next_subscription, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["subscription_arn"] = de.read_string( + _SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT.members["subscriptionArn"] + ) + + case 1: + kwargs["current_subscription"] = SubscriptionDetails.deserialize(de) + + case 2: + kwargs["next_subscription"] = SubscriptionDetails.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT, consumer=_consumer) + return kwargs + + +CANCEL_SUBSCRIPTION = APIOperation( + input=CancelSubscriptionInput, + output=CancelSubscriptionOutput, + schema=_SCHEMA_CANCEL_SUBSCRIPTION, + input_schema=_SCHEMA_CANCEL_SUBSCRIPTION_INPUT, + output_schema=_SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +class ChatMode(StrEnum): + RETRIEVAL_MODE = "RETRIEVAL_MODE" + CREATOR_MODE = "CREATOR_MODE" + PLUGIN_MODE = "PLUGIN_MODE" + + +@dataclass(kw_only=True) +class PluginConfiguration: + """ + Configuration information required to invoke chat in `PLUGIN_MODE`. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html), + [Plugins](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html), + and [Conversation + settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + + plugin_id: str + """The identifier of the plugin you want to use.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PLUGIN_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_PLUGIN_CONFIGURATION.members["pluginId"], self.plugin_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_PLUGIN_CONFIGURATION.members["pluginId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_PLUGIN_CONFIGURATION, consumer=_consumer) + return kwargs + + +@dataclass +class ChatModeConfigurationPluginConfiguration: + """Configuration information required to invoke chat in `PLUGIN_MODE`.""" + + value: PluginConfiguration + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_MODE_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_MODE_CONFIGURATION.members["pluginConfiguration"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=PluginConfiguration.deserialize(deserializer)) + + +@dataclass +class ChatModeConfigurationUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +ChatModeConfiguration = Union[ + ChatModeConfigurationPluginConfiguration | ChatModeConfigurationUnknown +] +""" +Configuration information for Amazon Q Business conversation modes. + +For more information, see [Admin controls and +guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) +and [Conversation +settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). +""" + + +class _ChatModeConfigurationDeserializer: + _result: ChatModeConfiguration | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> ChatModeConfiguration: + self._result = None + deserializer.read_struct(_SCHEMA_CHAT_MODE_CONFIGURATION, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result( + ChatModeConfigurationPluginConfiguration.deserialize(de) + ) + + case _: + self._set_result( + ChatModeConfigurationUnknown(tag=schema.expect_member_name()) + ) + + def _set_result(self, value: ChatModeConfiguration) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +@dataclass(kw_only=True) +class EndOfInputEvent: + """The end of the streaming input for the `Chat` API.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_END_OF_INPUT_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_END_OF_INPUT_EVENT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class TextInputEvent: + """ + An input event for a end user message in an Amazon Q Business web + experience. + """ + + user_message: str + """A user message in a text message input event.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_TEXT_INPUT_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_TEXT_INPUT_EVENT.members["userMessage"], self.user_message + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["user_message"] = de.read_string( + _SCHEMA_TEXT_INPUT_EVENT.members["userMessage"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_TEXT_INPUT_EVENT, consumer=_consumer) + return kwargs + + +def _serialize_user_groups( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_user_groups( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class FailedAttachmentEvent: + """A failed file upload during web experience chat.""" + + conversation_id: str | None = None + """ + The identifier of the conversation associated with the failed file + upload. + """ + + user_message_id: str | None = None + """ + The identifier of the end user chat message associated with the file + upload. + """ + + system_message_id: str | None = None + """ + The identifier of the AI-generated message associated with the file + upload. + """ + + attachment: AttachmentOutput | None = None + """The details of a file uploaded during chat.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_FAILED_ATTACHMENT_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_FAILED_ATTACHMENT_EVENT.members["conversationId"], + self.conversation_id, + ) + + if self.user_message_id is not None: + serializer.write_string( + _SCHEMA_FAILED_ATTACHMENT_EVENT.members["userMessageId"], + self.user_message_id, + ) + + if self.system_message_id is not None: + serializer.write_string( + _SCHEMA_FAILED_ATTACHMENT_EVENT.members["systemMessageId"], + self.system_message_id, + ) + + if self.attachment is not None: + serializer.write_struct( + _SCHEMA_FAILED_ATTACHMENT_EVENT.members["attachment"], self.attachment + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_FAILED_ATTACHMENT_EVENT.members["conversationId"] + ) + + case 1: + kwargs["user_message_id"] = de.read_string( + _SCHEMA_FAILED_ATTACHMENT_EVENT.members["userMessageId"] + ) + + case 2: + kwargs["system_message_id"] = de.read_string( + _SCHEMA_FAILED_ATTACHMENT_EVENT.members["systemMessageId"] + ) + + case 3: + kwargs["attachment"] = AttachmentOutput.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_FAILED_ATTACHMENT_EVENT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class SnippetExcerpt: + """ + Contains the relevant text excerpt from a source that was used to + generate a citation text segment in an Amazon Q Business chat response. + """ + + text: str | None = None + """ + The relevant text excerpt from a source that was used to generate a + citation text segment in an Amazon Q chat response. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SNIPPET_EXCERPT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.text is not None: + serializer.write_string(_SCHEMA_SNIPPET_EXCERPT.members["text"], self.text) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["text"] = de.read_string( + _SCHEMA_SNIPPET_EXCERPT.members["text"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_SNIPPET_EXCERPT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ImageSourceDetails: + """Details about an image source, including its identifier and format.""" + + media_id: str | None = None + """Unique identifier for the image file.""" + + media_mime_type: str | None = None + """The MIME type of the image file.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_IMAGE_SOURCE_DETAILS, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.media_id is not None: + serializer.write_string( + _SCHEMA_IMAGE_SOURCE_DETAILS.members["mediaId"], self.media_id + ) + + if self.media_mime_type is not None: + serializer.write_string( + _SCHEMA_IMAGE_SOURCE_DETAILS.members["mediaMimeType"], + self.media_mime_type, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["media_id"] = de.read_string( + _SCHEMA_IMAGE_SOURCE_DETAILS.members["mediaId"] + ) + + case 1: + kwargs["media_mime_type"] = de.read_string( + _SCHEMA_IMAGE_SOURCE_DETAILS.members["mediaMimeType"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_IMAGE_SOURCE_DETAILS, consumer=_consumer) + return kwargs + + +class VideoExtractionType(StrEnum): + TRANSCRIPT = "TRANSCRIPT" + SUMMARY = "SUMMARY" + + +@dataclass(kw_only=True) +class VideoSourceDetails: + """ + Details about a video source, including its identifier, format, and time + information. + """ + + media_id: str | None = None + """Unique identifier for the video media file.""" + + media_mime_type: str | None = None + """The MIME type of the video file (e.g., video/mp4, video/avi).""" + + start_time_milliseconds: int | None = None + """The starting timestamp in milliseconds for the relevant video segment.""" + + end_time_milliseconds: int | None = None + """The ending timestamp in milliseconds for the relevant video segment.""" + + video_extraction_type: str | None = None + """The type of video extraction performed on the content.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_VIDEO_SOURCE_DETAILS, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.media_id is not None: + serializer.write_string( + _SCHEMA_VIDEO_SOURCE_DETAILS.members["mediaId"], self.media_id + ) + + if self.media_mime_type is not None: + serializer.write_string( + _SCHEMA_VIDEO_SOURCE_DETAILS.members["mediaMimeType"], + self.media_mime_type, + ) + + if self.start_time_milliseconds is not None: + serializer.write_long( + _SCHEMA_VIDEO_SOURCE_DETAILS.members["startTimeMilliseconds"], + self.start_time_milliseconds, + ) + + if self.end_time_milliseconds is not None: + serializer.write_long( + _SCHEMA_VIDEO_SOURCE_DETAILS.members["endTimeMilliseconds"], + self.end_time_milliseconds, + ) + + if self.video_extraction_type is not None: + serializer.write_string( + _SCHEMA_VIDEO_SOURCE_DETAILS.members["videoExtractionType"], + self.video_extraction_type, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["media_id"] = de.read_string( + _SCHEMA_VIDEO_SOURCE_DETAILS.members["mediaId"] + ) + + case 1: + kwargs["media_mime_type"] = de.read_string( + _SCHEMA_VIDEO_SOURCE_DETAILS.members["mediaMimeType"] + ) + + case 2: + kwargs["start_time_milliseconds"] = de.read_long( + _SCHEMA_VIDEO_SOURCE_DETAILS.members["startTimeMilliseconds"] + ) + + case 3: + kwargs["end_time_milliseconds"] = de.read_long( + _SCHEMA_VIDEO_SOURCE_DETAILS.members["endTimeMilliseconds"] + ) + + case 4: + kwargs["video_extraction_type"] = de.read_string( + _SCHEMA_VIDEO_SOURCE_DETAILS.members["videoExtractionType"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_VIDEO_SOURCE_DETAILS, consumer=_consumer) + return kwargs + + +@dataclass +class SourceDetailsImageSourceDetails: + """Details specific to image content within the source.""" + + value: ImageSourceDetails + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SOURCE_DETAILS, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_SOURCE_DETAILS.members["imageSourceDetails"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=ImageSourceDetails.deserialize(deserializer)) + + +@dataclass +class SourceDetailsAudioSourceDetails: + """Details specific to audio content within the source.""" + + value: AudioSourceDetails + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SOURCE_DETAILS, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_SOURCE_DETAILS.members["audioSourceDetails"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=AudioSourceDetails.deserialize(deserializer)) + + +@dataclass +class SourceDetailsVideoSourceDetails: + """Details specific to video content within the source.""" + + value: VideoSourceDetails + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SOURCE_DETAILS, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_SOURCE_DETAILS.members["videoSourceDetails"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=VideoSourceDetails.deserialize(deserializer)) + + +@dataclass +class SourceDetailsUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +SourceDetails = Union[ + SourceDetailsImageSourceDetails + | SourceDetailsAudioSourceDetails + | SourceDetailsVideoSourceDetails + | SourceDetailsUnknown +] +""" +Container for details about different types of media sources (image, +audio, or video). +""" + + +class _SourceDetailsDeserializer: + _result: SourceDetails | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> SourceDetails: + self._result = None + deserializer.read_struct(_SCHEMA_SOURCE_DETAILS, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(SourceDetailsImageSourceDetails.deserialize(de)) + + case 1: + self._set_result(SourceDetailsAudioSourceDetails.deserialize(de)) + + case 2: + self._set_result(SourceDetailsVideoSourceDetails.deserialize(de)) + + case _: + self._set_result(SourceDetailsUnknown(tag=schema.expect_member_name())) + + def _set_result(self, value: SourceDetails) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +@dataclass(kw_only=True) +class TextSegment: + """ + Provides information about a text extract in a chat response that can be + attributed to a source document. + """ + + begin_offset: int | None = None + """ + The zero-based location in the response string where the source + attribution starts. + """ + + end_offset: int | None = None + """ + The zero-based location in the response string where the source + attribution ends. + """ + + snippet_excerpt: SnippetExcerpt | None = None + """ + The relevant text excerpt from a source that was used to generate a + citation text segment in an Amazon Q Business chat response. + """ + + media_id: str | None = None + """ + The identifier of the media object associated with the text segment in + the source attribution. + """ + + media_mime_type: str | None = None + """ + The MIME type (image/png) of the media object associated with the text + segment in the source attribution. + """ + + source_details: SourceDetails | None = None + """ + Source information for a segment of extracted text, including its media + type. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_TEXT_SEGMENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.begin_offset is not None: + serializer.write_integer( + _SCHEMA_TEXT_SEGMENT.members["beginOffset"], self.begin_offset + ) + + if self.end_offset is not None: + serializer.write_integer( + _SCHEMA_TEXT_SEGMENT.members["endOffset"], self.end_offset + ) + + if self.snippet_excerpt is not None: + serializer.write_struct( + _SCHEMA_TEXT_SEGMENT.members["snippetExcerpt"], self.snippet_excerpt + ) + + if self.media_id is not None: + serializer.write_string( + _SCHEMA_TEXT_SEGMENT.members["mediaId"], self.media_id + ) + + if self.media_mime_type is not None: + serializer.write_string( + _SCHEMA_TEXT_SEGMENT.members["mediaMimeType"], self.media_mime_type + ) + + if self.source_details is not None: + serializer.write_struct( + _SCHEMA_TEXT_SEGMENT.members["sourceDetails"], self.source_details + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["begin_offset"] = de.read_integer( + _SCHEMA_TEXT_SEGMENT.members["beginOffset"] + ) + + case 1: + kwargs["end_offset"] = de.read_integer( + _SCHEMA_TEXT_SEGMENT.members["endOffset"] + ) + + case 2: + kwargs["snippet_excerpt"] = SnippetExcerpt.deserialize(de) + + case 3: + kwargs["media_id"] = de.read_string( + _SCHEMA_TEXT_SEGMENT.members["mediaId"] + ) + + case 4: + kwargs["media_mime_type"] = de.read_string( + _SCHEMA_TEXT_SEGMENT.members["mediaMimeType"] + ) + + case 5: + kwargs["source_details"] = _SourceDetailsDeserializer().deserialize( + de + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_TEXT_SEGMENT, consumer=_consumer) + return kwargs + + +def _serialize_text_segment_list( + serializer: ShapeSerializer, schema: Schema, value: list[TextSegment] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_text_segment_list( + deserializer: ShapeDeserializer, schema: Schema +) -> list[TextSegment]: + result: list[TextSegment] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(TextSegment.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class SourceAttribution: + """ + The documents used to generate an Amazon Q Business web experience + response. + """ + + title: str | None = None + """ + The title of the document which is the source for the Amazon Q Business + generated response. + """ + + snippet: str | None = None + """ + The content extract from the document on which the generated response is + based. + """ + + url: str | None = None + """ + The URL of the document which is the source for the Amazon Q Business + generated response. + """ + + citation_number: int | None = None + """ + The number attached to a citation in an Amazon Q Business generated + response. + """ + + updated_at: datetime | None = None + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + + text_message_segments: list[TextSegment] | None = None + """ + A text extract from a source document that is used for source + attribution. + """ + + document_id: str | None = None + """ + The unique identifier of the source document used in the citation, + obtained from the Amazon Q Business index during chat response + generation. This ID is used as input to the `GetDocumentContent` API to + retrieve the actual document content for user verification. + """ + + index_id: str | None = None + """ + The identifier of the index containing the source document's metadata + and access control information. This links the citation back to the + specific Amazon Q Business index where the document's searchable + content and permissions are stored. + """ + + datasource_id: str | None = None + """ + The identifier of the data source from which the document was ingested. + This field is not present if the document is ingested by directly + calling the BatchPutDocument API (similar to checkDocumentAccess). If + the document is from a file-upload data source, the datasource will be + \"uploaded-docs-file-stat-datasourceid\". + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SOURCE_ATTRIBUTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.title is not None: + serializer.write_string( + _SCHEMA_SOURCE_ATTRIBUTION.members["title"], self.title + ) + + if self.snippet is not None: + serializer.write_string( + _SCHEMA_SOURCE_ATTRIBUTION.members["snippet"], self.snippet + ) + + if self.url is not None: + serializer.write_string(_SCHEMA_SOURCE_ATTRIBUTION.members["url"], self.url) + + if self.citation_number is not None: + serializer.write_integer( + _SCHEMA_SOURCE_ATTRIBUTION.members["citationNumber"], + self.citation_number, + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_SOURCE_ATTRIBUTION.members["updatedAt"], self.updated_at + ) + + if self.text_message_segments is not None: + _serialize_text_segment_list( + serializer, + _SCHEMA_SOURCE_ATTRIBUTION.members["textMessageSegments"], + self.text_message_segments, + ) + + if self.document_id is not None: + serializer.write_string( + _SCHEMA_SOURCE_ATTRIBUTION.members["documentId"], self.document_id + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_SOURCE_ATTRIBUTION.members["indexId"], self.index_id + ) + + if self.datasource_id is not None: + serializer.write_string( + _SCHEMA_SOURCE_ATTRIBUTION.members["datasourceId"], self.datasource_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["title"] = de.read_string( + _SCHEMA_SOURCE_ATTRIBUTION.members["title"] + ) + + case 1: + kwargs["snippet"] = de.read_string( + _SCHEMA_SOURCE_ATTRIBUTION.members["snippet"] + ) + + case 2: + kwargs["url"] = de.read_string( + _SCHEMA_SOURCE_ATTRIBUTION.members["url"] + ) + + case 3: + kwargs["citation_number"] = de.read_integer( + _SCHEMA_SOURCE_ATTRIBUTION.members["citationNumber"] + ) + + case 4: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_SOURCE_ATTRIBUTION.members["updatedAt"] + ) + + case 5: + kwargs["text_message_segments"] = _deserialize_text_segment_list( + de, _SCHEMA_SOURCE_ATTRIBUTION.members["textMessageSegments"] + ) + + case 6: + kwargs["document_id"] = de.read_string( + _SCHEMA_SOURCE_ATTRIBUTION.members["documentId"] + ) + + case 7: + kwargs["index_id"] = de.read_string( + _SCHEMA_SOURCE_ATTRIBUTION.members["indexId"] + ) + + case 8: + kwargs["datasource_id"] = de.read_string( + _SCHEMA_SOURCE_ATTRIBUTION.members["datasourceId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_SOURCE_ATTRIBUTION, consumer=_consumer) + return kwargs + + +def _serialize_source_attributions( + serializer: ShapeSerializer, schema: Schema, value: list[SourceAttribution | None] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + if e is None: + ls.write_null(member_schema) + else: + ls.write_struct(member_schema, e) + + +def _deserialize_source_attributions( + deserializer: ShapeDeserializer, schema: Schema +) -> list[SourceAttribution | None]: + result: list[SourceAttribution | None] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + result.append(None) + else: + result.append(SourceAttribution.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class MetadataEvent: + """ + A metadata event for a AI-generated text output message in a Amazon Q + Business conversation, containing associated metadata generated. + """ + + conversation_id: str | None = None + """ + The identifier of the conversation with which the generated metadata is + associated. + """ + + user_message_id: str | None = None + """ + The identifier of an Amazon Q Business end user text input message + within the conversation. + """ + + system_message_id: str | None = None + """ + The identifier of an Amazon Q Business AI generated message within the + conversation. + """ + + source_attributions: list[SourceAttribution | None] | None = None + """The source documents used to generate the conversation response.""" + + final_text_message: str | None = None + """The final text output message generated by the system.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_METADATA_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_METADATA_EVENT.members["conversationId"], self.conversation_id + ) + + if self.user_message_id is not None: + serializer.write_string( + _SCHEMA_METADATA_EVENT.members["userMessageId"], self.user_message_id + ) + + if self.system_message_id is not None: + serializer.write_string( + _SCHEMA_METADATA_EVENT.members["systemMessageId"], + self.system_message_id, + ) + + if self.source_attributions is not None: + _serialize_source_attributions( + serializer, + _SCHEMA_METADATA_EVENT.members["sourceAttributions"], + self.source_attributions, + ) + + if self.final_text_message is not None: + serializer.write_string( + _SCHEMA_METADATA_EVENT.members["finalTextMessage"], + self.final_text_message, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_METADATA_EVENT.members["conversationId"] + ) + + case 1: + kwargs["user_message_id"] = de.read_string( + _SCHEMA_METADATA_EVENT.members["userMessageId"] + ) + + case 2: + kwargs["system_message_id"] = de.read_string( + _SCHEMA_METADATA_EVENT.members["systemMessageId"] + ) + + case 3: + kwargs["source_attributions"] = _deserialize_source_attributions( + de, _SCHEMA_METADATA_EVENT.members["sourceAttributions"] + ) + + case 4: + kwargs["final_text_message"] = de.read_string( + _SCHEMA_METADATA_EVENT.members["finalTextMessage"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_METADATA_EVENT, consumer=_consumer) + return kwargs + + +class SystemMessageType(StrEnum): + RESPONSE = "RESPONSE" + GROUNDED_RESPONSE = "GROUNDED_RESPONSE" + + +@dataclass(kw_only=True) +class TextOutputEvent: + """ + An output event for an AI-generated response in an Amazon Q Business web + experience. + """ + + system_message_type: str | None = None + """ + The type of AI-generated message in a `TextOutputEvent`. Amazon Q + Business currently supports two types of messages: + + - `RESPONSE` - The Amazon Q Business system response. + + - `GROUNDED_RESPONSE` - The corrected, hallucination-reduced, response + returned by Amazon Q Business. Available only if hallucination + reduction is supported and configured for the application and detected + in the end user chat query by Amazon Q Business. + """ + + conversation_id: str | None = None + """ + The identifier of the conversation with which the text output event is + associated. + """ + + user_message_id: str | None = None + """The identifier of an end user message in a `TextOutputEvent`.""" + + system_message_id: str | None = None + """The identifier of an AI-generated message in a `TextOutputEvent`.""" + + system_message: str | None = None + """An AI-generated message in a `TextOutputEvent`.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_TEXT_OUTPUT_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.system_message_type is not None: + serializer.write_string( + _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessageType"], + self.system_message_type, + ) + + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_TEXT_OUTPUT_EVENT.members["conversationId"], + self.conversation_id, + ) + + if self.user_message_id is not None: + serializer.write_string( + _SCHEMA_TEXT_OUTPUT_EVENT.members["userMessageId"], self.user_message_id + ) + + if self.system_message_id is not None: + serializer.write_string( + _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessageId"], + self.system_message_id, + ) + + if self.system_message is not None: + serializer.write_string( + _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessage"], self.system_message + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["system_message_type"] = de.read_string( + _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessageType"] + ) + + case 1: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_TEXT_OUTPUT_EVENT.members["conversationId"] + ) + + case 2: + kwargs["user_message_id"] = de.read_string( + _SCHEMA_TEXT_OUTPUT_EVENT.members["userMessageId"] + ) + + case 3: + kwargs["system_message_id"] = de.read_string( + _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessageId"] + ) + + case 4: + kwargs["system_message"] = de.read_string( + _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessage"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_TEXT_OUTPUT_EVENT, consumer=_consumer) + return kwargs + + +@dataclass +class ChatOutputStreamTextEvent: + """ + Information about the payload of the `ChatOutputStream` event containing + the AI-generated message output. + """ + + value: TextOutputEvent + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_OUTPUT_STREAM.members["textEvent"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=TextOutputEvent.deserialize(deserializer)) + + +@dataclass +class ChatOutputStreamMetadataEvent: + """ + A metadata event for a AI-generated text output message in a Amazon Q + Business conversation. + """ + + value: MetadataEvent + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_OUTPUT_STREAM.members["metadataEvent"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=MetadataEvent.deserialize(deserializer)) + + +@dataclass +class ChatOutputStreamActionReviewEvent: + """ + A request from Amazon Q Business to the end user for information Amazon + Q Business needs to successfully complete a requested plugin action. + """ + + value: ActionReviewEvent + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_OUTPUT_STREAM.members["actionReviewEvent"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=ActionReviewEvent.deserialize(deserializer)) + + +@dataclass +class ChatOutputStreamFailedAttachmentEvent: + """A failed file upload event during a web experience chat.""" + + value: FailedAttachmentEvent + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_OUTPUT_STREAM.members["failedAttachmentEvent"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=FailedAttachmentEvent.deserialize(deserializer)) + + +@dataclass +class ChatOutputStreamAuthChallengeRequestEvent: + """ + An authentication verification event activated by an end user request to + use a custom plugin. + """ + + value: AuthChallengeRequestEvent + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_OUTPUT_STREAM.members["authChallengeRequestEvent"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=AuthChallengeRequestEvent.deserialize(deserializer)) + + +@dataclass +class ChatOutputStreamUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +ChatOutputStream = Union[ + ChatOutputStreamTextEvent + | ChatOutputStreamMetadataEvent + | ChatOutputStreamActionReviewEvent + | ChatOutputStreamFailedAttachmentEvent + | ChatOutputStreamAuthChallengeRequestEvent + | ChatOutputStreamUnknown +] +"""The streaming output for the `Chat` API.""" + + +class _ChatOutputStreamDeserializer: + _result: ChatOutputStream | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> ChatOutputStream: + self._result = None + deserializer.read_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(ChatOutputStreamTextEvent.deserialize(de)) + + case 1: + self._set_result(ChatOutputStreamMetadataEvent.deserialize(de)) + + case 2: + self._set_result(ChatOutputStreamActionReviewEvent.deserialize(de)) + + case 3: + self._set_result(ChatOutputStreamFailedAttachmentEvent.deserialize(de)) + + case 4: + self._set_result( + ChatOutputStreamAuthChallengeRequestEvent.deserialize(de) + ) + + case _: + self._set_result( + ChatOutputStreamUnknown(tag=schema.expect_member_name()) + ) + + def _set_result(self, value: ChatOutputStream) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +@dataclass(kw_only=True) +class ChatOutput: + """Dataclass for ChatOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CHAT_OUTPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ExternalResourceException(ServiceError): + """ + An external resource that you configured with your application is + returning errors and preventing this operation from succeeding. Fix + those errors and try again. + """ + + fault: Literal["client", "server"] | None = "client" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_EXTERNAL_RESOURCE_EXCEPTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION.members["message"], self.message + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string( + _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION.members["message"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class LicenseNotFoundException(ServiceError): + """ + You don't have permissions to perform the action because your license + is inactive. Ask your admin to activate your license and try again after + your licence is active. + """ + + fault: Literal["client", "server"] | None = "client" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION.members["message"], self.message + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string( + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION.members["message"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, consumer=_consumer + ) + return kwargs + + +class ChatResponseConfigurationStatus(StrEnum): + CREATING = "CREATING" + UPDATING = "UPDATING" + FAILED = "FAILED" + ACTIVE = "ACTIVE" + + +@dataclass(kw_only=True) +class ChatResponseConfiguration: + """ + Configuration details that define how Amazon Q Business generates and + formats responses to user queries in chat interactions. This + configuration allows administrators to customize response + characteristics to meet specific organizational needs and communication + standards. + """ + + chat_response_configuration_id: str + """ + A unique identifier for your chat response configuration settings, used + to reference and manage the configuration within the Amazon Q Business + service. + """ + + chat_response_configuration_arn: str + """ + The Amazon Resource Name (ARN) of the chat response configuration, which + uniquely identifies the resource across all Amazon Web Services services + and accounts. + """ + + display_name: str + """ + A human-readable name for the chat response configuration, making it + easier to identify and manage multiple configurations within an + organization. + """ + + status: str + """ + The current status of the chat response configuration, indicating + whether it is active, pending, or in another state that affects its + availability for use in chat interactions. + """ + + response_configuration_summary: str | None = None + """ + A summary of the response configuration settings, providing a concise + overview of the key parameters that define how responses are generated + and formatted. + """ + + created_at: datetime | None = None + """ + The timestamp indicating when the chat response configuration was + initially created, useful for tracking the lifecycle of configuration + resources. + """ + + updated_at: datetime | None = None + """ + The timestamp indicating when the chat response configuration was last + modified, helping administrators track changes and maintain version + awareness. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_RESPONSE_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["chatResponseConfigurationId"], + self.chat_response_configuration_id, + ) + serializer.write_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["chatResponseConfigurationArn"], + self.chat_response_configuration_arn, + ) + serializer.write_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["displayName"], + self.display_name, + ) + if self.response_configuration_summary is not None: + serializer.write_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members[ + "responseConfigurationSummary" + ], + self.response_configuration_summary, + ) + + serializer.write_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["status"], self.status + ) + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["createdAt"], + self.created_at, + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["updatedAt"], + self.updated_at, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["chat_response_configuration_id"] = de.read_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members[ + "chatResponseConfigurationId" + ] + ) + + case 1: + kwargs["chat_response_configuration_arn"] = de.read_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members[ + "chatResponseConfigurationArn" + ] + ) + + case 2: + kwargs["display_name"] = de.read_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["displayName"] + ) + + case 3: + kwargs["response_configuration_summary"] = de.read_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members[ + "responseConfigurationSummary" + ] + ) + + case 4: + kwargs["status"] = de.read_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["status"] + ) + + case 5: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["createdAt"] + ) + + case 6: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["updatedAt"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class ResponseConfigurationType(StrEnum): + ALL = "ALL" + + +@dataclass(kw_only=True) +class InstructionCollection: + """ + A set of instructions that define how Amazon Q Business should generate + and format responses to user queries. This collection includes + parameters for controlling response characteristics such as length, + audience targeting, perspective, style, identity, tone, and custom + instructions. + """ + + response_length: str | None = None + """ + Specifies the desired length of responses generated by Amazon Q + Business. This parameter allows administrators to control whether + responses are concise and brief or more detailed and comprehensive. + """ + + target_audience: str | None = None + """ + Defines the intended audience for the responses, allowing Amazon Q + Business to tailor its language, terminology, and explanations + appropriately. This could range from technical experts to general users + with varying levels of domain knowledge. + """ + + perspective: str | None = None + """ + Determines the point of view or perspective from which Amazon Q Business + generates responses, such as first-person, second-person, or + third-person perspective, affecting how information is presented to + users. + """ + + output_style: str | None = None + """ + Specifies the formatting and structural style of responses, such as + bullet points, paragraphs, step-by-step instructions, or other + organizational formats that enhance readability and comprehension. + """ + + identity: str | None = None + """ + Defines the persona or identity that Amazon Q Business should adopt when + responding to users, allowing for customization of the assistant's + character, role, or representation within an organization. + """ + + tone: str | None = None + """ + Controls the emotional tone and communication style of responses, such + as formal, casual, technical, friendly, or professional, to align with + organizational communication standards and user expectations. + """ + + custom_instructions: str | None = None + """ + Allows administrators to provide specific, custom instructions that + guide how Amazon Q Business should respond in particular scenarios or to + certain types of queries, enabling fine-grained control over response + generation. + """ + + examples: str | None = None + """ + Provides sample responses or templates that Amazon Q Business can + reference when generating responses, helping to establish consistent + patterns and formats for different types of user queries. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_INSTRUCTION_COLLECTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.response_length is not None: + serializer.write_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["responseLength"], + self.response_length, + ) + + if self.target_audience is not None: + serializer.write_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["targetAudience"], + self.target_audience, + ) + + if self.perspective is not None: + serializer.write_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["perspective"], self.perspective + ) + + if self.output_style is not None: + serializer.write_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["outputStyle"], self.output_style + ) + + if self.identity is not None: + serializer.write_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["identity"], self.identity + ) + + if self.tone is not None: + serializer.write_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["tone"], self.tone + ) + + if self.custom_instructions is not None: + serializer.write_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["customInstructions"], + self.custom_instructions, + ) + + if self.examples is not None: + serializer.write_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["examples"], self.examples + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["response_length"] = de.read_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["responseLength"] + ) + + case 1: + kwargs["target_audience"] = de.read_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["targetAudience"] + ) + + case 2: + kwargs["perspective"] = de.read_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["perspective"] + ) + + case 3: + kwargs["output_style"] = de.read_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["outputStyle"] + ) + + case 4: + kwargs["identity"] = de.read_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["identity"] + ) + + case 5: + kwargs["tone"] = de.read_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["tone"] + ) + + case 6: + kwargs["custom_instructions"] = de.read_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["customInstructions"] + ) + + case 7: + kwargs["examples"] = de.read_string( + _SCHEMA_INSTRUCTION_COLLECTION.members["examples"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_INSTRUCTION_COLLECTION, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ResponseConfiguration: + """ + Configuration settings to define how Amazon Q Business generates and + formats responses to user queries. This includes customization options + for response style, tone, length, and other characteristics. + """ + + instruction_collection: InstructionCollection | None = None + """ + A collection of instructions that guide how Amazon Q Business generates + responses, including parameters for response length, target audience, + perspective, output style, identity, tone, and custom instructions. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RESPONSE_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.instruction_collection is not None: + serializer.write_struct( + _SCHEMA_RESPONSE_CONFIGURATION.members["instructionCollection"], + self.instruction_collection, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["instruction_collection"] = ( + InstructionCollection.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_RESPONSE_CONFIGURATION, consumer=_consumer) + return kwargs + + +def _serialize_response_configurations( + serializer: ShapeSerializer, schema: Schema, value: dict[str, ResponseConfiguration] +) -> None: + with serializer.begin_map(schema, len(value)) as m: + value_schema = schema.members["value"] + for k, v in value.items(): + m.entry(k, lambda vs: vs.write_struct(value_schema, v)) + + +def _deserialize_response_configurations( + deserializer: ShapeDeserializer, schema: Schema +) -> dict[str, ResponseConfiguration]: + result: dict[str, ResponseConfiguration] = {} + value_schema = schema.members["value"] + + def _read_value(k: str, d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result[k] = ResponseConfiguration.deserialize(d) + + deserializer.read_map(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ChatResponseConfigurationDetail: + """ + Detailed information about a chat response configuration, including + comprehensive settings and parameters that define how Amazon Q Business + generates and formats responses. + """ + + response_configurations: dict[str, ResponseConfiguration] | None = None + """ + A collection of specific response configuration settings that + collectively define how responses are generated, formatted, and + presented to users in chat interactions. + """ + + response_configuration_summary: str | None = None + """ + A summary of the response configuration details, providing a concise + overview of the key parameters and settings that define the response + generation behavior. + """ + + status: str | None = None + """ + The current status of the chat response configuration, indicating + whether it is active, pending, or in another state that affects its + availability for use. + """ + + error: ErrorDetail | None = None + """Provides information about a Amazon Q Business request error.""" + + updated_at: datetime | None = None + """ + The timestamp indicating when the detailed chat response configuration + was last modified, helping administrators track changes and maintain + version awareness. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.response_configurations is not None: + _serialize_response_configurations( + serializer, + _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members[ + "responseConfigurations" + ], + self.response_configurations, + ) + + if self.response_configuration_summary is not None: + serializer.write_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members[ + "responseConfigurationSummary" + ], + self.response_configuration_summary, + ) + + if self.status is not None: + serializer.write_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members["status"], + self.status, + ) + + if self.error is not None: + serializer.write_struct( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members["error"], self.error + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members["updatedAt"], + self.updated_at, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["response_configurations"] = ( + _deserialize_response_configurations( + de, + _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members[ + "responseConfigurations" + ], + ) + ) + + case 1: + kwargs["response_configuration_summary"] = de.read_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members[ + "responseConfigurationSummary" + ] + ) + + case 2: + kwargs["status"] = de.read_string( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members["status"] + ) + + case 3: + kwargs["error"] = ErrorDetail.deserialize(de) + + case 4: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members["updatedAt"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL, consumer=_consumer + ) + return kwargs + + +def _serialize_chat_response_configurations( + serializer: ShapeSerializer, schema: Schema, value: list[ChatResponseConfiguration] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_chat_response_configurations( + deserializer: ShapeDeserializer, schema: Schema +) -> list[ChatResponseConfiguration]: + result: list[ChatResponseConfiguration] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(ChatResponseConfiguration.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ChatSyncOutput: + """Dataclass for ChatSyncOutput structure.""" + + conversation_id: str | None = None + """The identifier of the Amazon Q Business conversation.""" + + system_message: str | None = None + """An AI-generated message in a conversation.""" + + system_message_id: str | None = None + """ + The identifier of an Amazon Q Business AI generated message within the + conversation. + """ + + user_message_id: str | None = None + """ + The identifier of an Amazon Q Business end user text input message + within the conversation. + """ + + action_review: ActionReview | None = None + """ + A request from Amazon Q Business to the end user for information Amazon + Q Business needs to successfully complete a requested plugin action. + """ + + auth_challenge_request: AuthChallengeRequest | None = None + """ + An authentication verification event activated by an end user request to + use a custom plugin. + """ + + source_attributions: list[SourceAttribution | None] | None = None + """The source documents used to generate the conversation response.""" + + failed_attachments: list[AttachmentOutput] | None = None + """A list of files which failed to upload during chat.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_SYNC_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_CHAT_SYNC_OUTPUT.members["conversationId"], self.conversation_id + ) + + if self.system_message is not None: + serializer.write_string( + _SCHEMA_CHAT_SYNC_OUTPUT.members["systemMessage"], self.system_message + ) + + if self.system_message_id is not None: + serializer.write_string( + _SCHEMA_CHAT_SYNC_OUTPUT.members["systemMessageId"], + self.system_message_id, + ) + + if self.user_message_id is not None: + serializer.write_string( + _SCHEMA_CHAT_SYNC_OUTPUT.members["userMessageId"], self.user_message_id + ) + + if self.action_review is not None: + serializer.write_struct( + _SCHEMA_CHAT_SYNC_OUTPUT.members["actionReview"], self.action_review + ) + + if self.auth_challenge_request is not None: + serializer.write_struct( + _SCHEMA_CHAT_SYNC_OUTPUT.members["authChallengeRequest"], + self.auth_challenge_request, + ) + + if self.source_attributions is not None: + _serialize_source_attributions( + serializer, + _SCHEMA_CHAT_SYNC_OUTPUT.members["sourceAttributions"], + self.source_attributions, + ) + + if self.failed_attachments is not None: + _serialize_attachments_output( + serializer, + _SCHEMA_CHAT_SYNC_OUTPUT.members["failedAttachments"], + self.failed_attachments, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_CHAT_SYNC_OUTPUT.members["conversationId"] + ) + + case 1: + kwargs["system_message"] = de.read_string( + _SCHEMA_CHAT_SYNC_OUTPUT.members["systemMessage"] + ) + + case 2: + kwargs["system_message_id"] = de.read_string( + _SCHEMA_CHAT_SYNC_OUTPUT.members["systemMessageId"] + ) + + case 3: + kwargs["user_message_id"] = de.read_string( + _SCHEMA_CHAT_SYNC_OUTPUT.members["userMessageId"] + ) + + case 4: + kwargs["action_review"] = ActionReview.deserialize(de) + + case 5: + kwargs["auth_challenge_request"] = AuthChallengeRequest.deserialize( + de + ) + + case 6: + kwargs["source_attributions"] = _deserialize_source_attributions( + de, _SCHEMA_CHAT_SYNC_OUTPUT.members["sourceAttributions"] + ) + + case 7: + kwargs["failed_attachments"] = _deserialize_attachments_output( + de, _SCHEMA_CHAT_SYNC_OUTPUT.members["failedAttachments"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CHAT_SYNC_OUTPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class CheckDocumentAccessInput: + """Dataclass for CheckDocumentAccessInput structure.""" + + application_id: str | None = None + """ + The unique identifier of the application. This is required to identify + the specific Amazon Q Business application context for the document + access check. + """ + + index_id: str | None = None + """ + The unique identifier of the index. Used to locate the correct index + within the application where the document is stored. + """ + + user_id: str | None = None + """ + The unique identifier of the user. Used to check the access permissions + for this specific user against the document's ACL. + """ + + document_id: str | None = None + """ + The unique identifier of the document. Specifies which document's + access permissions are being checked. + """ + + data_source_id: str | None = None + """ + The unique identifier of the data source. Identifies the specific data + source from which the document originates. Should not be used when a + document is uploaded directly with BatchPutDocument, as no dataSourceId + is available or necessary. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["indexId"], self.index_id + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["userId"], self.user_id + ) + + if self.document_id is not None: + serializer.write_string( + _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["documentId"], + self.document_id, + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["dataSourceId"], + self.data_source_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["indexId"] + ) + + case 2: + kwargs["user_id"] = de.read_string( + _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["userId"] + ) + + case 3: + kwargs["document_id"] = de.read_string( + _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["documentId"] + ) + + case 4: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["dataSourceId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class DocumentAclGroup: + """ + Represents a group in the document's ACL, used to define access + permissions for multiple users collectively. + """ + + name: str | None = None + """ + The name of the group in the document's ACL. This is used to identify + the group when applying access rules. + """ + + type: str | None = None + """ + The type of the group. This indicates the scope of the group's + applicability in access control. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ACL_GROUP, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.name is not None: + serializer.write_string( + _SCHEMA_DOCUMENT_ACL_GROUP.members["name"], self.name + ) + + if self.type is not None: + serializer.write_string( + _SCHEMA_DOCUMENT_ACL_GROUP.members["type"], self.type + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["name"] = de.read_string( + _SCHEMA_DOCUMENT_ACL_GROUP.members["name"] + ) + + case 1: + kwargs["type"] = de.read_string( + _SCHEMA_DOCUMENT_ACL_GROUP.members["type"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_GROUP, consumer=_consumer) + return kwargs + + +def _serialize_document_acl_groups( + serializer: ShapeSerializer, schema: Schema, value: list[DocumentAclGroup] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_document_acl_groups( + deserializer: ShapeDeserializer, schema: Schema +) -> list[DocumentAclGroup]: + result: list[DocumentAclGroup] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(DocumentAclGroup.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class DocumentAclUser: + """ + Represents a user in the document's ACL, used to define access + permissions for individual users. + """ + + id: str | None = None + """ + The unique identifier of the user in the document's ACL. This is used + to identify the user when applying access rules. + """ + + type: str | None = None + """ + The type of the user. This indicates the scope of the user's + applicability in access control. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ACL_USER, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.id is not None: + serializer.write_string(_SCHEMA_DOCUMENT_ACL_USER.members["id"], self.id) + + if self.type is not None: + serializer.write_string( + _SCHEMA_DOCUMENT_ACL_USER.members["type"], self.type + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["id"] = de.read_string( + _SCHEMA_DOCUMENT_ACL_USER.members["id"] + ) + + case 1: + kwargs["type"] = de.read_string( + _SCHEMA_DOCUMENT_ACL_USER.members["type"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_USER, consumer=_consumer) + return kwargs + + +def _serialize_document_acl_users( + serializer: ShapeSerializer, schema: Schema, value: list[DocumentAclUser] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_document_acl_users( + deserializer: ShapeDeserializer, schema: Schema +) -> list[DocumentAclUser]: + result: list[DocumentAclUser] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(DocumentAclUser.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class DocumentAclCondition: + """ + Represents a condition in the document's ACL, specifying access rules + for users and groups. + """ + + member_relation: str | None = None + """ + The logical relation between members in the condition, determining how + multiple user or group conditions are combined. + """ + + users: list[DocumentAclUser] | None = None + """ + An array of user identifiers that this condition applies to. Users + listed here are subject to the access rule defined by this condition. + """ + + groups: list[DocumentAclGroup] | None = None + """ + An array of group identifiers that this condition applies to. Groups + listed here are subject to the access rule defined by this condition. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ACL_CONDITION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.member_relation is not None: + serializer.write_string( + _SCHEMA_DOCUMENT_ACL_CONDITION.members["memberRelation"], + self.member_relation, + ) + + if self.users is not None: + _serialize_document_acl_users( + serializer, _SCHEMA_DOCUMENT_ACL_CONDITION.members["users"], self.users + ) + + if self.groups is not None: + _serialize_document_acl_groups( + serializer, + _SCHEMA_DOCUMENT_ACL_CONDITION.members["groups"], + self.groups, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["member_relation"] = de.read_string( + _SCHEMA_DOCUMENT_ACL_CONDITION.members["memberRelation"] + ) + + case 1: + kwargs["users"] = _deserialize_document_acl_users( + de, _SCHEMA_DOCUMENT_ACL_CONDITION.members["users"] + ) + + case 2: + kwargs["groups"] = _deserialize_document_acl_groups( + de, _SCHEMA_DOCUMENT_ACL_CONDITION.members["groups"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_CONDITION, consumer=_consumer) + return kwargs + + +def _serialize_document_acl_conditions( + serializer: ShapeSerializer, schema: Schema, value: list[DocumentAclCondition] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_document_acl_conditions( + deserializer: ShapeDeserializer, schema: Schema +) -> list[DocumentAclCondition]: + result: list[DocumentAclCondition] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(DocumentAclCondition.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class DocumentAclMembership: + """ + Represents membership rules in the document's ACL, defining how users + or groups are associated with access permissions. + """ + + member_relation: str | None = None + """ + The logical relation between members in the membership rule, determining + how multiple conditions are combined. + """ + + conditions: list[DocumentAclCondition] | None = None + """ + An array of conditions that define the membership rules. Each condition + specifies criteria for users or groups to be included in this + membership. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ACL_MEMBERSHIP, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.member_relation is not None: + serializer.write_string( + _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["memberRelation"], + self.member_relation, + ) + + if self.conditions is not None: + _serialize_document_acl_conditions( + serializer, + _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["conditions"], + self.conditions, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["member_relation"] = de.read_string( + _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["memberRelation"] + ) + + case 1: + kwargs["conditions"] = _deserialize_document_acl_conditions( + de, _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["conditions"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_MEMBERSHIP, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DocumentAcl: + """ + Represents the Access Control List (ACL) for a document, containing both + allowlist and denylist conditions. + """ + + allowlist: DocumentAclMembership | None = None + """ + The allowlist conditions for the document. Users or groups matching + these conditions are granted access to the document. + """ + + deny_list: DocumentAclMembership | None = None + """ + The denylist conditions for the document. Users or groups matching these + conditions are denied access to the document, overriding allowlist + permissions. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_ACL, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.allowlist is not None: + serializer.write_struct( + _SCHEMA_DOCUMENT_ACL.members["allowlist"], self.allowlist + ) + + if self.deny_list is not None: + serializer.write_struct( + _SCHEMA_DOCUMENT_ACL.members["denyList"], self.deny_list + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["allowlist"] = DocumentAclMembership.deserialize(de) + + case 1: + kwargs["deny_list"] = DocumentAclMembership.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DOCUMENT_ACL, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class CheckDocumentAccessOutput: + """Dataclass for CheckDocumentAccessOutput structure.""" + + user_groups: list[AssociatedGroup] | None = None + """ + An array of groups the user is part of for the specified data source. + Each group has a name and type. + """ + + user_aliases: list[AssociatedUser] | None = None + """ + An array of aliases associated with the user. This includes both global + and local aliases, each with a name and type. + """ + + has_access: bool | None = None + """ + A boolean value indicating whether the specified user has access to the + document, either direct access or transitive access via groups and + aliases attached to the document. + """ + + document_acl: DocumentAcl | None = None + """ + The Access Control List (ACL) associated with the document. Includes + allowlist and denylist conditions that determine user access. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.user_groups is not None: + _serialize_associated_groups( + serializer, + _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["userGroups"], + self.user_groups, + ) + + if self.user_aliases is not None: + _serialize_associated_users( + serializer, + _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["userAliases"], + self.user_aliases, + ) + + if self.has_access is not None: + serializer.write_boolean( + _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["hasAccess"], + self.has_access, + ) + + if self.document_acl is not None: + serializer.write_struct( + _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["documentAcl"], + self.document_acl, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["user_groups"] = _deserialize_associated_groups( + de, _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["userGroups"] + ) + + case 1: + kwargs["user_aliases"] = _deserialize_associated_users( + de, _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["userAliases"] + ) + + case 2: + kwargs["has_access"] = de.read_boolean( + _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["hasAccess"] + ) + + case 3: + kwargs["document_acl"] = DocumentAcl.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT, consumer=_consumer + ) + return kwargs + + +CHECK_DOCUMENT_ACCESS = APIOperation( + input=CheckDocumentAccessInput, + output=CheckDocumentAccessOutput, + schema=_SCHEMA_CHECK_DOCUMENT_ACCESS, + input_schema=_SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT, + output_schema=_SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ContentBlockerRule: + """ + A rule for configuring how Amazon Q Business responds when it encounters + a a blocked topic. You can configure a custom message to inform your end + users that they have asked about a restricted topic and suggest any next + steps they should take. + """ + + system_message_override: str | None = None + """ + The configured custom message displayed to an end user informing them + that they've used a blocked phrase during chat. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CONTENT_BLOCKER_RULE, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.system_message_override is not None: + serializer.write_string( + _SCHEMA_CONTENT_BLOCKER_RULE.members["systemMessageOverride"], + self.system_message_override, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["system_message_override"] = de.read_string( + _SCHEMA_CONTENT_BLOCKER_RULE.members["systemMessageOverride"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CONTENT_BLOCKER_RULE, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class EligibleDataSource: + """ + The identifier of the data source Amazon Q Business will generate + responses from. + """ + + index_id: str | None = None + """The identifier of the index the data source is attached to.""" + + data_source_id: str | None = None + """The identifier of the data source.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ELIGIBLE_DATA_SOURCE, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.index_id is not None: + serializer.write_string( + _SCHEMA_ELIGIBLE_DATA_SOURCE.members["indexId"], self.index_id + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_ELIGIBLE_DATA_SOURCE.members["dataSourceId"], + self.data_source_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["index_id"] = de.read_string( + _SCHEMA_ELIGIBLE_DATA_SOURCE.members["indexId"] + ) + + case 1: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_ELIGIBLE_DATA_SOURCE.members["dataSourceId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ELIGIBLE_DATA_SOURCE, consumer=_consumer) + return kwargs + + +def _serialize_eligible_data_sources( + serializer: ShapeSerializer, schema: Schema, value: list[EligibleDataSource] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_eligible_data_sources( + deserializer: ShapeDeserializer, schema: Schema +) -> list[EligibleDataSource]: + result: list[EligibleDataSource] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(EligibleDataSource.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ContentRetrievalRule: + """ + Rules for retrieving content from data sources connected to a Amazon Q + Business application for a specific topic control configuration. + """ + + eligible_data_sources: list[EligibleDataSource] | None = None + """ + Specifies data sources in a Amazon Q Business application to use for + content generation. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CONTENT_RETRIEVAL_RULE, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.eligible_data_sources is not None: + _serialize_eligible_data_sources( + serializer, + _SCHEMA_CONTENT_RETRIEVAL_RULE.members["eligibleDataSources"], + self.eligible_data_sources, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["eligible_data_sources"] = ( + _deserialize_eligible_data_sources( + de, + _SCHEMA_CONTENT_RETRIEVAL_RULE.members[ + "eligibleDataSources" + ], + ) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CONTENT_RETRIEVAL_RULE, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class RetrieverContentSource: + """Specifies a retriever as the content source for a search.""" + + retriever_id: str + """The unique identifier of the retriever to use as the content source.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RETRIEVER_CONTENT_SOURCE, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_RETRIEVER_CONTENT_SOURCE.members["retrieverId"], self.retriever_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["retriever_id"] = de.read_string( + _SCHEMA_RETRIEVER_CONTENT_SOURCE.members["retrieverId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_RETRIEVER_CONTENT_SOURCE, consumer=_consumer) + return kwargs + + +@dataclass +class ContentSourceRetriever: + """The retriever to use as the content source.""" + + value: RetrieverContentSource + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CONTENT_SOURCE, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CONTENT_SOURCE.members["retriever"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=RetrieverContentSource.deserialize(deserializer)) + + +@dataclass +class ContentSourceUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +ContentSource = Union[ContentSourceRetriever | ContentSourceUnknown] +"""Specifies the source of content to search in.""" + + +class _ContentSourceDeserializer: + _result: ContentSource | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> ContentSource: + self._result = None + deserializer.read_struct(_SCHEMA_CONTENT_SOURCE, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(ContentSourceRetriever.deserialize(de)) + + case _: + self._set_result(ContentSourceUnknown(tag=schema.expect_member_name())) + + def _set_result(self, value: ContentSource) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +@dataclass(kw_only=True) +class Conversation: + """A conversation in an Amazon Q Business application.""" + + conversation_id: str | None = None + """The identifier of the Amazon Q Business conversation.""" + + title: str | None = None + """The title of the conversation.""" + + start_time: datetime | None = None + """The start time of the conversation.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CONVERSATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_CONVERSATION.members["conversationId"], self.conversation_id + ) + + if self.title is not None: + serializer.write_string(_SCHEMA_CONVERSATION.members["title"], self.title) + + if self.start_time is not None: + serializer.write_timestamp( + _SCHEMA_CONVERSATION.members["startTime"], self.start_time + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_CONVERSATION.members["conversationId"] + ) + + case 1: + kwargs["title"] = de.read_string( + _SCHEMA_CONVERSATION.members["title"] + ) + + case 2: + kwargs["start_time"] = de.read_timestamp( + _SCHEMA_CONVERSATION.members["startTime"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CONVERSATION, consumer=_consumer) + return kwargs + + +def _serialize_conversations( + serializer: ShapeSerializer, schema: Schema, value: list[Conversation] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_conversations( + deserializer: ShapeDeserializer, schema: Schema +) -> list[Conversation]: + result: list[Conversation] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(Conversation.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class CreateAnonymousWebExperienceUrlInput: + """Dataclass for CreateAnonymousWebExperienceUrlInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application environment attached + to the web experience. + """ + + web_experience_id: str | None = None + """The identifier of the web experience.""" + + session_duration_in_minutes: int | None = None + """ + The duration of the session associated with the unique URL for the web + experience. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ + "applicationId" + ], + self.application_id, + ) + + if self.web_experience_id is not None: + serializer.write_string( + _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ + "webExperienceId" + ], + self.web_experience_id, + ) + + if self.session_duration_in_minutes is not None: + serializer.write_integer( + _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ + "sessionDurationInMinutes" + ], + self.session_duration_in_minutes, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ + "applicationId" + ] + ) + + case 1: + kwargs["web_experience_id"] = de.read_string( + _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ + "webExperienceId" + ] + ) + + case 2: + kwargs["session_duration_in_minutes"] = de.read_integer( + _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ + "sessionDurationInMinutes" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class CreateAnonymousWebExperienceUrlOutput: + """Dataclass for CreateAnonymousWebExperienceUrlOutput structure.""" + + anonymous_url: str | None = None + """ + The unique URL for accessing the web experience. + + Warning: + This URL can only be used once and must be used within 5 minutes after + it's generated. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT, self + ) + + def serialize_members(self, serializer: ShapeSerializer): + if self.anonymous_url is not None: + serializer.write_string( + _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT.members[ + "anonymousUrl" + ], + self.anonymous_url, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["anonymous_url"] = de.read_string( + _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT.members[ + "anonymousUrl" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT, consumer=_consumer + ) + return kwargs + + +CREATE_ANONYMOUS_WEB_EXPERIENCE_URL = APIOperation( + input=CreateAnonymousWebExperienceUrlInput, + output=CreateAnonymousWebExperienceUrlOutput, + schema=_SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL, + input_schema=_SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT, + output_schema=_SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class CreateChatResponseConfigurationInput: + """Dataclass for CreateChatResponseConfigurationInput structure.""" + + application_id: str | None = None + """ + The unique identifier of the Amazon Q Business application for which to + create the new chat response configuration. + """ + + display_name: str | None = None + """ + A human-readable name for the new chat response configuration, making it + easier to identify and manage among multiple configurations. + """ + + client_token: str | None = None + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. This helps prevent the same configuration from being created + multiple times if retries occur. + """ + + response_configurations: dict[str, ResponseConfiguration] | None = None + """ + A collection of response configuration settings that define how Amazon Q + Business will generate and format responses to user queries in chat + interactions. + """ + + tags: list[Tag] | None = None + """ + A list of key-value pairs to apply as tags to the new chat response + configuration, enabling categorization and management of resources + across Amazon Web Services services. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "applicationId" + ], + self.application_id, + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members["displayName"], + self.display_name, + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members["clientToken"], + self.client_token, + ) + + if self.response_configurations is not None: + _serialize_response_configurations( + serializer, + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "responseConfigurations" + ], + self.response_configurations, + ) + + if self.tags is not None: + _serialize_tags( + serializer, + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members["tags"], + self.tags, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "applicationId" + ] + ) + + case 1: + kwargs["display_name"] = de.read_string( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "displayName" + ] + ) + + case 2: + kwargs["client_token"] = de.read_string( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "clientToken" + ] + ) + + case 3: + kwargs["response_configurations"] = ( + _deserialize_response_configurations( + de, + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "responseConfigurations" + ], + ) + ) + + case 4: + kwargs["tags"] = _deserialize_tags( + de, + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "tags" + ], + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class CreateChatResponseConfigurationOutput: + """Dataclass for CreateChatResponseConfigurationOutput structure.""" + + chat_response_configuration_id: str + """ + The unique identifier assigned to a newly created chat response + configuration, used for subsequent operations on this resource. + """ + + chat_response_configuration_arn: str + """ + The Amazon Resource Name (ARN) of the newly created chat response + configuration, which uniquely identifies the resource across all Amazon + Web Services services. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "chatResponseConfigurationId" + ], + self.chat_response_configuration_id, + ) + serializer.write_string( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "chatResponseConfigurationArn" + ], + self.chat_response_configuration_arn, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["chat_response_configuration_id"] = de.read_string( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "chatResponseConfigurationId" + ] + ) + + case 1: + kwargs["chat_response_configuration_arn"] = de.read_string( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "chatResponseConfigurationArn" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, consumer=_consumer + ) + return kwargs + + +CREATE_CHAT_RESPONSE_CONFIGURATION = APIOperation( + input=CreateChatResponseConfigurationInput, + output=CreateChatResponseConfigurationOutput, + schema=_SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION, + input_schema=_SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT, + output_schema=_SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass +class SubscriptionPrincipalUser: + """ + The identifier of a user in the IAM Identity Center instance connected + to the Amazon Q Business application. + """ + + value: str + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SUBSCRIPTION_PRINCIPAL, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_SUBSCRIPTION_PRINCIPAL.members["user"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls( + value=deserializer.read_string( + _SCHEMA_SUBSCRIPTION_PRINCIPAL.members["user"] + ) + ) + + +@dataclass +class SubscriptionPrincipalGroup: + """ + The identifier of a group in the IAM Identity Center instance connected + to the Amazon Q Business application. + """ + + value: str + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SUBSCRIPTION_PRINCIPAL, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_SUBSCRIPTION_PRINCIPAL.members["group"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls( + value=deserializer.read_string( + _SCHEMA_SUBSCRIPTION_PRINCIPAL.members["group"] + ) + ) + + +@dataclass +class SubscriptionPrincipalUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +SubscriptionPrincipal = Union[ + SubscriptionPrincipalUser + | SubscriptionPrincipalGroup + | SubscriptionPrincipalUnknown +] +""" +A user or group in the IAM Identity Center instance connected to the +Amazon Q Business application. +""" + + +class _SubscriptionPrincipalDeserializer: + _result: SubscriptionPrincipal | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> SubscriptionPrincipal: + self._result = None + deserializer.read_struct(_SCHEMA_SUBSCRIPTION_PRINCIPAL, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(SubscriptionPrincipalUser.deserialize(de)) + + case 1: + self._set_result(SubscriptionPrincipalGroup.deserialize(de)) + + case _: + self._set_result( + SubscriptionPrincipalUnknown(tag=schema.expect_member_name()) + ) + + def _set_result(self, value: SubscriptionPrincipal) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +@dataclass(kw_only=True) +class CreateSubscriptionInput: + """Dataclass for CreateSubscriptionInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application the subscription + should be added to. + """ + + principal: SubscriptionPrincipal | None = None + """ + The IAM Identity Center `UserId` or `GroupId` of a user or group in the + IAM Identity Center instance connected to the Amazon Q Business + application. + """ + + type: str | None = None + """The type of Amazon Q Business subscription you want to create.""" + + client_token: str | None = None + """ + A token that you provide to identify the request to create a + subscription for your Amazon Q Business application. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_SUBSCRIPTION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["applicationId"], + self.application_id, + ) + + if self.principal is not None: + serializer.write_struct( + _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["principal"], self.principal + ) + + if self.type is not None: + serializer.write_string( + _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["type"], self.type + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["clientToken"], + self.client_token, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["applicationId"] + ) + + case 1: + kwargs["principal"] = ( + _SubscriptionPrincipalDeserializer().deserialize(de) + ) + + case 2: + kwargs["type"] = de.read_string( + _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["type"] + ) + + case 3: + kwargs["client_token"] = de.read_string( + _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["clientToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_SUBSCRIPTION_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class CreateSubscriptionOutput: + """Dataclass for CreateSubscriptionOutput structure.""" + + subscription_id: str | None = None + """The identifier of the Amazon Q Business subscription created.""" + + subscription_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the Amazon Q Business subscription + created. + """ + + current_subscription: SubscriptionDetails | None = None + """The type of your current Amazon Q Business subscription.""" + + next_subscription: SubscriptionDetails | None = None + """The type of the Amazon Q Business subscription for the next month.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.subscription_id is not None: + serializer.write_string( + _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["subscriptionId"], + self.subscription_id, + ) + + if self.subscription_arn is not None: + serializer.write_string( + _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["subscriptionArn"], + self.subscription_arn, + ) + + if self.current_subscription is not None: + serializer.write_struct( + _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["currentSubscription"], + self.current_subscription, + ) + + if self.next_subscription is not None: + serializer.write_struct( + _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["nextSubscription"], + self.next_subscription, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["subscription_id"] = de.read_string( + _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["subscriptionId"] + ) + + case 1: + kwargs["subscription_arn"] = de.read_string( + _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["subscriptionArn"] + ) + + case 2: + kwargs["current_subscription"] = SubscriptionDetails.deserialize(de) + + case 3: + kwargs["next_subscription"] = SubscriptionDetails.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, consumer=_consumer) + return kwargs + + +CREATE_SUBSCRIPTION = APIOperation( + input=CreateSubscriptionInput, + output=CreateSubscriptionOutput, + schema=_SCHEMA_CREATE_SUBSCRIPTION, + input_schema=_SCHEMA_CREATE_SUBSCRIPTION_INPUT, + output_schema=_SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class UserAlias: + """Aliases attached to a user id within an Amazon Q Business application.""" + + user_id: str + """The identifier of the user id associated with the user aliases.""" + + index_id: str | None = None + """The identifier of the index that the user aliases are associated with.""" + + data_source_id: str | None = None + """ + The identifier of the data source that the user aliases are associated + with. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_USER_ALIAS, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.index_id is not None: + serializer.write_string( + _SCHEMA_USER_ALIAS.members["indexId"], self.index_id + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_USER_ALIAS.members["dataSourceId"], self.data_source_id + ) + + serializer.write_string(_SCHEMA_USER_ALIAS.members["userId"], self.user_id) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["index_id"] = de.read_string( + _SCHEMA_USER_ALIAS.members["indexId"] + ) + + case 1: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_USER_ALIAS.members["dataSourceId"] + ) + + case 2: + kwargs["user_id"] = de.read_string( + _SCHEMA_USER_ALIAS.members["userId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_USER_ALIAS, consumer=_consumer) + return kwargs + + +def _serialize_user_aliases( + serializer: ShapeSerializer, schema: Schema, value: list[UserAlias] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_user_aliases( + deserializer: ShapeDeserializer, schema: Schema +) -> list[UserAlias]: + result: list[UserAlias] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(UserAlias.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class CreateUserInput: + """Dataclass for CreateUserInput structure.""" + + application_id: str | None = None + """ + The identifier of the application for which the user mapping will be + created. + """ + + user_id: str | None = None + """The user emails attached to a user mapping.""" + + user_aliases: list[UserAlias] | None = None + """The list of user aliases in the mapping.""" + + client_token: str | None = None + """ + A token that you provide to identify the request to create your Amazon Q + Business user mapping. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_USER_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CREATE_USER_INPUT.members["applicationId"], self.application_id + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_CREATE_USER_INPUT.members["userId"], self.user_id + ) + + if self.user_aliases is not None: + _serialize_user_aliases( + serializer, + _SCHEMA_CREATE_USER_INPUT.members["userAliases"], + self.user_aliases, + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CREATE_USER_INPUT.members["clientToken"], self.client_token + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CREATE_USER_INPUT.members["applicationId"] + ) + + case 1: + kwargs["user_id"] = de.read_string( + _SCHEMA_CREATE_USER_INPUT.members["userId"] + ) + + case 2: + kwargs["user_aliases"] = _deserialize_user_aliases( + de, _SCHEMA_CREATE_USER_INPUT.members["userAliases"] + ) + + case 3: + kwargs["client_token"] = de.read_string( + _SCHEMA_CREATE_USER_INPUT.members["clientToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_USER_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class CreateUserOutput: + """Dataclass for CreateUserOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_USER_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_USER_OUTPUT, consumer=_consumer) + return kwargs + + +CREATE_USER = APIOperation( + input=CreateUserInput, + output=CreateUserOutput, + schema=_SCHEMA_CREATE_USER, + input_schema=_SCHEMA_CREATE_USER_INPUT, + output_schema=_SCHEMA_CREATE_USER_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class CreatorModeConfiguration: + """ + Configuration information required to invoke chat in `CREATOR_MODE`. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) + and [Conversation + settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + + creator_mode_control: str + """ + Status information about whether `CREATOR_MODE` has been enabled or + disabled. The default status is `DISABLED`. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATOR_MODE_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_CREATOR_MODE_CONFIGURATION.members["creatorModeControl"], + self.creator_mode_control, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["creator_mode_control"] = de.read_string( + _SCHEMA_CREATOR_MODE_CONFIGURATION.members["creatorModeControl"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATOR_MODE_CONFIGURATION, consumer=_consumer) + return kwargs + + +def _serialize_data_source_ids( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_data_source_ids( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class DataSourceSyncJobMetrics: + """ + Maps a batch delete document request to a specific Amazon Q Business + data source connector sync job. + """ + + documents_added: str | None = None + """ + The current count of documents added from the data source during the + data source sync. + """ + + documents_modified: str | None = None + """ + The current count of documents modified in the data source during the + data source sync. + """ + + documents_deleted: str | None = None + """ + The current count of documents deleted from the data source during the + data source sync. + """ + + documents_failed: str | None = None + """ + The current count of documents that failed to sync from the data source + during the data source sync. + """ + + documents_scanned: str | None = None + """ + The current count of documents crawled by the ongoing sync job in the + data source. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.documents_added is not None: + serializer.write_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsAdded"], + self.documents_added, + ) + + if self.documents_modified is not None: + serializer.write_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsModified"], + self.documents_modified, + ) + + if self.documents_deleted is not None: + serializer.write_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsDeleted"], + self.documents_deleted, + ) + + if self.documents_failed is not None: + serializer.write_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsFailed"], + self.documents_failed, + ) + + if self.documents_scanned is not None: + serializer.write_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsScanned"], + self.documents_scanned, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["documents_added"] = de.read_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsAdded"] + ) + + case 1: + kwargs["documents_modified"] = de.read_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members[ + "documentsModified" + ] + ) + + case 2: + kwargs["documents_deleted"] = de.read_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsDeleted"] + ) + + case 3: + kwargs["documents_failed"] = de.read_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsFailed"] + ) + + case 4: + kwargs["documents_scanned"] = de.read_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsScanned"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS, consumer=_consumer + ) + return kwargs + + +class DataSourceSyncJobStatus(StrEnum): + FAILED = "FAILED" + SUCCEEDED = "SUCCEEDED" + SYNCING = "SYNCING" + INCOMPLETE = "INCOMPLETE" + STOPPING = "STOPPING" + ABORTED = "ABORTED" + SYNCING_INDEXING = "SYNCING_INDEXING" + + +@dataclass(kw_only=True) +class DataSourceSyncJob: + """ + Provides information about an Amazon Q Business data source connector + synchronization job. + """ + + execution_id: str | None = None + """The identifier of a data source synchronization job.""" + + start_time: datetime | None = None + """The Unix time stamp when the data source synchronization job started.""" + + end_time: datetime | None = None + """The Unix timestamp when the synchronization job completed.""" + + status: str | None = None + """ + The status of the synchronization job. When the `Status` field is set to + `SUCCEEDED`, the synchronization job is done. If the status code is + `FAILED`, the `ErrorCode` and `ErrorMessage` fields give you the reason + for the failure. + """ + + error: ErrorDetail | None = None + """ + If the `Status` field is set to `FAILED`, the `ErrorCode` field + indicates the reason the synchronization failed. + """ + + data_source_error_code: str | None = None + """ + If the reason that the synchronization failed is due to an error with + the underlying data source, this field contains a code that identifies + the error. + """ + + metrics: DataSourceSyncJobMetrics | None = None + """ + Maps a batch delete document request to a specific data source sync job. + This is optional and should only be supplied when documents are deleted + by a data source connector. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DATA_SOURCE_SYNC_JOB, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.execution_id is not None: + serializer.write_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["executionId"], self.execution_id + ) + + if self.start_time is not None: + serializer.write_timestamp( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["startTime"], self.start_time + ) + + if self.end_time is not None: + serializer.write_timestamp( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["endTime"], self.end_time + ) + + if self.status is not None: + serializer.write_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["status"], self.status + ) + + if self.error is not None: + serializer.write_struct( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["error"], self.error + ) + + if self.data_source_error_code is not None: + serializer.write_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["dataSourceErrorCode"], + self.data_source_error_code, + ) + + if self.metrics is not None: + serializer.write_struct( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["metrics"], self.metrics + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["execution_id"] = de.read_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["executionId"] + ) + + case 1: + kwargs["start_time"] = de.read_timestamp( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["startTime"] + ) + + case 2: + kwargs["end_time"] = de.read_timestamp( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["endTime"] + ) + + case 3: + kwargs["status"] = de.read_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["status"] + ) + + case 4: + kwargs["error"] = ErrorDetail.deserialize(de) + + case 5: + kwargs["data_source_error_code"] = de.read_string( + _SCHEMA_DATA_SOURCE_SYNC_JOB.members["dataSourceErrorCode"] + ) + + case 6: + kwargs["metrics"] = DataSourceSyncJobMetrics.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DATA_SOURCE_SYNC_JOB, consumer=_consumer) + return kwargs + + +def _serialize_data_source_sync_jobs( + serializer: ShapeSerializer, schema: Schema, value: list[DataSourceSyncJob] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_data_source_sync_jobs( + deserializer: ShapeDeserializer, schema: Schema +) -> list[DataSourceSyncJob]: + result: list[DataSourceSyncJob] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(DataSourceSyncJob.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class DeleteAttachmentInput: + """Dataclass for DeleteAttachmentInput structure.""" + + application_id: str | None = None + """The unique identifier for the Amazon Q Business application environment.""" + + conversation_id: str | None = None + """The unique identifier of the conversation.""" + + attachment_id: str | None = None + """The unique identifier for the attachment.""" + + user_id: str | None = None + """The unique identifier of the user involved in the conversation.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_ATTACHMENT_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_ATTACHMENT_INPUT.members["applicationId"], + self.application_id, + ) + + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_DELETE_ATTACHMENT_INPUT.members["conversationId"], + self.conversation_id, + ) + + if self.attachment_id is not None: + serializer.write_string( + _SCHEMA_DELETE_ATTACHMENT_INPUT.members["attachmentId"], + self.attachment_id, + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_DELETE_ATTACHMENT_INPUT.members["userId"], self.user_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_ATTACHMENT_INPUT.members["applicationId"] + ) + + case 1: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_DELETE_ATTACHMENT_INPUT.members["conversationId"] + ) + + case 2: + kwargs["attachment_id"] = de.read_string( + _SCHEMA_DELETE_ATTACHMENT_INPUT.members["attachmentId"] + ) + + case 3: + kwargs["user_id"] = de.read_string( + _SCHEMA_DELETE_ATTACHMENT_INPUT.members["userId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_ATTACHMENT_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DeleteAttachmentOutput: + """Dataclass for DeleteAttachmentOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_ATTACHMENT_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_ATTACHMENT_OUTPUT, consumer=_consumer) + return kwargs + + +DELETE_ATTACHMENT = APIOperation( + input=DeleteAttachmentInput, + output=DeleteAttachmentOutput, + schema=_SCHEMA_DELETE_ATTACHMENT, + input_schema=_SCHEMA_DELETE_ATTACHMENT_INPUT, + output_schema=_SCHEMA_DELETE_ATTACHMENT_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#LicenseNotFoundException" + ): LicenseNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DeleteChatControlsConfigurationInput: + """Dataclass for DeleteChatControlsConfigurationInput structure.""" + + application_id: str | None = None + """ + The identifier of the application the chat controls have been configured + for. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "applicationId" + ], + self.application_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "applicationId" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class DeleteChatControlsConfigurationOutput: + """Dataclass for DeleteChatControlsConfigurationOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, consumer=_consumer + ) + return kwargs + + +DELETE_CHAT_CONTROLS_CONFIGURATION = APIOperation( + input=DeleteChatControlsConfigurationInput, + output=DeleteChatControlsConfigurationOutput, + schema=_SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION, + input_schema=_SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT, + output_schema=_SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DeleteChatResponseConfigurationInput: + """Dataclass for DeleteChatResponseConfigurationInput structure.""" + + application_id: str | None = None + """ + The unique identifier of theAmazon Q Business application from which to + delete the chat response configuration. + """ + + chat_response_configuration_id: str | None = None + """ + The unique identifier of the chat response configuration to delete from + the specified application. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "applicationId" + ], + self.application_id, + ) + + if self.chat_response_configuration_id is not None: + serializer.write_string( + _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "chatResponseConfigurationId" + ], + self.chat_response_configuration_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "applicationId" + ] + ) + + case 1: + kwargs["chat_response_configuration_id"] = de.read_string( + _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "chatResponseConfigurationId" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class DeleteChatResponseConfigurationOutput: + """Dataclass for DeleteChatResponseConfigurationOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, consumer=_consumer + ) + return kwargs + + +DELETE_CHAT_RESPONSE_CONFIGURATION = APIOperation( + input=DeleteChatResponseConfigurationInput, + output=DeleteChatResponseConfigurationOutput, + schema=_SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION, + input_schema=_SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT, + output_schema=_SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DeleteConversationInput: + """Dataclass for DeleteConversationInput structure.""" + + conversation_id: str | None = None + """ + The identifier of the Amazon Q Business web experience conversation + being deleted. + """ + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application associated with the + conversation. + """ + + user_id: str | None = None + """The identifier of the user who is deleting the conversation.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_CONVERSATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_DELETE_CONVERSATION_INPUT.members["conversationId"], + self.conversation_id, + ) + + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_CONVERSATION_INPUT.members["applicationId"], + self.application_id, + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_DELETE_CONVERSATION_INPUT.members["userId"], self.user_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_DELETE_CONVERSATION_INPUT.members["conversationId"] + ) + + case 1: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_CONVERSATION_INPUT.members["applicationId"] + ) + + case 2: + kwargs["user_id"] = de.read_string( + _SCHEMA_DELETE_CONVERSATION_INPUT.members["userId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_CONVERSATION_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DeleteConversationOutput: + """Dataclass for DeleteConversationOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_CONVERSATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_CONVERSATION_OUTPUT, consumer=_consumer) + return kwargs + + +DELETE_CONVERSATION = APIOperation( + input=DeleteConversationInput, + output=DeleteConversationOutput, + schema=_SCHEMA_DELETE_CONVERSATION, + input_schema=_SCHEMA_DELETE_CONVERSATION_INPUT, + output_schema=_SCHEMA_DELETE_CONVERSATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#LicenseNotFoundException" + ): LicenseNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DeleteGroupInput: + """Dataclass for DeleteGroupInput structure.""" + + application_id: str | None = None + """The identifier of the application in which the group mapping belongs.""" + + index_id: str | None = None + """The identifier of the index you want to delete the group from.""" + + group_name: str | None = None + """The name of the group you want to delete.""" + + data_source_id: str | None = None + """ + The identifier of the data source linked to the group + + A group can be tied to multiple data sources. You can delete a group + from accessing documents in a certain data source. For example, the + groups \"Research\", \"Engineering\", and \"Sales and Marketing\" are + all tied to the company's documents stored in the data sources + Confluence and Salesforce. You want to delete \"Research\" and + \"Engineering\" groups from Salesforce, so that these groups cannot + access customer-related documents stored in Salesforce. Only \"Sales and + Marketing\" should access documents in the Salesforce data source. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_GROUP_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_GROUP_INPUT.members["applicationId"], self.application_id + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_DELETE_GROUP_INPUT.members["indexId"], self.index_id + ) + + if self.group_name is not None: + serializer.write_string( + _SCHEMA_DELETE_GROUP_INPUT.members["groupName"], self.group_name + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_DELETE_GROUP_INPUT.members["dataSourceId"], self.data_source_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_GROUP_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_DELETE_GROUP_INPUT.members["indexId"] + ) + + case 2: + kwargs["group_name"] = de.read_string( + _SCHEMA_DELETE_GROUP_INPUT.members["groupName"] + ) + + case 3: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_DELETE_GROUP_INPUT.members["dataSourceId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_GROUP_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DeleteGroupOutput: + """Dataclass for DeleteGroupOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_GROUP_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_GROUP_OUTPUT, consumer=_consumer) + return kwargs + + +DELETE_GROUP = APIOperation( + input=DeleteGroupInput, + output=DeleteGroupOutput, + schema=_SCHEMA_DELETE_GROUP, + input_schema=_SCHEMA_DELETE_GROUP_INPUT, + output_schema=_SCHEMA_DELETE_GROUP_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DeleteUserInput: + """Dataclass for DeleteUserInput structure.""" + + application_id: str | None = None + """The identifier of the application from which the user is being deleted.""" + + user_id: str | None = None + """The user email being deleted.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_USER_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DELETE_USER_INPUT.members["applicationId"], self.application_id + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_DELETE_USER_INPUT.members["userId"], self.user_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DELETE_USER_INPUT.members["applicationId"] + ) + + case 1: + kwargs["user_id"] = de.read_string( + _SCHEMA_DELETE_USER_INPUT.members["userId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_USER_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class DeleteUserOutput: + """Dataclass for DeleteUserOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DELETE_USER_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DELETE_USER_OUTPUT, consumer=_consumer) + return kwargs + + +DELETE_USER = APIOperation( + input=DeleteUserInput, + output=DeleteUserOutput, + schema=_SCHEMA_DELETE_USER, + input_schema=_SCHEMA_DELETE_USER_INPUT, + output_schema=_SCHEMA_DELETE_USER_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class DisassociatePermissionInput: + """Dataclass for DisassociatePermissionInput structure.""" + + application_id: str | None = None + """The unique identifier of the Amazon Q Business application.""" + + statement_id: str | None = None + """The statement ID of the permission to remove.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DISASSOCIATE_PERMISSION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_DISASSOCIATE_PERMISSION_INPUT.members["applicationId"], + self.application_id, + ) + + if self.statement_id is not None: + serializer.write_string( + _SCHEMA_DISASSOCIATE_PERMISSION_INPUT.members["statementId"], + self.statement_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_DISASSOCIATE_PERMISSION_INPUT.members["applicationId"] + ) + + case 1: + kwargs["statement_id"] = de.read_string( + _SCHEMA_DISASSOCIATE_PERMISSION_INPUT.members["statementId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DISASSOCIATE_PERMISSION_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class DisassociatePermissionOutput: + """Dataclass for DisassociatePermissionOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DISASSOCIATE_PERMISSION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_DISASSOCIATE_PERMISSION_OUTPUT, consumer=_consumer + ) + return kwargs + + +DISASSOCIATE_PERMISSION = APIOperation( + input=DisassociatePermissionInput, + output=DisassociatePermissionOutput, + schema=_SCHEMA_DISASSOCIATE_PERMISSION, + input_schema=_SCHEMA_DISASSOCIATE_PERMISSION_INPUT, + output_schema=_SCHEMA_DISASSOCIATE_PERMISSION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +class DocumentStatus(StrEnum): + RECEIVED = "RECEIVED" + PROCESSING = "PROCESSING" + INDEXED = "INDEXED" + UPDATED = "UPDATED" + FAILED = "FAILED" + DELETING = "DELETING" + DELETED = "DELETED" + DOCUMENT_FAILED_TO_INDEX = "DOCUMENT_FAILED_TO_INDEX" + + +@dataclass(kw_only=True) +class DocumentDetails: + """The details of a document within an Amazon Q Business index.""" + + document_id: str | None = None + """The identifier of the document.""" + + status: str | None = None + """The current status of the document.""" + + error: ErrorDetail | None = None + """An error message associated with the document.""" + + created_at: datetime | None = None + """The timestamp for when the document was created.""" + + updated_at: datetime | None = None + """The timestamp for when the document was last updated.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_DOCUMENT_DETAILS, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.document_id is not None: + serializer.write_string( + _SCHEMA_DOCUMENT_DETAILS.members["documentId"], self.document_id + ) + + if self.status is not None: + serializer.write_string( + _SCHEMA_DOCUMENT_DETAILS.members["status"], self.status + ) + + if self.error is not None: + serializer.write_struct( + _SCHEMA_DOCUMENT_DETAILS.members["error"], self.error + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_DOCUMENT_DETAILS.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_DOCUMENT_DETAILS.members["updatedAt"], self.updated_at + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["document_id"] = de.read_string( + _SCHEMA_DOCUMENT_DETAILS.members["documentId"] + ) + + case 1: + kwargs["status"] = de.read_string( + _SCHEMA_DOCUMENT_DETAILS.members["status"] + ) + + case 2: + kwargs["error"] = ErrorDetail.deserialize(de) + + case 3: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_DOCUMENT_DETAILS.members["createdAt"] + ) + + case 4: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_DOCUMENT_DETAILS.members["updatedAt"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_DOCUMENT_DETAILS, consumer=_consumer) + return kwargs + + +def _serialize_document_detail_list( + serializer: ShapeSerializer, schema: Schema, value: list[DocumentDetails] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_document_detail_list( + deserializer: ShapeDeserializer, schema: Schema +) -> list[DocumentDetails]: + result: list[DocumentDetails] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(DocumentDetails.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +def _serialize_example_chat_messages( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_example_chat_messages( + deserializer: ShapeDeserializer, schema: Schema +) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class GetChatControlsConfigurationInput: + """Dataclass for GetChatControlsConfigurationInput structure.""" + + application_id: str | None = None + """ + The identifier of the application for which the chat controls are + configured. + """ + + max_results: int | None = None + """The maximum number of configured chat controls to return.""" + + next_token: str | None = None + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business chat controls configured. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members["applicationId"], + self.application_id, + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members["maxResults"], + self.max_results, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members["nextToken"], + self.next_token, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "applicationId" + ] + ) + + case 1: + kwargs["max_results"] = de.read_integer( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "maxResults" + ] + ) + + case 2: + kwargs["next_token"] = de.read_string( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "nextToken" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT, consumer=_consumer + ) + return kwargs + + +class HallucinationReductionControl(StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + + +@dataclass(kw_only=True) +class HallucinationReductionConfiguration: + """ + Configuration information required to setup hallucination reduction. For + more information, see [hallucination + reduction](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/hallucination-reduction.html). + + Note: + The hallucination reduction feature won't work if chat orchestration + controls are enabled for your application. + """ + + hallucination_reduction_control: str | None = None + """ + Controls whether hallucination reduction has been enabled or disabled + for your application. The default status is `DISABLED`. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_HALLUCINATION_REDUCTION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.hallucination_reduction_control is not None: + serializer.write_string( + _SCHEMA_HALLUCINATION_REDUCTION_CONFIGURATION.members[ + "hallucinationReductionControl" + ], + self.hallucination_reduction_control, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["hallucination_reduction_control"] = de.read_string( + _SCHEMA_HALLUCINATION_REDUCTION_CONFIGURATION.members[ + "hallucinationReductionControl" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_HALLUCINATION_REDUCTION_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +class ResponseScope(StrEnum): + ENTERPRISE_CONTENT_ONLY = "ENTERPRISE_CONTENT_ONLY" + EXTENDED_KNOWLEDGE_ENABLED = "EXTENDED_KNOWLEDGE_ENABLED" + + +def _serialize_user_ids( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_user_ids(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class UsersAndGroups: + """ + Provides information about users and group names associated with a topic + control rule. + """ + + user_ids: list[str] | None = None + """The user ids associated with a topic control rule.""" + + user_groups: list[str] | None = None + """The user group names associated with a topic control rule.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_USERS_AND_GROUPS, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.user_ids is not None: + _serialize_user_ids( + serializer, _SCHEMA_USERS_AND_GROUPS.members["userIds"], self.user_ids + ) + + if self.user_groups is not None: + _serialize_user_groups( + serializer, + _SCHEMA_USERS_AND_GROUPS.members["userGroups"], + self.user_groups, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["user_ids"] = _deserialize_user_ids( + de, _SCHEMA_USERS_AND_GROUPS.members["userIds"] + ) + + case 1: + kwargs["user_groups"] = _deserialize_user_groups( + de, _SCHEMA_USERS_AND_GROUPS.members["userGroups"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_USERS_AND_GROUPS, consumer=_consumer) + return kwargs + + +@dataclass +class RuleConfigurationContentBlockerRule: + """ + A rule for configuring how Amazon Q Business responds when it encounters + a a blocked topic. + """ + + value: ContentBlockerRule + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RULE_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_RULE_CONFIGURATION.members["contentBlockerRule"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=ContentBlockerRule.deserialize(deserializer)) + + +@dataclass +class RuleConfigurationContentRetrievalRule: + """ + Rules for retrieving content from data sources connected to a Amazon Q + Business application for a specific topic control configuration. + """ + + value: ContentRetrievalRule + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RULE_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_RULE_CONFIGURATION.members["contentRetrievalRule"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=ContentRetrievalRule.deserialize(deserializer)) + + +@dataclass +class RuleConfigurationUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +RuleConfiguration = Union[ + RuleConfigurationContentBlockerRule + | RuleConfigurationContentRetrievalRule + | RuleConfigurationUnknown +] +"""Provides configuration information about a rule.""" + + +class _RuleConfigurationDeserializer: + _result: RuleConfiguration | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> RuleConfiguration: + self._result = None + deserializer.read_struct(_SCHEMA_RULE_CONFIGURATION, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(RuleConfigurationContentBlockerRule.deserialize(de)) + + case 1: + self._set_result(RuleConfigurationContentRetrievalRule.deserialize(de)) + + case _: + self._set_result( + RuleConfigurationUnknown(tag=schema.expect_member_name()) + ) + + def _set_result(self, value: RuleConfiguration) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +class RuleType(StrEnum): + CONTENT_BLOCKER_RULE = "CONTENT_BLOCKER_RULE" + CONTENT_RETRIEVAL_RULE = "CONTENT_RETRIEVAL_RULE" + + +@dataclass(kw_only=True) +class Rule: + """ + Guardrail rules for an Amazon Q Business application. Amazon Q Business + supports only one rule at a time. + """ + + rule_type: str + """The type of rule.""" + + included_users_and_groups: UsersAndGroups | None = None + """Users and groups to be included in a rule.""" + + excluded_users_and_groups: UsersAndGroups | None = None + """Users and groups to be excluded from a rule.""" + + rule_configuration: RuleConfiguration | None = None + """The configuration information for a rule.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RULE, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.included_users_and_groups is not None: + serializer.write_struct( + _SCHEMA_RULE.members["includedUsersAndGroups"], + self.included_users_and_groups, + ) + + if self.excluded_users_and_groups is not None: + serializer.write_struct( + _SCHEMA_RULE.members["excludedUsersAndGroups"], + self.excluded_users_and_groups, + ) + + serializer.write_string(_SCHEMA_RULE.members["ruleType"], self.rule_type) + if self.rule_configuration is not None: + serializer.write_struct( + _SCHEMA_RULE.members["ruleConfiguration"], self.rule_configuration + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["included_users_and_groups"] = UsersAndGroups.deserialize(de) + + case 1: + kwargs["excluded_users_and_groups"] = UsersAndGroups.deserialize(de) + + case 2: + kwargs["rule_type"] = de.read_string( + _SCHEMA_RULE.members["ruleType"] + ) + + case 3: + kwargs["rule_configuration"] = ( + _RuleConfigurationDeserializer().deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_RULE, consumer=_consumer) + return kwargs + + +def _serialize_rules( + serializer: ShapeSerializer, schema: Schema, value: list[Rule] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_rules(deserializer: ShapeDeserializer, schema: Schema) -> list[Rule]: + result: list[Rule] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(Rule.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class TopicConfiguration: + """ + The topic specific controls configured for an Amazon Q Business + application. + """ + + name: str + """A name for your topic control configuration.""" + + rules: list[Rule] + """Rules defined for a topic configuration.""" + + description: str | None = None + """ + A description for your topic control configuration. Use this to outline + how the large language model (LLM) should use this topic control + configuration. + """ + + example_chat_messages: list[str] | None = None + """ + A list of example phrases that you expect the end user to use in + relation to the topic. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_TOPIC_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string(_SCHEMA_TOPIC_CONFIGURATION.members["name"], self.name) + if self.description is not None: + serializer.write_string( + _SCHEMA_TOPIC_CONFIGURATION.members["description"], self.description + ) + + if self.example_chat_messages is not None: + _serialize_example_chat_messages( + serializer, + _SCHEMA_TOPIC_CONFIGURATION.members["exampleChatMessages"], + self.example_chat_messages, + ) + + _serialize_rules( + serializer, _SCHEMA_TOPIC_CONFIGURATION.members["rules"], self.rules + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["name"] = de.read_string( + _SCHEMA_TOPIC_CONFIGURATION.members["name"] + ) + + case 1: + kwargs["description"] = de.read_string( + _SCHEMA_TOPIC_CONFIGURATION.members["description"] + ) + + case 2: + kwargs["example_chat_messages"] = ( + _deserialize_example_chat_messages( + de, + _SCHEMA_TOPIC_CONFIGURATION.members["exampleChatMessages"], + ) + ) + + case 3: + kwargs["rules"] = _deserialize_rules( + de, _SCHEMA_TOPIC_CONFIGURATION.members["rules"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_TOPIC_CONFIGURATION, consumer=_consumer) + return kwargs + + +def _serialize_topic_configurations( + serializer: ShapeSerializer, schema: Schema, value: list[TopicConfiguration] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_topic_configurations( + deserializer: ShapeDeserializer, schema: Schema +) -> list[TopicConfiguration]: + result: list[TopicConfiguration] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(TopicConfiguration.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class GetChatControlsConfigurationOutput: + """Dataclass for GetChatControlsConfigurationOutput structure.""" + + response_scope: str | None = None + """ + The response scope configured for a Amazon Q Business application. This + determines whether your application uses its retrieval augmented + generation (RAG) system to generate answers only from your enterprise + data, or also uses the large language models (LLM) knowledge to respons + to end user questions in chat. + """ + + orchestration_configuration: AppliedOrchestrationConfiguration | None = None + """ + The chat response orchestration settings for your application. + + Note: + Chat orchestration is optimized to work for English language content. + For more details on language support in Amazon Q Business, see + [Supported + languages](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/supported-languages.html). + """ + + blocked_phrases: BlockedPhrasesConfiguration | None = None + """The phrases blocked from chat by your chat control configuration.""" + + topic_configurations: list[TopicConfiguration] | None = None + """ + The topic specific controls configured for a Amazon Q Business + application. + """ + + creator_mode_configuration: AppliedCreatorModeConfiguration | None = None + """The configuration details for `CREATOR_MODE`.""" + + next_token: str | None = None + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business chat controls configured. + """ + + hallucination_reduction_configuration: ( + HallucinationReductionConfiguration | None + ) = None + """The hallucination reduction settings for your application.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.response_scope is not None: + serializer.write_string( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members["responseScope"], + self.response_scope, + ) + + if self.orchestration_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ + "orchestrationConfiguration" + ], + self.orchestration_configuration, + ) + + if self.blocked_phrases is not None: + serializer.write_struct( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ + "blockedPhrases" + ], + self.blocked_phrases, + ) + + if self.topic_configurations is not None: + _serialize_topic_configurations( + serializer, + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ + "topicConfigurations" + ], + self.topic_configurations, + ) + + if self.creator_mode_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ + "creatorModeConfiguration" + ], + self.creator_mode_configuration, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members["nextToken"], + self.next_token, + ) + + if self.hallucination_reduction_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ + "hallucinationReductionConfiguration" + ], + self.hallucination_reduction_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["response_scope"] = de.read_string( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ + "responseScope" + ] + ) + + case 1: + kwargs["orchestration_configuration"] = ( + AppliedOrchestrationConfiguration.deserialize(de) + ) + + case 2: + kwargs["blocked_phrases"] = BlockedPhrasesConfiguration.deserialize( + de + ) + + case 3: + kwargs["topic_configurations"] = _deserialize_topic_configurations( + de, + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ + "topicConfigurations" + ], + ) + + case 4: + kwargs["creator_mode_configuration"] = ( + AppliedCreatorModeConfiguration.deserialize(de) + ) + + case 5: + kwargs["next_token"] = de.read_string( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ + "nextToken" + ] + ) + + case 6: + kwargs["hallucination_reduction_configuration"] = ( + HallucinationReductionConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT, consumer=_consumer + ) + return kwargs + + +GET_CHAT_CONTROLS_CONFIGURATION = APIOperation( + input=GetChatControlsConfigurationInput, + output=GetChatControlsConfigurationOutput, + schema=_SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION, + input_schema=_SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT, + output_schema=_SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetChatResponseConfigurationInput: + """Dataclass for GetChatResponseConfigurationInput structure.""" + + application_id: str | None = None + """ + The unique identifier of the Amazon Q Business application containing + the chat response configuration to retrieve. + """ + + chat_response_configuration_id: str | None = None + """ + The unique identifier of the chat response configuration to retrieve + from the specified application. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT.members["applicationId"], + self.application_id, + ) + + if self.chat_response_configuration_id is not None: + serializer.write_string( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "chatResponseConfigurationId" + ], + self.chat_response_configuration_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "applicationId" + ] + ) + + case 1: + kwargs["chat_response_configuration_id"] = de.read_string( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "chatResponseConfigurationId" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class GetChatResponseConfigurationOutput: + """Dataclass for GetChatResponseConfigurationOutput structure.""" + + chat_response_configuration_id: str | None = None + """The unique identifier of the retrieved chat response configuration.""" + + chat_response_configuration_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the retrieved chat response + configuration, which uniquely identifies the resource across all Amazon + Web Services services. + """ + + display_name: str | None = None + """ + The human-readable name of the retrieved chat response configuration, + making it easier to identify among multiple configurations. + """ + + created_at: datetime | None = None + """ + The timestamp indicating when the chat response configuration was + initially created. + """ + + in_use_configuration: ChatResponseConfigurationDetail | None = None + """ + The currently active configuration settings that are being used to + generate responses in the Amazon Q Business application. + """ + + last_update_configuration: ChatResponseConfigurationDetail | None = None + """ + Information about the most recent update to the configuration, including + timestamp and modification details. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.chat_response_configuration_id is not None: + serializer.write_string( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "chatResponseConfigurationId" + ], + self.chat_response_configuration_id, + ) + + if self.chat_response_configuration_arn is not None: + serializer.write_string( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "chatResponseConfigurationArn" + ], + self.chat_response_configuration_arn, + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members["displayName"], + self.display_name, + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members["createdAt"], + self.created_at, + ) + + if self.in_use_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "inUseConfiguration" + ], + self.in_use_configuration, + ) + + if self.last_update_configuration is not None: + serializer.write_struct( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "lastUpdateConfiguration" + ], + self.last_update_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["chat_response_configuration_id"] = de.read_string( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "chatResponseConfigurationId" + ] + ) + + case 1: + kwargs["chat_response_configuration_arn"] = de.read_string( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "chatResponseConfigurationArn" + ] + ) + + case 2: + kwargs["display_name"] = de.read_string( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "displayName" + ] + ) + + case 3: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ + "createdAt" + ] + ) + + case 4: + kwargs["in_use_configuration"] = ( + ChatResponseConfigurationDetail.deserialize(de) + ) + + case 5: + kwargs["last_update_configuration"] = ( + ChatResponseConfigurationDetail.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT, consumer=_consumer + ) + return kwargs + + +GET_CHAT_RESPONSE_CONFIGURATION = APIOperation( + input=GetChatResponseConfigurationInput, + output=GetChatResponseConfigurationOutput, + schema=_SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION, + input_schema=_SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT, + output_schema=_SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +class OutputFormat(StrEnum): + RAW = "RAW" + EXTRACTED = "EXTRACTED" + + +@dataclass(kw_only=True) +class GetDocumentContentInput: + """Dataclass for GetDocumentContentInput structure.""" + + application_id: str | None = None + """ + The unique identifier of the Amazon Q Business application containing + the document. This ensures the request is scoped to the correct + application environment and its associated security policies. + """ + + index_id: str | None = None + """The identifier of the index where documents are indexed.""" + + data_source_id: str | None = None + """ + The identifier of the data source from which the document was ingested. + This field is not present if the document is ingested by directly + calling the BatchPutDocument API. If the document is from a file-upload + data source, the datasource will be + \"uploaded-docs-file-stat-datasourceid\". + """ + + document_id: str | None = None + """ + The unique identifier of the document that is indexed via + BatchPutDocument API or file-upload or connector sync. It is also found + in chat or chatSync response. + """ + + output_format: str | None = None + """Document outputFormat. Defaults to RAW if not selected.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_DOCUMENT_CONTENT_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["indexId"], self.index_id + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["dataSourceId"], + self.data_source_id, + ) + + if self.document_id is not None: + serializer.write_string( + _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["documentId"], + self.document_id, + ) + + if self.output_format is not None: + serializer.write_string( + _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["outputFormat"], + self.output_format, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["indexId"] + ) + + case 2: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["dataSourceId"] + ) + + case 3: + kwargs["document_id"] = de.read_string( + _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["documentId"] + ) + + case 4: + kwargs["output_format"] = de.read_string( + _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["outputFormat"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_DOCUMENT_CONTENT_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class GetDocumentContentOutput: + """Dataclass for GetDocumentContentOutput structure.""" + + presigned_url: str + """ + A pre-signed URL that provides temporary access to download the document + content directly from Amazon Q Business. The URL expires after 5 minutes + for security purposes. This URL is generated only after successful ACL + validation. + """ + + mime_type: str + """ + The MIME type of the document content. When outputFormat is RAW, this + corresponds to the original document's MIME type (e.g., + application/pdf, text/plain, + application/vnd.openxmlformats-officedocument.wordprocessingml.document). + When outputFormat is EXTRACTED, the MIME type is always + application/json. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["presignedUrl"], + self.presigned_url, + ) + serializer.write_string( + _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["mimeType"], self.mime_type + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["presigned_url"] = de.read_string( + _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["presignedUrl"] + ) + + case 1: + kwargs["mime_type"] = de.read_string( + _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["mimeType"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, consumer=_consumer + ) + return kwargs + + +GET_DOCUMENT_CONTENT = APIOperation( + input=GetDocumentContentInput, + output=GetDocumentContentOutput, + schema=_SCHEMA_GET_DOCUMENT_CONTENT, + input_schema=_SCHEMA_GET_DOCUMENT_CONTENT_INPUT, + output_schema=_SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetGroupInput: + """Dataclass for GetGroupInput structure.""" + + application_id: str | None = None + """The identifier of the application id the group is attached to.""" + + index_id: str | None = None + """The identifier of the index the group is attached to.""" + + group_name: str | None = None + """The name of the group.""" + + data_source_id: str | None = None + """The identifier of the data source the group is attached to.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_GROUP_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_GROUP_INPUT.members["applicationId"], self.application_id + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_GET_GROUP_INPUT.members["indexId"], self.index_id + ) + + if self.group_name is not None: + serializer.write_string( + _SCHEMA_GET_GROUP_INPUT.members["groupName"], self.group_name + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_GET_GROUP_INPUT.members["dataSourceId"], self.data_source_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_GROUP_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_GET_GROUP_INPUT.members["indexId"] + ) + + case 2: + kwargs["group_name"] = de.read_string( + _SCHEMA_GET_GROUP_INPUT.members["groupName"] + ) + + case 3: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_GET_GROUP_INPUT.members["dataSourceId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_GROUP_INPUT, consumer=_consumer) + return kwargs + + +class GroupStatus(StrEnum): + FAILED = "FAILED" + SUCCEEDED = "SUCCEEDED" + PROCESSING = "PROCESSING" + DELETING = "DELETING" + DELETED = "DELETED" + + +@dataclass(kw_only=True) +class GroupStatusDetail: + """Provides the details of a group's status.""" + + status: str | None = None + """The status of a group.""" + + last_updated_at: datetime | None = None + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + + error_detail: ErrorDetail | None = None + """The details of an error associated a group status.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GROUP_STATUS_DETAIL, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.status is not None: + serializer.write_string( + _SCHEMA_GROUP_STATUS_DETAIL.members["status"], self.status + ) + + if self.last_updated_at is not None: + serializer.write_timestamp( + _SCHEMA_GROUP_STATUS_DETAIL.members["lastUpdatedAt"], + self.last_updated_at, + ) + + if self.error_detail is not None: + serializer.write_struct( + _SCHEMA_GROUP_STATUS_DETAIL.members["errorDetail"], self.error_detail + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["status"] = de.read_string( + _SCHEMA_GROUP_STATUS_DETAIL.members["status"] + ) + + case 1: + kwargs["last_updated_at"] = de.read_timestamp( + _SCHEMA_GROUP_STATUS_DETAIL.members["lastUpdatedAt"] + ) + + case 2: + kwargs["error_detail"] = ErrorDetail.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GROUP_STATUS_DETAIL, consumer=_consumer) + return kwargs + + +def _serialize_group_status_details( + serializer: ShapeSerializer, schema: Schema, value: list[GroupStatusDetail] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_group_status_details( + deserializer: ShapeDeserializer, schema: Schema +) -> list[GroupStatusDetail]: + result: list[GroupStatusDetail] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(GroupStatusDetail.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class GetGroupOutput: + """Dataclass for GetGroupOutput structure.""" + + status: GroupStatusDetail | None = None + """The current status of the group.""" + + status_history: list[GroupStatusDetail] | None = None + """The status history of the group.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_GROUP_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.status is not None: + serializer.write_struct( + _SCHEMA_GET_GROUP_OUTPUT.members["status"], self.status + ) + + if self.status_history is not None: + _serialize_group_status_details( + serializer, + _SCHEMA_GET_GROUP_OUTPUT.members["statusHistory"], + self.status_history, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["status"] = GroupStatusDetail.deserialize(de) + + case 1: + kwargs["status_history"] = _deserialize_group_status_details( + de, _SCHEMA_GET_GROUP_OUTPUT.members["statusHistory"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_GROUP_OUTPUT, consumer=_consumer) + return kwargs + + +GET_GROUP = APIOperation( + input=GetGroupInput, + output=GetGroupOutput, + schema=_SCHEMA_GET_GROUP, + input_schema=_SCHEMA_GET_GROUP_INPUT, + output_schema=_SCHEMA_GET_GROUP_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetMediaInput: + """Dataclass for GetMediaInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business which contains the media object.""" + + conversation_id: str | None = None + """The identifier of the Amazon Q Business conversation.""" + + message_id: str | None = None + """The identifier of the Amazon Q Business message.""" + + media_id: str | None = None + """ + The identifier of the media object. You can find this in the + `sourceAttributions` returned by the `Chat`, `ChatSync`, and + `ListMessages` API responses. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_MEDIA_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_MEDIA_INPUT.members["applicationId"], self.application_id + ) + + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_GET_MEDIA_INPUT.members["conversationId"], self.conversation_id + ) + + if self.message_id is not None: + serializer.write_string( + _SCHEMA_GET_MEDIA_INPUT.members["messageId"], self.message_id + ) + + if self.media_id is not None: + serializer.write_string( + _SCHEMA_GET_MEDIA_INPUT.members["mediaId"], self.media_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_MEDIA_INPUT.members["applicationId"] + ) + + case 1: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_GET_MEDIA_INPUT.members["conversationId"] + ) + + case 2: + kwargs["message_id"] = de.read_string( + _SCHEMA_GET_MEDIA_INPUT.members["messageId"] + ) + + case 3: + kwargs["media_id"] = de.read_string( + _SCHEMA_GET_MEDIA_INPUT.members["mediaId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_MEDIA_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class GetMediaOutput: + """Dataclass for GetMediaOutput structure.""" + + media_bytes: bytes | None = None + """The base64-encoded bytes of the media object.""" + + media_mime_type: str | None = None + """The MIME type of the media object (image/png).""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_MEDIA_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.media_bytes is not None: + serializer.write_blob( + _SCHEMA_GET_MEDIA_OUTPUT.members["mediaBytes"], self.media_bytes + ) + + if self.media_mime_type is not None: + serializer.write_string( + _SCHEMA_GET_MEDIA_OUTPUT.members["mediaMimeType"], self.media_mime_type + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["media_bytes"] = de.read_blob( + _SCHEMA_GET_MEDIA_OUTPUT.members["mediaBytes"] + ) + + case 1: + kwargs["media_mime_type"] = de.read_string( + _SCHEMA_GET_MEDIA_OUTPUT.members["mediaMimeType"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_MEDIA_OUTPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class MediaTooLargeException(ServiceError): + """The requested media object is too large to be returned.""" + + fault: Literal["client", "server"] | None = "client" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_MEDIA_TOO_LARGE_EXCEPTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_MEDIA_TOO_LARGE_EXCEPTION.members["message"], self.message + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string( + _SCHEMA_MEDIA_TOO_LARGE_EXCEPTION.members["message"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_MEDIA_TOO_LARGE_EXCEPTION, consumer=_consumer) + return kwargs + + +GET_MEDIA = APIOperation( + input=GetMediaInput, + output=GetMediaOutput, + schema=_SCHEMA_GET_MEDIA, + input_schema=_SCHEMA_GET_MEDIA_INPUT, + output_schema=_SCHEMA_GET_MEDIA_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#LicenseNotFoundException" + ): LicenseNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#MediaTooLargeException" + ): MediaTooLargeException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, + _SCHEMA_MEDIA_TOO_LARGE_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetPolicyInput: + """Dataclass for GetPolicyInput structure.""" + + application_id: str | None = None + """The unique identifier of the Amazon Q Business application.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_POLICY_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_POLICY_INPUT.members["applicationId"], self.application_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_POLICY_INPUT.members["applicationId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_POLICY_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class GetPolicyOutput: + """Dataclass for GetPolicyOutput structure.""" + + policy: str | None = None + """The JSON representation of the permission policy.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_POLICY_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.policy is not None: + serializer.write_string( + _SCHEMA_GET_POLICY_OUTPUT.members["policy"], self.policy + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["policy"] = de.read_string( + _SCHEMA_GET_POLICY_OUTPUT.members["policy"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_POLICY_OUTPUT, consumer=_consumer) + return kwargs + + +GET_POLICY = APIOperation( + input=GetPolicyInput, + output=GetPolicyOutput, + schema=_SCHEMA_GET_POLICY, + input_schema=_SCHEMA_GET_POLICY_INPUT, + output_schema=_SCHEMA_GET_POLICY_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class GetUserInput: + """Dataclass for GetUserInput structure.""" + + application_id: str | None = None + """The identifier of the application connected to the user.""" + + user_id: str | None = None + """The user email address attached to the user.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_USER_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_USER_INPUT.members["applicationId"], self.application_id + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_GET_USER_INPUT.members["userId"], self.user_id + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_USER_INPUT.members["applicationId"] + ) + + case 1: + kwargs["user_id"] = de.read_string( + _SCHEMA_GET_USER_INPUT.members["userId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_USER_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class GetUserOutput: + """Dataclass for GetUserOutput structure.""" + + user_aliases: list[UserAlias] | None = None + """A list of user aliases attached to a user.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_USER_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.user_aliases is not None: + _serialize_user_aliases( + serializer, + _SCHEMA_GET_USER_OUTPUT.members["userAliases"], + self.user_aliases, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["user_aliases"] = _deserialize_user_aliases( + de, _SCHEMA_GET_USER_OUTPUT.members["userAliases"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_USER_OUTPUT, consumer=_consumer) + return kwargs + + +GET_USER = APIOperation( + input=GetUserInput, + output=GetUserOutput, + schema=_SCHEMA_GET_USER, + input_schema=_SCHEMA_GET_USER_INPUT, + output_schema=_SCHEMA_GET_USER_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListAttachmentsInput: + """Dataclass for ListAttachmentsInput structure.""" + + application_id: str | None = None + """The unique identifier for the Amazon Q Business application.""" + + conversation_id: str | None = None + """ + The unique identifier of the Amazon Q Business web experience + conversation. + """ + + user_id: str | None = None + """ + The unique identifier of the user involved in the Amazon Q Business web + experience conversation. + """ + + next_token: str | None = None + """ + If the number of attachments returned exceeds `maxResults`, Amazon Q + Business returns a next token as a pagination token to retrieve the next + set of attachments. + """ + + max_results: int | None = None + """The maximum number of attachements to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_ATTACHMENTS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_ATTACHMENTS_INPUT.members["applicationId"], + self.application_id, + ) + + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_LIST_ATTACHMENTS_INPUT.members["conversationId"], + self.conversation_id, + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_LIST_ATTACHMENTS_INPUT.members["userId"], self.user_id + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_ATTACHMENTS_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_ATTACHMENTS_INPUT.members["maxResults"], self.max_results + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_ATTACHMENTS_INPUT.members["applicationId"] + ) + + case 1: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_LIST_ATTACHMENTS_INPUT.members["conversationId"] + ) + + case 2: + kwargs["user_id"] = de.read_string( + _SCHEMA_LIST_ATTACHMENTS_INPUT.members["userId"] + ) + + case 3: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_ATTACHMENTS_INPUT.members["nextToken"] + ) + + case 4: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_ATTACHMENTS_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_ATTACHMENTS_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ListAttachmentsOutput: + """Dataclass for ListAttachmentsOutput structure.""" + + attachments: list[Attachment] | None = None + """An array of information on one or more attachments.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of + attachments. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_ATTACHMENTS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.attachments is not None: + _serialize_attachment_list( + serializer, + _SCHEMA_LIST_ATTACHMENTS_OUTPUT.members["attachments"], + self.attachments, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_ATTACHMENTS_OUTPUT.members["nextToken"], self.next_token + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["attachments"] = _deserialize_attachment_list( + de, _SCHEMA_LIST_ATTACHMENTS_OUTPUT.members["attachments"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_ATTACHMENTS_OUTPUT.members["nextToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_ATTACHMENTS_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_ATTACHMENTS = APIOperation( + input=ListAttachmentsInput, + output=ListAttachmentsOutput, + schema=_SCHEMA_LIST_ATTACHMENTS, + input_schema=_SCHEMA_LIST_ATTACHMENTS_INPUT, + output_schema=_SCHEMA_LIST_ATTACHMENTS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#LicenseNotFoundException" + ): LicenseNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListChatResponseConfigurationsInput: + """Dataclass for ListChatResponseConfigurationsInput structure.""" + + application_id: str | None = None + """ + The unique identifier of the Amazon Q Business application for which to + list available chat response configurations. + """ + + max_results: int | None = None + """ + The maximum number of chat response configurations to return in a single + response. This parameter helps control pagination of results when many + configurations exist. + """ + + next_token: str | None = None + """ + A pagination token used to retrieve the next set of results when the + number of configurations exceeds the specified `maxResults` value. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members[ + "applicationId" + ], + self.application_id, + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members["maxResults"], + self.max_results, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members["nextToken"], + self.next_token, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members[ + "applicationId" + ] + ) + + case 1: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members[ + "maxResults" + ] + ) + + case 2: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members[ + "nextToken" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class ListChatResponseConfigurationsOutput: + """Dataclass for ListChatResponseConfigurationsOutput structure.""" + + chat_response_configurations: list[ChatResponseConfiguration] | None = None + """ + A list of chat response configuration summaries, each containing key + information about an available configuration in the specified + application. + """ + + next_token: str | None = None + """ + A pagination token that can be used in a subsequent request to retrieve + additional chat response configurations if the results were truncated + due to the `maxResults` parameter. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.chat_response_configurations is not None: + _serialize_chat_response_configurations( + serializer, + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT.members[ + "chatResponseConfigurations" + ], + self.chat_response_configurations, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT.members["nextToken"], + self.next_token, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["chat_response_configurations"] = ( + _deserialize_chat_response_configurations( + de, + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT.members[ + "chatResponseConfigurations" + ], + ) + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT.members[ + "nextToken" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT, consumer=_consumer + ) + return kwargs + + +LIST_CHAT_RESPONSE_CONFIGURATIONS = APIOperation( + input=ListChatResponseConfigurationsInput, + output=ListChatResponseConfigurationsOutput, + schema=_SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS, + input_schema=_SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT, + output_schema=_SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListConversationsInput: + """Dataclass for ListConversationsInput structure.""" + + application_id: str | None = None + """The identifier of the Amazon Q Business application.""" + + user_id: str | None = None + """ + The identifier of the user involved in the Amazon Q Business web + experience conversation. + """ + + next_token: str | None = None + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business conversations. + """ + + max_results: int | None = None + """The maximum number of Amazon Q Business conversations to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_CONVERSATIONS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_CONVERSATIONS_INPUT.members["applicationId"], + self.application_id, + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_LIST_CONVERSATIONS_INPUT.members["userId"], self.user_id + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_CONVERSATIONS_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_CONVERSATIONS_INPUT.members["maxResults"], self.max_results + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_CONVERSATIONS_INPUT.members["applicationId"] + ) + + case 1: + kwargs["user_id"] = de.read_string( + _SCHEMA_LIST_CONVERSATIONS_INPUT.members["userId"] + ) + + case 2: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_CONVERSATIONS_INPUT.members["nextToken"] + ) + + case 3: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_CONVERSATIONS_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_CONVERSATIONS_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ListConversationsOutput: + """Dataclass for ListConversationsOutput structure.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of messages. + """ + + conversations: list[Conversation] | None = None + """ + An array of summary information on the configuration of one or more + Amazon Q Business web experiences. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_CONVERSATIONS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_CONVERSATIONS_OUTPUT.members["nextToken"], self.next_token + ) + + if self.conversations is not None: + _serialize_conversations( + serializer, + _SCHEMA_LIST_CONVERSATIONS_OUTPUT.members["conversations"], + self.conversations, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_CONVERSATIONS_OUTPUT.members["nextToken"] + ) + + case 1: + kwargs["conversations"] = _deserialize_conversations( + de, _SCHEMA_LIST_CONVERSATIONS_OUTPUT.members["conversations"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_CONVERSATIONS_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_CONVERSATIONS = APIOperation( + input=ListConversationsInput, + output=ListConversationsOutput, + schema=_SCHEMA_LIST_CONVERSATIONS, + input_schema=_SCHEMA_LIST_CONVERSATIONS_INPUT, + output_schema=_SCHEMA_LIST_CONVERSATIONS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#LicenseNotFoundException" + ): LicenseNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListDataSourceSyncJobsInput: + """Dataclass for ListDataSourceSyncJobsInput structure.""" + + data_source_id: str | None = None + """The identifier of the data source connector.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application connected to the + data source. + """ + + index_id: str | None = None + """ + The identifier of the index used with the Amazon Q Business data source + connector. + """ + + next_token: str | None = None + """ + If the `maxResults` response was incpmplete because there is more data + to retriever, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + responses. + """ + + max_results: int | None = None + """The maximum number of synchronization jobs to return in the response.""" + + start_time: datetime | None = None + """The start time of the data source connector sync.""" + + end_time: datetime | None = None + """The end time of the data source connector sync.""" + + status_filter: str | None = None + """ + Only returns synchronization jobs with the `Status` field equal to the + specified status. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["dataSourceId"], + self.data_source_id, + ) + + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["indexId"], + self.index_id, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["nextToken"], + self.next_token, + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["maxResults"], + self.max_results, + ) + + if self.start_time is not None: + serializer.write_timestamp( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["startTime"], + self.start_time, + ) + + if self.end_time is not None: + serializer.write_timestamp( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["endTime"], + self.end_time, + ) + + if self.status_filter is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["statusFilter"], + self.status_filter, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["dataSourceId"] + ) + + case 1: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members[ + "applicationId" + ] + ) + + case 2: + kwargs["index_id"] = de.read_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["indexId"] + ) + + case 3: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["nextToken"] + ) + + case 4: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["maxResults"] + ) + + case 5: + kwargs["start_time"] = de.read_timestamp( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["startTime"] + ) + + case 6: + kwargs["end_time"] = de.read_timestamp( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["endTime"] + ) + + case 7: + kwargs["status_filter"] = de.read_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["statusFilter"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class ListDataSourceSyncJobsOutput: + """Dataclass for ListDataSourceSyncJobsOutput structure.""" + + history: list[DataSourceSyncJob] | None = None + """A history of synchronization jobs for the data source connector.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token. You + can use this token in any subsequent request to retrieve the next set of + jobs. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.history is not None: + _serialize_data_source_sync_jobs( + serializer, + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT.members["history"], + self.history, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT.members["nextToken"], + self.next_token, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["history"] = _deserialize_data_source_sync_jobs( + de, _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT.members["history"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT.members["nextToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT, consumer=_consumer + ) + return kwargs + + +LIST_DATA_SOURCE_SYNC_JOBS = APIOperation( + input=ListDataSourceSyncJobsInput, + output=ListDataSourceSyncJobsOutput, + schema=_SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS, + input_schema=_SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT, + output_schema=_SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListDocumentsInput: + """Dataclass for ListDocumentsInput structure.""" + + application_id: str | None = None + """The identifier of the application id the documents are attached to.""" + + index_id: str | None = None + """The identifier of the index the documents are attached to.""" + + data_source_ids: list[str] | None = None + """The identifier of the data sources the documents are attached to.""" + + next_token: str | None = None + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + documents. + """ + + max_results: int | None = None + """The maximum number of documents to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_DOCUMENTS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_DOCUMENTS_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_LIST_DOCUMENTS_INPUT.members["indexId"], self.index_id + ) + + if self.data_source_ids is not None: + _serialize_data_source_ids( + serializer, + _SCHEMA_LIST_DOCUMENTS_INPUT.members["dataSourceIds"], + self.data_source_ids, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_DOCUMENTS_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_DOCUMENTS_INPUT.members["maxResults"], self.max_results + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_DOCUMENTS_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_LIST_DOCUMENTS_INPUT.members["indexId"] + ) + + case 2: + kwargs["data_source_ids"] = _deserialize_data_source_ids( + de, _SCHEMA_LIST_DOCUMENTS_INPUT.members["dataSourceIds"] + ) + + case 3: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_DOCUMENTS_INPUT.members["nextToken"] + ) + + case 4: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_DOCUMENTS_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_DOCUMENTS_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ListDocumentsOutput: + """Dataclass for ListDocumentsOutput structure.""" + + document_detail_list: list[DocumentDetails] | None = None + """A list of document details.""" + + next_token: str | None = None + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + documents. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_DOCUMENTS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.document_detail_list is not None: + _serialize_document_detail_list( + serializer, + _SCHEMA_LIST_DOCUMENTS_OUTPUT.members["documentDetailList"], + self.document_detail_list, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_DOCUMENTS_OUTPUT.members["nextToken"], self.next_token + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["document_detail_list"] = _deserialize_document_detail_list( + de, _SCHEMA_LIST_DOCUMENTS_OUTPUT.members["documentDetailList"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_DOCUMENTS_OUTPUT.members["nextToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_DOCUMENTS_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_DOCUMENTS = APIOperation( + input=ListDocumentsInput, + output=ListDocumentsOutput, + schema=_SCHEMA_LIST_DOCUMENTS, + input_schema=_SCHEMA_LIST_DOCUMENTS_INPUT, + output_schema=_SCHEMA_LIST_DOCUMENTS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListGroupsInput: + """Dataclass for ListGroupsInput structure.""" + + application_id: str | None = None + """ + The identifier of the application for getting a list of groups mapped to + users. + """ + + index_id: str | None = None + """ + The identifier of the index for getting a list of groups mapped to + users. + """ + + updated_earlier_than: datetime | None = None + """ + The timestamp identifier used for the latest `PUT` or `DELETE` action + for mapping users to their groups. + """ + + data_source_id: str | None = None + """ + The identifier of the data source for getting a list of groups mapped to + users. + """ + + next_token: str | None = None + """ + If the previous response was incomplete (because there is more data to + retrieve), Amazon Q Business returns a pagination token in the response. + You can use this pagination token to retrieve the next set of groups + that are mapped to users. + """ + + max_results: int | None = None + """The maximum number of returned groups that are mapped to users.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_GROUPS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_GROUPS_INPUT.members["applicationId"], self.application_id + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_LIST_GROUPS_INPUT.members["indexId"], self.index_id + ) + + if self.updated_earlier_than is not None: + serializer.write_timestamp( + _SCHEMA_LIST_GROUPS_INPUT.members["updatedEarlierThan"], + self.updated_earlier_than, + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_LIST_GROUPS_INPUT.members["dataSourceId"], self.data_source_id + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_GROUPS_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_GROUPS_INPUT.members["maxResults"], self.max_results + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_GROUPS_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_LIST_GROUPS_INPUT.members["indexId"] + ) + + case 2: + kwargs["updated_earlier_than"] = de.read_timestamp( + _SCHEMA_LIST_GROUPS_INPUT.members["updatedEarlierThan"] + ) + + case 3: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_LIST_GROUPS_INPUT.members["dataSourceId"] + ) + + case 4: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_GROUPS_INPUT.members["nextToken"] + ) + + case 5: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_GROUPS_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_GROUPS_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class GroupSummary: + """Summary information for groups.""" + + group_name: str | None = None + """The name of the group the summary information is for.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GROUP_SUMMARY, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.group_name is not None: + serializer.write_string( + _SCHEMA_GROUP_SUMMARY.members["groupName"], self.group_name + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["group_name"] = de.read_string( + _SCHEMA_GROUP_SUMMARY.members["groupName"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GROUP_SUMMARY, consumer=_consumer) + return kwargs + + +def _serialize_group_summary_list( + serializer: ShapeSerializer, schema: Schema, value: list[GroupSummary] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_group_summary_list( + deserializer: ShapeDeserializer, schema: Schema +) -> list[GroupSummary]: + result: list[GroupSummary] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(GroupSummary.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ListGroupsOutput: + """Dataclass for ListGroupsOutput structure.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token that + you can use in the subsequent request to retrieve the next set of groups + that are mapped to users. + """ + + items: list[GroupSummary] | None = None + """Summary information for list of groups that are mapped to users.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_GROUPS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_GROUPS_OUTPUT.members["nextToken"], self.next_token + ) + + if self.items is not None: + _serialize_group_summary_list( + serializer, _SCHEMA_LIST_GROUPS_OUTPUT.members["items"], self.items + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_GROUPS_OUTPUT.members["nextToken"] + ) + + case 1: + kwargs["items"] = _deserialize_group_summary_list( + de, _SCHEMA_LIST_GROUPS_OUTPUT.members["items"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_GROUPS_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_GROUPS = APIOperation( + input=ListGroupsInput, + output=ListGroupsOutput, + schema=_SCHEMA_LIST_GROUPS, + input_schema=_SCHEMA_LIST_GROUPS_INPUT, + output_schema=_SCHEMA_LIST_GROUPS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListMessagesInput: + """Dataclass for ListMessagesInput structure.""" + + conversation_id: str | None = None + """The identifier of the Amazon Q Business web experience conversation.""" + + application_id: str | None = None + """The identifier for the Amazon Q Business application.""" + + user_id: str | None = None + """ + The identifier of the user involved in the Amazon Q Business web + experience conversation. + """ + + next_token: str | None = None + """ + If the number of messages returned exceeds `maxResults`, Amazon Q + Business returns a next token as a pagination token to retrieve the next + set of messages. + """ + + max_results: int | None = None + """The maximum number of messages to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_MESSAGES_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_LIST_MESSAGES_INPUT.members["conversationId"], + self.conversation_id, + ) + + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_MESSAGES_INPUT.members["applicationId"], + self.application_id, + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_LIST_MESSAGES_INPUT.members["userId"], self.user_id + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_MESSAGES_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_MESSAGES_INPUT.members["maxResults"], self.max_results + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_LIST_MESSAGES_INPUT.members["conversationId"] + ) + + case 1: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_MESSAGES_INPUT.members["applicationId"] + ) + + case 2: + kwargs["user_id"] = de.read_string( + _SCHEMA_LIST_MESSAGES_INPUT.members["userId"] + ) + + case 3: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_MESSAGES_INPUT.members["nextToken"] + ) + + case 4: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_MESSAGES_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_MESSAGES_INPUT, consumer=_consumer) + return kwargs + + +class MessageType(StrEnum): + USER = "USER" + SYSTEM = "SYSTEM" + + +@dataclass(kw_only=True) +class Message: + """A message in an Amazon Q Business web experience.""" + + message_id: str | None = None + """The identifier of the Amazon Q Business web experience message.""" + + body: str | None = None + """The content of the Amazon Q Business web experience message.""" + + time: datetime | None = None + """The timestamp of the first Amazon Q Business web experience message.""" + + type: str | None = None + """ + The type of Amazon Q Business message, whether `HUMAN` or `AI` + generated. + """ + + attachments: list[AttachmentOutput] | None = None + """A file directly uploaded into an Amazon Q Business web experience chat.""" + + source_attribution: list[SourceAttribution | None] | None = None + """ + The source documents used to generate Amazon Q Business web experience + message. + """ + + action_review: ActionReview | None = None + """ + An output event that Amazon Q Business returns to an user who wants to + perform a plugin action during a non-streaming chat conversation. It + contains information about the selected action with a list of possible + user input fields, some pre-populated by Amazon Q Business. + """ + + action_execution: ActionExecution | None = None + """ + Performs an Amazon Q Business plugin action during a non-streaming chat + conversation. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_MESSAGE, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.message_id is not None: + serializer.write_string( + _SCHEMA_MESSAGE.members["messageId"], self.message_id + ) + + if self.body is not None: + serializer.write_string(_SCHEMA_MESSAGE.members["body"], self.body) + + if self.time is not None: + serializer.write_timestamp(_SCHEMA_MESSAGE.members["time"], self.time) + + if self.type is not None: + serializer.write_string(_SCHEMA_MESSAGE.members["type"], self.type) + + if self.attachments is not None: + _serialize_attachments_output( + serializer, _SCHEMA_MESSAGE.members["attachments"], self.attachments + ) + + if self.source_attribution is not None: + _serialize_source_attributions( + serializer, + _SCHEMA_MESSAGE.members["sourceAttribution"], + self.source_attribution, + ) + + if self.action_review is not None: + serializer.write_struct( + _SCHEMA_MESSAGE.members["actionReview"], self.action_review + ) + + if self.action_execution is not None: + serializer.write_struct( + _SCHEMA_MESSAGE.members["actionExecution"], self.action_execution + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message_id"] = de.read_string( + _SCHEMA_MESSAGE.members["messageId"] + ) + + case 1: + kwargs["body"] = de.read_string(_SCHEMA_MESSAGE.members["body"]) + + case 2: + kwargs["time"] = de.read_timestamp(_SCHEMA_MESSAGE.members["time"]) + + case 3: + kwargs["type"] = de.read_string(_SCHEMA_MESSAGE.members["type"]) + + case 4: + kwargs["attachments"] = _deserialize_attachments_output( + de, _SCHEMA_MESSAGE.members["attachments"] + ) + + case 5: + kwargs["source_attribution"] = _deserialize_source_attributions( + de, _SCHEMA_MESSAGE.members["sourceAttribution"] + ) + + case 6: + kwargs["action_review"] = ActionReview.deserialize(de) + + case 7: + kwargs["action_execution"] = ActionExecution.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_MESSAGE, consumer=_consumer) + return kwargs + + +def _serialize_messages( + serializer: ShapeSerializer, schema: Schema, value: list[Message] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_messages( + deserializer: ShapeDeserializer, schema: Schema +) -> list[Message]: + result: list[Message] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(Message.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ListMessagesOutput: + """Dataclass for ListMessagesOutput structure.""" + + messages: list[Message] | None = None + """An array of information on one or more messages.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of messages. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_MESSAGES_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.messages is not None: + _serialize_messages( + serializer, + _SCHEMA_LIST_MESSAGES_OUTPUT.members["messages"], + self.messages, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_MESSAGES_OUTPUT.members["nextToken"], self.next_token + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["messages"] = _deserialize_messages( + de, _SCHEMA_LIST_MESSAGES_OUTPUT.members["messages"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_MESSAGES_OUTPUT.members["nextToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_MESSAGES_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_MESSAGES = APIOperation( + input=ListMessagesInput, + output=ListMessagesOutput, + schema=_SCHEMA_LIST_MESSAGES, + input_schema=_SCHEMA_LIST_MESSAGES_INPUT, + output_schema=_SCHEMA_LIST_MESSAGES_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#LicenseNotFoundException" + ): LicenseNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListPluginActionsInput: + """Dataclass for ListPluginActionsInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application the plugin is + attached to. + """ + + plugin_id: str | None = None + """The identifier of the Amazon Q Business plugin.""" + + next_token: str | None = None + """ + If the number of plugin actions returned exceeds `maxResults`, Amazon Q + Business returns a next token as a pagination token to retrieve the next + set of plugin actions. + """ + + max_results: int | None = None + """The maximum number of plugin actions to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_PLUGIN_ACTIONS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["applicationId"], + self.application_id, + ) + + if self.plugin_id is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["pluginId"], self.plugin_id + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["maxResults"], + self.max_results, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["applicationId"] + ) + + case 1: + kwargs["plugin_id"] = de.read_string( + _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["pluginId"] + ) + + case 2: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["nextToken"] + ) + + case 3: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_PLUGIN_ACTIONS_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ListPluginActionsOutput: + """Dataclass for ListPluginActionsOutput structure.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of plugin + actions. + """ + + items: list[ActionSummary] | None = None + """An array of information on one or more plugin actions.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT.members["nextToken"], self.next_token + ) + + if self.items is not None: + _serialize_actions( + serializer, + _SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT.members["items"], + self.items, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT.members["nextToken"] + ) + + case 1: + kwargs["items"] = _deserialize_actions( + de, _SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT.members["items"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_PLUGIN_ACTIONS = APIOperation( + input=ListPluginActionsInput, + output=ListPluginActionsOutput, + schema=_SCHEMA_LIST_PLUGIN_ACTIONS, + input_schema=_SCHEMA_LIST_PLUGIN_ACTIONS_INPUT, + output_schema=_SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListPluginTypeActionsInput: + """Dataclass for ListPluginTypeActionsInput structure.""" + + plugin_type: str | None = None + """The type of the plugin.""" + + next_token: str | None = None + """ + If the number of plugins returned exceeds `maxResults`, Amazon Q + Business returns a next token as a pagination token to retrieve the next + set of plugins. + """ + + max_results: int | None = None + """The maximum number of plugins to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.plugin_type is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["pluginType"], + self.plugin_type, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["nextToken"], + self.next_token, + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["maxResults"], + self.max_results, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["plugin_type"] = de.read_string( + _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["pluginType"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["nextToken"] + ) + + case 2: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class ListPluginTypeActionsOutput: + """Dataclass for ListPluginTypeActionsOutput structure.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of plugins. + """ + + items: list[ActionSummary] | None = None + """An array of information on one or more plugins.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT.members["nextToken"], + self.next_token, + ) + + if self.items is not None: + _serialize_actions( + serializer, + _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT.members["items"], + self.items, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT.members["nextToken"] + ) + + case 1: + kwargs["items"] = _deserialize_actions( + de, _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT.members["items"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT, consumer=_consumer + ) + return kwargs + + +LIST_PLUGIN_TYPE_ACTIONS = APIOperation( + input=ListPluginTypeActionsInput, + output=ListPluginTypeActionsOutput, + schema=_SCHEMA_LIST_PLUGIN_TYPE_ACTIONS, + input_schema=_SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT, + output_schema=_SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListPluginTypeMetadataInput: + """Dataclass for ListPluginTypeMetadataInput structure.""" + + next_token: str | None = None + """ + If the metadata returned exceeds `maxResults`, Amazon Q Business returns + a next token as a pagination token to retrieve the next set of metadata. + """ + + max_results: int | None = None + """The maximum number of plugin metadata items to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT.members["nextToken"], + self.next_token, + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT.members["maxResults"], + self.max_results, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT.members["nextToken"] + ) + + case 1: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT, consumer=_consumer + ) + return kwargs + + +class PluginTypeCategory(StrEnum): + CRM = "Customer relationship management (CRM)" + PROJECT_MANAGEMENT = "Project management" + COMMUNICATION = "Communication" + PRODUCTIVITY = "Productivity" + TICKETING_MANAGEMENT = "Ticketing and incident management" + + +@dataclass(kw_only=True) +class PluginTypeMetadataSummary: + """Summary metadata information for a Amazon Q Business plugin.""" + + type: str | None = None + """The type of the plugin.""" + + category: str | None = None + """The category of the plugin type.""" + + description: str | None = None + """ + The description assigned by Amazon Q Business to a plugin. You can't + modify this value. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.type is not None: + serializer.write_string( + _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["type"], self.type + ) + + if self.category is not None: + serializer.write_string( + _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["category"], self.category + ) + + if self.description is not None: + serializer.write_string( + _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["description"], + self.description, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["type"] = de.read_string( + _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["type"] + ) + + case 1: + kwargs["category"] = de.read_string( + _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["category"] + ) + + case 2: + kwargs["description"] = de.read_string( + _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["description"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY, consumer=_consumer + ) + return kwargs + + +def _serialize_list_plugin_type_metadata_summaries( + serializer: ShapeSerializer, schema: Schema, value: list[PluginTypeMetadataSummary] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_list_plugin_type_metadata_summaries( + deserializer: ShapeDeserializer, schema: Schema +) -> list[PluginTypeMetadataSummary]: + result: list[PluginTypeMetadataSummary] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(PluginTypeMetadataSummary.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ListPluginTypeMetadataOutput: + """Dataclass for ListPluginTypeMetadataOutput structure.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of plugin + metadata. + """ + + items: list[PluginTypeMetadataSummary] | None = None + """An array of information on plugin metadata.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT.members["nextToken"], + self.next_token, + ) + + if self.items is not None: + _serialize_list_plugin_type_metadata_summaries( + serializer, + _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT.members["items"], + self.items, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT.members["nextToken"] + ) + + case 1: + kwargs["items"] = _deserialize_list_plugin_type_metadata_summaries( + de, _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT.members["items"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT, consumer=_consumer + ) + return kwargs + + +LIST_PLUGIN_TYPE_METADATA = APIOperation( + input=ListPluginTypeMetadataInput, + output=ListPluginTypeMetadataOutput, + schema=_SCHEMA_LIST_PLUGIN_TYPE_METADATA, + input_schema=_SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT, + output_schema=_SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListSubscriptionsInput: + """Dataclass for ListSubscriptionsInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application linked to the + subscription. + """ + + next_token: str | None = None + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business subscriptions. + """ + + max_results: int | None = None + """The maximum number of Amazon Q Business subscriptions to return.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["applicationId"], + self.application_id, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["nextToken"], self.next_token + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["maxResults"], self.max_results + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["applicationId"] + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["nextToken"] + ) + + case 2: + kwargs["max_results"] = de.read_integer( + _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["maxResults"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class Subscription: + """ + Information about an Amazon Q Business subscription. + + Subscriptions are used to provide access for an IAM Identity Center user + or a group to an Amazon Q Business application. + + Amazon Q Business offers two subscription tiers: `Q_LITE` and + `Q_BUSINESS`. Subscription tier determines feature access for the user. + For more information on subscriptions and pricing tiers, see [Amazon Q + Business pricing](https://aws.amazon.com/q/business/pricing/). + """ + + subscription_id: str | None = None + """The identifier of the Amazon Q Business subscription to be updated.""" + + subscription_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the Amazon Q Business subscription + that was updated. + """ + + principal: SubscriptionPrincipal | None = None + """ + The IAM Identity Center `UserId` or `GroupId` of a user or group in the + IAM Identity Center instance connected to the Amazon Q Business + application. + """ + + current_subscription: SubscriptionDetails | None = None + """The type of your current Amazon Q Business subscription.""" + + next_subscription: SubscriptionDetails | None = None + """The type of the Amazon Q Business subscription for the next month.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SUBSCRIPTION, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.subscription_id is not None: + serializer.write_string( + _SCHEMA_SUBSCRIPTION.members["subscriptionId"], self.subscription_id + ) + + if self.subscription_arn is not None: + serializer.write_string( + _SCHEMA_SUBSCRIPTION.members["subscriptionArn"], self.subscription_arn + ) + + if self.principal is not None: + serializer.write_struct( + _SCHEMA_SUBSCRIPTION.members["principal"], self.principal + ) + + if self.current_subscription is not None: + serializer.write_struct( + _SCHEMA_SUBSCRIPTION.members["currentSubscription"], + self.current_subscription, + ) + + if self.next_subscription is not None: + serializer.write_struct( + _SCHEMA_SUBSCRIPTION.members["nextSubscription"], self.next_subscription + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["subscription_id"] = de.read_string( + _SCHEMA_SUBSCRIPTION.members["subscriptionId"] + ) + + case 1: + kwargs["subscription_arn"] = de.read_string( + _SCHEMA_SUBSCRIPTION.members["subscriptionArn"] + ) + + case 2: + kwargs["principal"] = ( + _SubscriptionPrincipalDeserializer().deserialize(de) + ) + + case 3: + kwargs["current_subscription"] = SubscriptionDetails.deserialize(de) + + case 4: + kwargs["next_subscription"] = SubscriptionDetails.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_SUBSCRIPTION, consumer=_consumer) + return kwargs + + +def _serialize_subscriptions( + serializer: ShapeSerializer, schema: Schema, value: list[Subscription] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_subscriptions( + deserializer: ShapeDeserializer, schema: Schema +) -> list[Subscription]: + result: list[Subscription] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(Subscription.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ListSubscriptionsOutput: + """Dataclass for ListSubscriptionsOutput structure.""" + + next_token: str | None = None + """ + If the response is truncated, Amazon Q Business returns this token. You + can use this token in a subsequent request to retrieve the next set of + subscriptions. + """ + + subscriptions: list[Subscription] | None = None + """ + An array of summary information on the subscriptions configured for an + Amazon Q Business application. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.next_token is not None: + serializer.write_string( + _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["nextToken"], self.next_token + ) + + if self.subscriptions is not None: + _serialize_subscriptions( + serializer, + _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["subscriptions"], + self.subscriptions, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["next_token"] = de.read_string( + _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["nextToken"] + ) + + case 1: + kwargs["subscriptions"] = _deserialize_subscriptions( + de, _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["subscriptions"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, consumer=_consumer) + return kwargs + + +LIST_SUBSCRIPTIONS = APIOperation( + input=ListSubscriptionsInput, + output=ListSubscriptionsOutput, + schema=_SCHEMA_LIST_SUBSCRIPTIONS, + input_schema=_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, + output_schema=_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ListTagsForResourceInput: + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the Amazon Q Business application or + data source to get a list of tags for. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.resource_arn is not None: + serializer.write_string( + _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceARN"], + self.resource_arn, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["resource_arn"] = de.read_string( + _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceARN"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class ListTagsForResourceOutput: + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: list[Tag] | None = None + """ + A list of tags associated with the Amazon Q Business application or data + source. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.tags is not None: + _serialize_tags( + serializer, + _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"], + self.tags, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["tags"] = _deserialize_tags( + de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer + ) + return kwargs + + +LIST_TAGS_FOR_RESOURCE = APIOperation( + input=ListTagsForResourceInput, + output=ListTagsForResourceOutput, + schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, + output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +class MessageUsefulnessReason(StrEnum): + NOT_FACTUALLY_CORRECT = "NOT_FACTUALLY_CORRECT" + HARMFUL_OR_UNSAFE = "HARMFUL_OR_UNSAFE" + INCORRECT_OR_MISSING_SOURCES = "INCORRECT_OR_MISSING_SOURCES" + NOT_HELPFUL = "NOT_HELPFUL" + FACTUALLY_CORRECT = "FACTUALLY_CORRECT" + COMPLETE = "COMPLETE" + RELEVANT_SOURCES = "RELEVANT_SOURCES" + HELPFUL = "HELPFUL" + NOT_BASED_ON_DOCUMENTS = "NOT_BASED_ON_DOCUMENTS" + NOT_COMPLETE = "NOT_COMPLETE" + NOT_CONCISE = "NOT_CONCISE" + OTHER = "OTHER" + + +class MessageUsefulness(StrEnum): + USEFUL = "USEFUL" + NOT_USEFUL = "NOT_USEFUL" + + +@dataclass(kw_only=True) +class MessageUsefulnessFeedback: + """ + End user feedback on an AI-generated web experience chat message + usefulness. + """ + + usefulness: str + """The usefulness value assigned by an end user to a message.""" + + submitted_at: datetime + """The timestamp for when the feedback was submitted.""" + + reason: str | None = None + """The reason for a usefulness rating.""" + + comment: str | None = None + """ + A comment given by an end user on the usefulness of an AI-generated chat + message. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_MESSAGE_USEFULNESS_FEEDBACK, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["usefulness"], self.usefulness + ) + if self.reason is not None: + serializer.write_string( + _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["reason"], self.reason + ) + + if self.comment is not None: + serializer.write_string( + _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["comment"], self.comment + ) + + serializer.write_timestamp( + _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["submittedAt"], + self.submitted_at, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["usefulness"] = de.read_string( + _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["usefulness"] + ) + + case 1: + kwargs["reason"] = de.read_string( + _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["reason"] + ) + + case 2: + kwargs["comment"] = de.read_string( + _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["comment"] + ) + + case 3: + kwargs["submitted_at"] = de.read_timestamp( + _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["submittedAt"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class PutFeedbackInput: + """Dataclass for PutFeedbackInput structure.""" + + application_id: str | None = None + """The identifier of the application associated with the feedback.""" + + user_id: str | None = None + """The identifier of the user giving the feedback.""" + + conversation_id: str | None = None + """The identifier of the conversation the feedback is attached to.""" + + message_id: str | None = None + """The identifier of the chat message that the feedback was given for.""" + + message_copied_at: datetime | None = None + """The timestamp for when the feedback was recorded.""" + + message_usefulness: MessageUsefulnessFeedback | None = None + """The feedback usefulness value given by the user to the chat message.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PUT_FEEDBACK_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_PUT_FEEDBACK_INPUT.members["applicationId"], self.application_id + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_PUT_FEEDBACK_INPUT.members["userId"], self.user_id + ) + + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_PUT_FEEDBACK_INPUT.members["conversationId"], + self.conversation_id, + ) + + if self.message_id is not None: + serializer.write_string( + _SCHEMA_PUT_FEEDBACK_INPUT.members["messageId"], self.message_id + ) + + if self.message_copied_at is not None: + serializer.write_timestamp( + _SCHEMA_PUT_FEEDBACK_INPUT.members["messageCopiedAt"], + self.message_copied_at, + ) + + if self.message_usefulness is not None: + serializer.write_struct( + _SCHEMA_PUT_FEEDBACK_INPUT.members["messageUsefulness"], + self.message_usefulness, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_PUT_FEEDBACK_INPUT.members["applicationId"] + ) + + case 1: + kwargs["user_id"] = de.read_string( + _SCHEMA_PUT_FEEDBACK_INPUT.members["userId"] + ) + + case 2: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_PUT_FEEDBACK_INPUT.members["conversationId"] + ) + + case 3: + kwargs["message_id"] = de.read_string( + _SCHEMA_PUT_FEEDBACK_INPUT.members["messageId"] + ) + + case 4: + kwargs["message_copied_at"] = de.read_timestamp( + _SCHEMA_PUT_FEEDBACK_INPUT.members["messageCopiedAt"] + ) + + case 5: + kwargs["message_usefulness"] = ( + MessageUsefulnessFeedback.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_PUT_FEEDBACK_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class PutFeedbackOutput: + """Dataclass for PutFeedbackOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PUT_FEEDBACK_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_PUT_FEEDBACK_OUTPUT, consumer=_consumer) + return kwargs + + +PUT_FEEDBACK = APIOperation( + input=PutFeedbackInput, + output=PutFeedbackOutput, + schema=_SCHEMA_PUT_FEEDBACK, + input_schema=_SCHEMA_PUT_FEEDBACK_INPUT, + output_schema=_SCHEMA_PUT_FEEDBACK_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class MemberGroup: + """The sub groups that belong to a group.""" + + group_name: str + """The name of the sub group.""" + + type: str | None = None + """The type of the sub group.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_MEMBER_GROUP, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_MEMBER_GROUP.members["groupName"], self.group_name + ) + if self.type is not None: + serializer.write_string(_SCHEMA_MEMBER_GROUP.members["type"], self.type) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["group_name"] = de.read_string( + _SCHEMA_MEMBER_GROUP.members["groupName"] + ) + + case 1: + kwargs["type"] = de.read_string( + _SCHEMA_MEMBER_GROUP.members["type"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_MEMBER_GROUP, consumer=_consumer) + return kwargs + + +def _serialize_member_groups( + serializer: ShapeSerializer, schema: Schema, value: list[MemberGroup] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_member_groups( + deserializer: ShapeDeserializer, schema: Schema +) -> list[MemberGroup]: + result: list[MemberGroup] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(MemberGroup.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class MemberUser: + """The users that belong to a group.""" + + user_id: str + """The identifier of the user you want to map to a group.""" + + type: str | None = None + """The type of the user.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_MEMBER_USER, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string(_SCHEMA_MEMBER_USER.members["userId"], self.user_id) + if self.type is not None: + serializer.write_string(_SCHEMA_MEMBER_USER.members["type"], self.type) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["user_id"] = de.read_string( + _SCHEMA_MEMBER_USER.members["userId"] + ) + + case 1: + kwargs["type"] = de.read_string(_SCHEMA_MEMBER_USER.members["type"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_MEMBER_USER, consumer=_consumer) + return kwargs + + +def _serialize_member_users( + serializer: ShapeSerializer, schema: Schema, value: list[MemberUser] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_member_users( + deserializer: ShapeDeserializer, schema: Schema +) -> list[MemberUser]: + result: list[MemberUser] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(MemberUser.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class GroupMembers: + """ + A list of users or sub groups that belong to a group. This is for + generating Amazon Q Business chat results only from document a user has + access to. + """ + + member_groups: list[MemberGroup] | None = None + """ + A list of sub groups that belong to a group. For example, the sub groups + \"Research\", \"Engineering\", and \"Sales and Marketing\" all belong to + the group \"Company\". + """ + + member_users: list[MemberUser] | None = None + """ + A list of users that belong to a group. For example, a list of interns + all belong to the \"Interns\" group. + """ + + s3_path_for_group_members: S3 | None = None + """ + Information required for Amazon Q Business to find a specific file in an + Amazon S3 bucket. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GROUP_MEMBERS, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.member_groups is not None: + _serialize_member_groups( + serializer, + _SCHEMA_GROUP_MEMBERS.members["memberGroups"], + self.member_groups, + ) + + if self.member_users is not None: + _serialize_member_users( + serializer, + _SCHEMA_GROUP_MEMBERS.members["memberUsers"], + self.member_users, + ) + + if self.s3_path_for_group_members is not None: + serializer.write_struct( + _SCHEMA_GROUP_MEMBERS.members["s3PathForGroupMembers"], + self.s3_path_for_group_members, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["member_groups"] = _deserialize_member_groups( + de, _SCHEMA_GROUP_MEMBERS.members["memberGroups"] + ) + + case 1: + kwargs["member_users"] = _deserialize_member_users( + de, _SCHEMA_GROUP_MEMBERS.members["memberUsers"] + ) + + case 2: + kwargs["s3_path_for_group_members"] = S3.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GROUP_MEMBERS, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class PutGroupInput: + """Dataclass for PutGroupInput structure.""" + + application_id: str | None = None + """ + The identifier of the application in which the user and group mapping + belongs. + """ + + index_id: str | None = None + """ + The identifier of the index in which you want to map users to their + groups. + """ + + group_name: str | None = None + """ + The list that contains your users or sub groups that belong the same + group. For example, the group \"Company\" includes the user \"CEO\" and + the sub groups \"Research\", \"Engineering\", and \"Sales and + Marketing\". + """ + + data_source_id: str | None = None + """ + The identifier of the data source for which you want to map users to + their groups. This is useful if a group is tied to multiple data + sources, but you only want the group to access documents of a certain + data source. For example, the groups \"Research\", \"Engineering\", and + \"Sales and Marketing\" are all tied to the company's documents stored + in the data sources Confluence and Salesforce. However, \"Sales and + Marketing\" team only needs access to customer-related documents stored + in Salesforce. + """ + + type: str | None = None + """The type of the group.""" + + group_members: GroupMembers | None = None + """ + A list of users or sub groups that belong to a group. This is for + generating Amazon Q Business chat results only from document a user has + access to. + """ + + role_arn: str | None = None + """ + The Amazon Resource Name (ARN) of an IAM role that has access to the S3 + file that contains your list of users that belong to a group. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PUT_GROUP_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_PUT_GROUP_INPUT.members["applicationId"], self.application_id + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_PUT_GROUP_INPUT.members["indexId"], self.index_id + ) + + if self.group_name is not None: + serializer.write_string( + _SCHEMA_PUT_GROUP_INPUT.members["groupName"], self.group_name + ) + + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_PUT_GROUP_INPUT.members["dataSourceId"], self.data_source_id + ) + + if self.type is not None: + serializer.write_string(_SCHEMA_PUT_GROUP_INPUT.members["type"], self.type) + + if self.group_members is not None: + serializer.write_struct( + _SCHEMA_PUT_GROUP_INPUT.members["groupMembers"], self.group_members + ) + + if self.role_arn is not None: + serializer.write_string( + _SCHEMA_PUT_GROUP_INPUT.members["roleArn"], self.role_arn + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_PUT_GROUP_INPUT.members["applicationId"] + ) + + case 1: + kwargs["index_id"] = de.read_string( + _SCHEMA_PUT_GROUP_INPUT.members["indexId"] + ) + + case 2: + kwargs["group_name"] = de.read_string( + _SCHEMA_PUT_GROUP_INPUT.members["groupName"] + ) + + case 3: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_PUT_GROUP_INPUT.members["dataSourceId"] + ) + + case 4: + kwargs["type"] = de.read_string( + _SCHEMA_PUT_GROUP_INPUT.members["type"] + ) + + case 5: + kwargs["group_members"] = GroupMembers.deserialize(de) + + case 6: + kwargs["role_arn"] = de.read_string( + _SCHEMA_PUT_GROUP_INPUT.members["roleArn"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_PUT_GROUP_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class PutGroupOutput: + """Dataclass for PutGroupOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_PUT_GROUP_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_PUT_GROUP_OUTPUT, consumer=_consumer) + return kwargs + + +PUT_GROUP = APIOperation( + input=PutGroupInput, + output=PutGroupOutput, + schema=_SCHEMA_PUT_GROUP, + input_schema=_SCHEMA_PUT_GROUP_INPUT, + output_schema=_SCHEMA_PUT_GROUP_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +class ScoreConfidence(StrEnum): + VERY_HIGH = "VERY_HIGH" + HIGH = "HIGH" + MEDIUM = "MEDIUM" + LOW = "LOW" + NOT_AVAILABLE = "NOT_AVAILABLE" + + +@dataclass(kw_only=True) +class ScoreAttributes: + """Provides information about the relevance score of content.""" + + score_confidence: str | None = None + """The confidence level of the relevance score.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SCORE_ATTRIBUTES, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.score_confidence is not None: + serializer.write_string( + _SCHEMA_SCORE_ATTRIBUTES.members["scoreConfidence"], + self.score_confidence, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["score_confidence"] = de.read_string( + _SCHEMA_SCORE_ATTRIBUTES.members["scoreConfidence"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_SCORE_ATTRIBUTES, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class RelevantContent: + """Represents a piece of content that is relevant to a search query.""" + + content: str | None = None + """The actual content of the relevant item.""" + + document_id: str | None = None + """The unique identifier of the document containing the relevant content.""" + + document_title: str | None = None + """The title of the document containing the relevant content.""" + + document_uri: str | None = None + """The URI of the document containing the relevant content.""" + + document_attributes: list[DocumentAttribute] | None = None + """Additional attributes of the document containing the relevant content.""" + + score_attributes: ScoreAttributes | None = None + """Attributes related to the relevance score of the content.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RELEVANT_CONTENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.content is not None: + serializer.write_string( + _SCHEMA_RELEVANT_CONTENT.members["content"], self.content + ) + + if self.document_id is not None: + serializer.write_string( + _SCHEMA_RELEVANT_CONTENT.members["documentId"], self.document_id + ) + + if self.document_title is not None: + serializer.write_string( + _SCHEMA_RELEVANT_CONTENT.members["documentTitle"], self.document_title + ) + + if self.document_uri is not None: + serializer.write_string( + _SCHEMA_RELEVANT_CONTENT.members["documentUri"], self.document_uri + ) + + if self.document_attributes is not None: + _serialize_document_attributes( + serializer, + _SCHEMA_RELEVANT_CONTENT.members["documentAttributes"], + self.document_attributes, + ) + + if self.score_attributes is not None: + serializer.write_struct( + _SCHEMA_RELEVANT_CONTENT.members["scoreAttributes"], + self.score_attributes, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["content"] = de.read_string( + _SCHEMA_RELEVANT_CONTENT.members["content"] + ) + + case 1: + kwargs["document_id"] = de.read_string( + _SCHEMA_RELEVANT_CONTENT.members["documentId"] + ) + + case 2: + kwargs["document_title"] = de.read_string( + _SCHEMA_RELEVANT_CONTENT.members["documentTitle"] + ) + + case 3: + kwargs["document_uri"] = de.read_string( + _SCHEMA_RELEVANT_CONTENT.members["documentUri"] + ) + + case 4: + kwargs["document_attributes"] = _deserialize_document_attributes( + de, _SCHEMA_RELEVANT_CONTENT.members["documentAttributes"] + ) + + case 5: + kwargs["score_attributes"] = ScoreAttributes.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_RELEVANT_CONTENT, consumer=_consumer) + return kwargs + + +def _serialize_relevant_content_list( + serializer: ShapeSerializer, schema: Schema, value: list[RelevantContent] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_relevant_content_list( + deserializer: ShapeDeserializer, schema: Schema +) -> list[RelevantContent]: + result: list[RelevantContent] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(RelevantContent.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class SearchRelevantContentOutput: + """Dataclass for SearchRelevantContentOutput structure.""" + + relevant_content: list[RelevantContent] | None = None + """The list of relevant content items found.""" + + next_token: str | None = None + """The token to use to retrieve the next set of results, if there are any.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.relevant_content is not None: + _serialize_relevant_content_list( + serializer, + _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT.members["relevantContent"], + self.relevant_content, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT.members["nextToken"], + self.next_token, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["relevant_content"] = _deserialize_relevant_content_list( + de, + _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT.members[ + "relevantContent" + ], + ) + + case 1: + kwargs["next_token"] = de.read_string( + _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT.members["nextToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class StartDataSourceSyncJobInput: + """Dataclass for StartDataSourceSyncJobInput structure.""" + + data_source_id: str | None = None + """The identifier of the data source connector.""" + + application_id: str | None = None + """ + The identifier of Amazon Q Business application the data source is + connected to. + """ + + index_id: str | None = None + """The identifier of the index used with the data source connector.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members["dataSourceId"], + self.data_source_id, + ) + + if self.application_id is not None: + serializer.write_string( + _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members["indexId"], + self.index_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members["dataSourceId"] + ) + + case 1: + kwargs["application_id"] = de.read_string( + _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members[ + "applicationId" + ] + ) + + case 2: + kwargs["index_id"] = de.read_string( + _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members["indexId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class StartDataSourceSyncJobOutput: + """Dataclass for StartDataSourceSyncJobOutput structure.""" + + execution_id: str | None = None + """The identifier for a particular synchronization job.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.execution_id is not None: + serializer.write_string( + _SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT.members["executionId"], + self.execution_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["execution_id"] = de.read_string( + _SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT.members["executionId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT, consumer=_consumer + ) + return kwargs + + +START_DATA_SOURCE_SYNC_JOB = APIOperation( + input=StartDataSourceSyncJobInput, + output=StartDataSourceSyncJobOutput, + schema=_SCHEMA_START_DATA_SOURCE_SYNC_JOB, + input_schema=_SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT, + output_schema=_SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class StopDataSourceSyncJobInput: + """Dataclass for StopDataSourceSyncJobInput structure.""" + + data_source_id: str | None = None + """The identifier of the data source connector.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application that the data source + is connected to. + """ + + index_id: str | None = None + """ + The identifier of the index used with the Amazon Q Business data source + connector. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.data_source_id is not None: + serializer.write_string( + _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["dataSourceId"], + self.data_source_id, + ) + + if self.application_id is not None: + serializer.write_string( + _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["applicationId"], + self.application_id, + ) + + if self.index_id is not None: + serializer.write_string( + _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["indexId"], + self.index_id, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["data_source_id"] = de.read_string( + _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["dataSourceId"] + ) + + case 1: + kwargs["application_id"] = de.read_string( + _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["applicationId"] + ) + + case 2: + kwargs["index_id"] = de.read_string( + _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["indexId"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class StopDataSourceSyncJobOutput: + """Dataclass for StopDataSourceSyncJobOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_OUTPUT, consumer=_consumer + ) + return kwargs + + +STOP_DATA_SOURCE_SYNC_JOB = APIOperation( + input=StopDataSourceSyncJobInput, + output=StopDataSourceSyncJobOutput, + schema=_SCHEMA_STOP_DATA_SOURCE_SYNC_JOB, + input_schema=_SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT, + output_schema=_SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class TagResourceInput: + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the Amazon Q Business application or + data source to tag. + """ + + tags: list[Tag] | None = None + """ + A list of tag keys to add to the Amazon Q Business application or data + source. If a tag already exists, the existing value is replaced with the + new value. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.resource_arn is not None: + serializer.write_string( + _SCHEMA_TAG_RESOURCE_INPUT.members["resourceARN"], self.resource_arn + ) + + if self.tags is not None: + _serialize_tags( + serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"], self.tags + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["resource_arn"] = de.read_string( + _SCHEMA_TAG_RESOURCE_INPUT.members["resourceARN"] + ) + + case 1: + kwargs["tags"] = _deserialize_tags( + de, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class TagResourceOutput: + """Dataclass for TagResourceOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) + return kwargs + + +TAG_RESOURCE = APIOperation( + input=TagResourceInput, + output=TagResourceOutput, + schema=_SCHEMA_TAG_RESOURCE, + input_schema=_SCHEMA_TAG_RESOURCE_INPUT, + output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +def _serialize_tag_keys( + serializer: ShapeSerializer, schema: Schema, value: list[str] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_string(member_schema, e) + + +def _deserialize_tag_keys(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: + result: list[str] = [] + member_schema = schema.members["member"] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(d.read_string(member_schema)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class UntagResourceInput: + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the Amazon Q Business application, or + data source to remove the tag from. + """ + + tag_keys: list[str] | None = None + """ + A list of tag keys to remove from the Amazon Q Business application or + data source. If a tag key does not exist on the resource, it is ignored. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.resource_arn is not None: + serializer.write_string( + _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceARN"], self.resource_arn + ) + + if self.tag_keys is not None: + _serialize_tag_keys( + serializer, + _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"], + self.tag_keys, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["resource_arn"] = de.read_string( + _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceARN"] + ) + + case 1: + kwargs["tag_keys"] = _deserialize_tag_keys( + de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class UntagResourceOutput: + """Dataclass for UntagResourceOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) + return kwargs + + +UNTAG_RESOURCE = APIOperation( + input=UntagResourceInput, + output=UntagResourceOutput, + schema=_SCHEMA_UNTAG_RESOURCE, + input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, + output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class OrchestrationConfiguration: + """ + Configuration information required to enable chat orchestration for your + Amazon Q Business application. + + Note: + Chat orchestration is optimized to work for English language content. + For more details on language support in Amazon Q Business, see + [Supported + languages](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/supported-languages.html). + """ + + control: str + """ + Status information about whether chat orchestration is activated or + deactivated for your Amazon Q Business application. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ORCHESTRATION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_ORCHESTRATION_CONFIGURATION.members["control"], self.control + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["control"] = de.read_string( + _SCHEMA_ORCHESTRATION_CONFIGURATION.members["control"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_ORCHESTRATION_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class UpdateChatControlsConfigurationInput: + """Dataclass for UpdateChatControlsConfigurationInput structure.""" + + application_id: str | None = None + """ + The identifier of the application for which the chat controls are + configured. + """ + + client_token: str | None = None + """ + A token that you provide to identify the request to update a Amazon Q + Business application chat configuration. + """ + + response_scope: str | None = None + """ + The response scope configured for your application. This determines + whether your application uses its retrieval augmented generation (RAG) + system to generate answers only from your enterprise data, or also uses + the large language models (LLM) knowledge to respons to end user + questions in chat. + """ + + orchestration_configuration: OrchestrationConfiguration | None = None + """The chat response orchestration settings for your application.""" + + blocked_phrases_configuration_update: BlockedPhrasesConfigurationUpdate | None = ( + None + ) + """The phrases blocked from chat by your chat control configuration.""" + + topic_configurations_to_create_or_update: list[TopicConfiguration] | None = None + """The configured topic specific chat controls you want to update.""" + + topic_configurations_to_delete: list[TopicConfiguration] | None = None + """The configured topic specific chat controls you want to delete.""" + + creator_mode_configuration: CreatorModeConfiguration | None = None + """The configuration details for `CREATOR_MODE`.""" + + hallucination_reduction_configuration: ( + HallucinationReductionConfiguration | None + ) = None + """The hallucination reduction settings for your application.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "applicationId" + ], + self.application_id, + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members["clientToken"], + self.client_token, + ) + + if self.response_scope is not None: + serializer.write_string( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "responseScope" + ], + self.response_scope, + ) + + if self.orchestration_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "orchestrationConfiguration" + ], + self.orchestration_configuration, + ) + + if self.blocked_phrases_configuration_update is not None: + serializer.write_struct( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "blockedPhrasesConfigurationUpdate" + ], + self.blocked_phrases_configuration_update, + ) + + if self.topic_configurations_to_create_or_update is not None: + _serialize_topic_configurations( + serializer, + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "topicConfigurationsToCreateOrUpdate" + ], + self.topic_configurations_to_create_or_update, + ) + + if self.topic_configurations_to_delete is not None: + _serialize_topic_configurations( + serializer, + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "topicConfigurationsToDelete" + ], + self.topic_configurations_to_delete, + ) + + if self.creator_mode_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "creatorModeConfiguration" + ], + self.creator_mode_configuration, + ) + + if self.hallucination_reduction_configuration is not None: + serializer.write_struct( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "hallucinationReductionConfiguration" + ], + self.hallucination_reduction_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "applicationId" + ] + ) + + case 1: + kwargs["client_token"] = de.read_string( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "clientToken" + ] + ) + + case 2: + kwargs["response_scope"] = de.read_string( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "responseScope" + ] + ) + + case 3: + kwargs["orchestration_configuration"] = ( + OrchestrationConfiguration.deserialize(de) + ) + + case 4: + kwargs["blocked_phrases_configuration_update"] = ( + BlockedPhrasesConfigurationUpdate.deserialize(de) + ) + + case 5: + kwargs["topic_configurations_to_create_or_update"] = ( + _deserialize_topic_configurations( + de, + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "topicConfigurationsToCreateOrUpdate" + ], + ) + ) + + case 6: + kwargs["topic_configurations_to_delete"] = ( + _deserialize_topic_configurations( + de, + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ + "topicConfigurationsToDelete" + ], + ) + ) + + case 7: + kwargs["creator_mode_configuration"] = ( + CreatorModeConfiguration.deserialize(de) + ) + + case 8: + kwargs["hallucination_reduction_configuration"] = ( + HallucinationReductionConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class UpdateChatControlsConfigurationOutput: + """Dataclass for UpdateChatControlsConfigurationOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, consumer=_consumer + ) + return kwargs + + +UPDATE_CHAT_CONTROLS_CONFIGURATION = APIOperation( + input=UpdateChatControlsConfigurationInput, + output=UpdateChatControlsConfigurationOutput, + schema=_SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION, + input_schema=_SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT, + output_schema=_SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class UpdateChatResponseConfigurationInput: + """Dataclass for UpdateChatResponseConfigurationInput structure.""" + + application_id: str | None = None + """ + The unique identifier of the Amazon Q Business application containing + the chat response configuration to update. + """ + + chat_response_configuration_id: str | None = None + """ + The unique identifier of the chat response configuration to update + within the specified application. + """ + + display_name: str | None = None + """ + The new human-readable name to assign to the chat response + configuration, making it easier to identify among multiple + configurations. + """ + + response_configurations: dict[str, ResponseConfiguration] | None = None + """ + The updated collection of response configuration settings that define + how Amazon Q Business generates and formats responses to user queries. + """ + + client_token: str | None = None + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. This helps prevent the same update from being processed + multiple times if retries occur. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "applicationId" + ], + self.application_id, + ) + + if self.chat_response_configuration_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "chatResponseConfigurationId" + ], + self.chat_response_configuration_id, + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members["displayName"], + self.display_name, + ) + + if self.response_configurations is not None: + _serialize_response_configurations( + serializer, + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "responseConfigurations" + ], + self.response_configurations, + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members["clientToken"], + self.client_token, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "applicationId" + ] + ) + + case 1: + kwargs["chat_response_configuration_id"] = de.read_string( + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "chatResponseConfigurationId" + ] + ) + + case 2: + kwargs["display_name"] = de.read_string( + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "displayName" + ] + ) + + case 3: + kwargs["response_configurations"] = ( + _deserialize_response_configurations( + de, + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "responseConfigurations" + ], + ) + ) + + case 4: + kwargs["client_token"] = de.read_string( + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ + "clientToken" + ] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class UpdateChatResponseConfigurationOutput: + """Dataclass for UpdateChatResponseConfigurationOutput structure.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + pass + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, consumer=_consumer + ) + return kwargs + + +UPDATE_CHAT_RESPONSE_CONFIGURATION = APIOperation( + input=UpdateChatResponseConfigurationInput, + output=UpdateChatResponseConfigurationOutput, + schema=_SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION, + input_schema=_SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT, + output_schema=_SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class UpdateSubscriptionInput: + """Dataclass for UpdateSubscriptionInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application where the + subscription update should take effect. + """ + + subscription_id: str | None = None + """The identifier of the Amazon Q Business subscription to be updated.""" + + type: str | None = None + """The type of the Amazon Q Business subscription to be updated.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_SUBSCRIPTION_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["applicationId"], + self.application_id, + ) + + if self.subscription_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["subscriptionId"], + self.subscription_id, + ) + + if self.type is not None: + serializer.write_string( + _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["type"], self.type + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["applicationId"] + ) + + case 1: + kwargs["subscription_id"] = de.read_string( + _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["subscriptionId"] + ) + + case 2: + kwargs["type"] = de.read_string( + _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["type"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_SUBSCRIPTION_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class UpdateSubscriptionOutput: + """Dataclass for UpdateSubscriptionOutput structure.""" + + subscription_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the Amazon Q Business subscription + that was updated. + """ + + current_subscription: SubscriptionDetails | None = None + """The type of your current Amazon Q Business subscription.""" + + next_subscription: SubscriptionDetails | None = None + """The type of the Amazon Q Business subscription for the next month.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.subscription_arn is not None: + serializer.write_string( + _SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT.members["subscriptionArn"], + self.subscription_arn, + ) + + if self.current_subscription is not None: + serializer.write_struct( + _SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT.members["currentSubscription"], + self.current_subscription, + ) + + if self.next_subscription is not None: + serializer.write_struct( + _SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT.members["nextSubscription"], + self.next_subscription, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["subscription_arn"] = de.read_string( + _SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT.members["subscriptionArn"] + ) + + case 1: + kwargs["current_subscription"] = SubscriptionDetails.deserialize(de) + + case 2: + kwargs["next_subscription"] = SubscriptionDetails.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT, consumer=_consumer) + return kwargs + + +UPDATE_SUBSCRIPTION = APIOperation( + input=UpdateSubscriptionInput, + output=UpdateSubscriptionOutput, + schema=_SCHEMA_UPDATE_SUBSCRIPTION, + input_schema=_SCHEMA_UPDATE_SUBSCRIPTION_INPUT, + output_schema=_SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class UpdateUserInput: + """Dataclass for UpdateUserInput structure.""" + + application_id: str | None = None + """The identifier of the application the user is attached to.""" + + user_id: str | None = None + """The email id attached to the user.""" + + user_aliases_to_update: list[UserAlias] | None = None + """The user aliases attached to the user id that are to be updated.""" + + user_aliases_to_delete: list[UserAlias] | None = None + """The user aliases attached to the user id that are to be deleted.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_USER_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_USER_INPUT.members["applicationId"], self.application_id + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_USER_INPUT.members["userId"], self.user_id + ) + + if self.user_aliases_to_update is not None: + _serialize_user_aliases( + serializer, + _SCHEMA_UPDATE_USER_INPUT.members["userAliasesToUpdate"], + self.user_aliases_to_update, + ) + + if self.user_aliases_to_delete is not None: + _serialize_user_aliases( + serializer, + _SCHEMA_UPDATE_USER_INPUT.members["userAliasesToDelete"], + self.user_aliases_to_delete, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_UPDATE_USER_INPUT.members["applicationId"] + ) + + case 1: + kwargs["user_id"] = de.read_string( + _SCHEMA_UPDATE_USER_INPUT.members["userId"] + ) + + case 2: + kwargs["user_aliases_to_update"] = _deserialize_user_aliases( + de, _SCHEMA_UPDATE_USER_INPUT.members["userAliasesToUpdate"] + ) + + case 3: + kwargs["user_aliases_to_delete"] = _deserialize_user_aliases( + de, _SCHEMA_UPDATE_USER_INPUT.members["userAliasesToDelete"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_USER_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class UpdateUserOutput: + """Dataclass for UpdateUserOutput structure.""" + + user_aliases_added: list[UserAlias] | None = None + """The user aliases that have been to be added to a user id.""" + + user_aliases_updated: list[UserAlias] | None = None + """The user aliases attached to a user id that have been updated.""" + + user_aliases_deleted: list[UserAlias] | None = None + """The user aliases that have been deleted from a user id.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_USER_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.user_aliases_added is not None: + _serialize_user_aliases( + serializer, + _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesAdded"], + self.user_aliases_added, + ) + + if self.user_aliases_updated is not None: + _serialize_user_aliases( + serializer, + _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesUpdated"], + self.user_aliases_updated, + ) + + if self.user_aliases_deleted is not None: + _serialize_user_aliases( + serializer, + _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesDeleted"], + self.user_aliases_deleted, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["user_aliases_added"] = _deserialize_user_aliases( + de, _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesAdded"] + ) + + case 1: + kwargs["user_aliases_updated"] = _deserialize_user_aliases( + de, _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesUpdated"] + ) + + case 2: + kwargs["user_aliases_deleted"] = _deserialize_user_aliases( + de, _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesDeleted"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_USER_OUTPUT, consumer=_consumer) + return kwargs + + +UPDATE_USER = APIOperation( + input=UpdateUserInput, + output=UpdateUserOutput, + schema=_SCHEMA_UPDATE_USER, + input_schema=_SCHEMA_UPDATE_USER_INPUT, + output_schema=_SCHEMA_UPDATE_USER_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class AttributeFilter: + """ + Enables filtering of responses based on document attributes or metadata + fields. + """ + + and_all_filters: "list[AttributeFilter] | None" = None + """Performs a logical `AND` operation on all supplied filters.""" + + or_all_filters: "list[AttributeFilter] | None" = None + """Performs a logical `OR` operation on all supplied filters.""" + + not_filter: "AttributeFilter | None" = None + """Performs a logical `NOT` operation on all supplied filters.""" + + equals_to: DocumentAttribute | None = None + """ + Performs an equals operation on two document attributes or metadata + fields. Supported for the following [document attribute value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `dateValue`, `longValue`, `stringListValue` and `stringValue`. + """ + + contains_all: DocumentAttribute | None = None + """ + Returns `true` when a document contains all the specified document + attributes or metadata fields. Supported for the following [document + attribute value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `stringListValue`. + """ + + contains_any: DocumentAttribute | None = None + """ + Returns `true` when a document contains any of the specified document + attributes or metadata fields. Supported for the following [document + attribute value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `stringListValue`. + """ + + greater_than: DocumentAttribute | None = None + """ + Performs a greater than operation on two document attributes or metadata + fields. Supported for the following [document attribute value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `dateValue` and `longValue`. + """ + + greater_than_or_equals: DocumentAttribute | None = None + """ + Performs a greater or equals than operation on two document attributes + or metadata fields. Supported for the following [document attribute + value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `dateValue` and `longValue`. + """ + + less_than: DocumentAttribute | None = None + """ + Performs a less than operation on two document attributes or metadata + fields. Supported for the following [document attribute value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `dateValue` and `longValue`. + """ + + less_than_or_equals: DocumentAttribute | None = None + """ + Performs a less than or equals operation on two document attributes or + metadata fields.Supported for the following [document attribute value + type](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `dateValue` and `longValue`. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ATTRIBUTE_FILTER, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.and_all_filters is not None: + _serialize_attribute_filters( + serializer, + _SCHEMA_ATTRIBUTE_FILTER.members["andAllFilters"], + self.and_all_filters, + ) + + if self.or_all_filters is not None: + _serialize_attribute_filters( + serializer, + _SCHEMA_ATTRIBUTE_FILTER.members["orAllFilters"], + self.or_all_filters, + ) + + if self.not_filter is not None: + serializer.write_struct( + _SCHEMA_ATTRIBUTE_FILTER.members["notFilter"], self.not_filter + ) + + if self.equals_to is not None: + serializer.write_struct( + _SCHEMA_ATTRIBUTE_FILTER.members["equalsTo"], self.equals_to + ) + + if self.contains_all is not None: + serializer.write_struct( + _SCHEMA_ATTRIBUTE_FILTER.members["containsAll"], self.contains_all + ) + + if self.contains_any is not None: + serializer.write_struct( + _SCHEMA_ATTRIBUTE_FILTER.members["containsAny"], self.contains_any + ) + + if self.greater_than is not None: + serializer.write_struct( + _SCHEMA_ATTRIBUTE_FILTER.members["greaterThan"], self.greater_than + ) + + if self.greater_than_or_equals is not None: + serializer.write_struct( + _SCHEMA_ATTRIBUTE_FILTER.members["greaterThanOrEquals"], + self.greater_than_or_equals, + ) + + if self.less_than is not None: + serializer.write_struct( + _SCHEMA_ATTRIBUTE_FILTER.members["lessThan"], self.less_than + ) + + if self.less_than_or_equals is not None: + serializer.write_struct( + _SCHEMA_ATTRIBUTE_FILTER.members["lessThanOrEquals"], + self.less_than_or_equals, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["and_all_filters"] = _deserialize_attribute_filters( + de, _SCHEMA_ATTRIBUTE_FILTER.members["andAllFilters"] + ) + + case 1: + kwargs["or_all_filters"] = _deserialize_attribute_filters( + de, _SCHEMA_ATTRIBUTE_FILTER.members["orAllFilters"] + ) + + case 2: + kwargs["not_filter"] = AttributeFilter.deserialize(de) + + case 3: + kwargs["equals_to"] = DocumentAttribute.deserialize(de) + + case 4: + kwargs["contains_all"] = DocumentAttribute.deserialize(de) + + case 5: + kwargs["contains_any"] = DocumentAttribute.deserialize(de) + + case 6: + kwargs["greater_than"] = DocumentAttribute.deserialize(de) + + case 7: + kwargs["greater_than_or_equals"] = DocumentAttribute.deserialize(de) + + case 8: + kwargs["less_than"] = DocumentAttribute.deserialize(de) + + case 9: + kwargs["less_than_or_equals"] = DocumentAttribute.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ATTRIBUTE_FILTER, consumer=_consumer) + return kwargs + + +def _serialize_attribute_filters( + serializer: ShapeSerializer, schema: Schema, value: list[AttributeFilter] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_attribute_filters( + deserializer: ShapeDeserializer, schema: Schema +) -> list[AttributeFilter]: + result: list[AttributeFilter] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(AttributeFilter.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ActionFilterConfiguration: + """Specifies filters to apply to an allowed action.""" + + document_attribute_filter: "AttributeFilter" + """ + Enables filtering of responses based on document attributes or metadata + fields. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACTION_FILTER_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_ACTION_FILTER_CONFIGURATION.members["documentAttributeFilter"], + self.document_attribute_filter, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["document_attribute_filter"] = AttributeFilter.deserialize( + de + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_ACTION_FILTER_CONFIGURATION, consumer=_consumer + ) + return kwargs + + +@dataclass(kw_only=True) +class ChatSyncInput: + """Dataclass for ChatSyncInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application linked to the Amazon + Q Business conversation. + """ + + user_id: str | None = None + """The identifier of the user attached to the chat input.""" + + user_groups: list[str] | None = None + """The group names that a user associated with the chat input belongs to.""" + + user_message: str | None = None + """A end user message in a conversation.""" + + attachments: list[AttachmentInput] | None = None + """ + A list of files uploaded directly during chat. You can upload a maximum + of 5 files of upto 10 MB each. + """ + + action_execution: ActionExecution | None = None + """ + A request from an end user to perform an Amazon Q Business plugin + action. + """ + + auth_challenge_response: AuthChallengeResponse | None = None + """ + An authentication verification event response by a third party + authentication server to Amazon Q Business. + """ + + conversation_id: str | None = None + """The identifier of the Amazon Q Business conversation.""" + + parent_message_id: str | None = None + """The identifier of the previous system message in a conversation.""" + + attribute_filter: "AttributeFilter | None" = None + """ + Enables filtering of Amazon Q Business web experience responses based on + document attributes or metadata fields. + """ + + chat_mode: str | None = None + """ + The `chatMode` parameter determines the chat modes available to Amazon Q + Business users: + + - `RETRIEVAL_MODE` - If you choose this mode, Amazon Q generates + responses solely from the data sources connected and indexed by the + application. If an answer is not found in the data sources or there + are no data sources available, Amazon Q will respond with a \"*No + Answer Found*\" message, unless LLM knowledge has been enabled. In + that case, Amazon Q will generate a response from the LLM knowledge + + - `CREATOR_MODE` - By selecting this mode, you can choose to generate + responses only from the LLM knowledge. You can also attach files and + have Amazon Q generate a response based on the data in those files. If + the attached files do not contain an answer for the query, Amazon Q + will automatically fall back to generating a response from the LLM + knowledge. + + - `PLUGIN_MODE` - By selecting this mode, users can choose to use + plugins in chat to get their responses. + + Note: + If none of the modes are selected, Amazon Q will only respond using the + information from the attached files. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html), + [Plugins](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html), + and [Response + sources](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + + chat_mode_configuration: ChatModeConfiguration | None = None + """The chat mode configuration for an Amazon Q Business application.""" + + client_token: str | None = None + """A token that you provide to identify a chat request.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_SYNC_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CHAT_SYNC_INPUT.members["applicationId"], self.application_id + ) + + if self.user_id is not None: + serializer.write_string( + _SCHEMA_CHAT_SYNC_INPUT.members["userId"], self.user_id + ) + + if self.user_groups is not None: + _serialize_user_groups( + serializer, + _SCHEMA_CHAT_SYNC_INPUT.members["userGroups"], + self.user_groups, + ) + + if self.user_message is not None: + serializer.write_string( + _SCHEMA_CHAT_SYNC_INPUT.members["userMessage"], self.user_message + ) + + if self.attachments is not None: + _serialize_attachments_input( + serializer, + _SCHEMA_CHAT_SYNC_INPUT.members["attachments"], + self.attachments, + ) + + if self.action_execution is not None: + serializer.write_struct( + _SCHEMA_CHAT_SYNC_INPUT.members["actionExecution"], + self.action_execution, + ) + + if self.auth_challenge_response is not None: + serializer.write_struct( + _SCHEMA_CHAT_SYNC_INPUT.members["authChallengeResponse"], + self.auth_challenge_response, + ) + + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_CHAT_SYNC_INPUT.members["conversationId"], self.conversation_id + ) + + if self.parent_message_id is not None: + serializer.write_string( + _SCHEMA_CHAT_SYNC_INPUT.members["parentMessageId"], + self.parent_message_id, + ) + + if self.attribute_filter is not None: + serializer.write_struct( + _SCHEMA_CHAT_SYNC_INPUT.members["attributeFilter"], + self.attribute_filter, + ) + + if self.chat_mode is not None: + serializer.write_string( + _SCHEMA_CHAT_SYNC_INPUT.members["chatMode"], self.chat_mode + ) + + if self.chat_mode_configuration is not None: + serializer.write_struct( + _SCHEMA_CHAT_SYNC_INPUT.members["chatModeConfiguration"], + self.chat_mode_configuration, + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CHAT_SYNC_INPUT.members["clientToken"], self.client_token + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CHAT_SYNC_INPUT.members["applicationId"] + ) + + case 1: + kwargs["user_id"] = de.read_string( + _SCHEMA_CHAT_SYNC_INPUT.members["userId"] + ) + + case 2: + kwargs["user_groups"] = _deserialize_user_groups( + de, _SCHEMA_CHAT_SYNC_INPUT.members["userGroups"] + ) + + case 3: + kwargs["user_message"] = de.read_string( + _SCHEMA_CHAT_SYNC_INPUT.members["userMessage"] + ) + + case 4: + kwargs["attachments"] = _deserialize_attachments_input( + de, _SCHEMA_CHAT_SYNC_INPUT.members["attachments"] + ) + + case 5: + kwargs["action_execution"] = ActionExecution.deserialize(de) + + case 6: + kwargs["auth_challenge_response"] = ( + AuthChallengeResponse.deserialize(de) + ) + + case 7: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_CHAT_SYNC_INPUT.members["conversationId"] + ) + + case 8: + kwargs["parent_message_id"] = de.read_string( + _SCHEMA_CHAT_SYNC_INPUT.members["parentMessageId"] + ) + + case 9: + kwargs["attribute_filter"] = AttributeFilter.deserialize(de) + + case 10: + kwargs["chat_mode"] = de.read_string( + _SCHEMA_CHAT_SYNC_INPUT.members["chatMode"] + ) + + case 11: + kwargs["chat_mode_configuration"] = ( + _ChatModeConfigurationDeserializer().deserialize(de) + ) + + case 12: + kwargs["client_token"] = de.read_string( + _SCHEMA_CHAT_SYNC_INPUT.members["clientToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CHAT_SYNC_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class ConfigurationEvent: + """ + A configuration event activated by an end user request to select a + specific chat mode. + """ + + chat_mode: str | None = None + """ + The chat modes available to an Amazon Q Business end user. + + - `RETRIEVAL_MODE` - The default chat mode for an Amazon Q Business + application. When this mode is enabled, Amazon Q Business generates + responses only from data sources connected to an Amazon Q Business + application. + + - `CREATOR_MODE` - By selecting this mode, users can choose to generate + responses only from the LLM knowledge, without consulting connected + data sources, for a chat request. + + - `PLUGIN_MODE` - By selecting this mode, users can choose to use + plugins in chat. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html), + [Plugins](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html), + and [Conversation + settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + + chat_mode_configuration: ChatModeConfiguration | None = None + """ + Configuration information for Amazon Q Business conversation modes. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) + and [Conversation + settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + + attribute_filter: "AttributeFilter | None" = None + """ + Enables filtering of responses based on document attributes or metadata + fields. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CONFIGURATION_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.chat_mode is not None: + serializer.write_string( + _SCHEMA_CONFIGURATION_EVENT.members["chatMode"], self.chat_mode + ) + + if self.chat_mode_configuration is not None: + serializer.write_struct( + _SCHEMA_CONFIGURATION_EVENT.members["chatModeConfiguration"], + self.chat_mode_configuration, + ) + + if self.attribute_filter is not None: + serializer.write_struct( + _SCHEMA_CONFIGURATION_EVENT.members["attributeFilter"], + self.attribute_filter, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["chat_mode"] = de.read_string( + _SCHEMA_CONFIGURATION_EVENT.members["chatMode"] + ) + + case 1: + kwargs["chat_mode_configuration"] = ( + _ChatModeConfigurationDeserializer().deserialize(de) + ) + + case 2: + kwargs["attribute_filter"] = AttributeFilter.deserialize(de) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CONFIGURATION_EVENT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class SearchRelevantContentInput: + """Dataclass for SearchRelevantContentInput structure.""" + + application_id: str | None = None + """The unique identifier of the Amazon Q Business application to search.""" + + query_text: str | None = None + """The text to search for.""" + + content_source: ContentSource | None = None + """The source of content to search in.""" + + attribute_filter: "AttributeFilter | None" = None + """ + Enables filtering of responses based on document attributes or metadata + fields. + """ + + max_results: int = 10 + """The maximum number of results to return.""" + + next_token: str | None = None + """ + The token for the next set of results. (You received this token from a + previous call.) + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["applicationId"], + self.application_id, + ) + + if self.query_text is not None: + serializer.write_string( + _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["queryText"], + self.query_text, + ) + + if self.content_source is not None: + serializer.write_struct( + _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["contentSource"], + self.content_source, + ) + + if self.attribute_filter is not None: + serializer.write_struct( + _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["attributeFilter"], + self.attribute_filter, + ) + + if self.max_results is not None: + serializer.write_integer( + _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["maxResults"], + self.max_results, + ) + + if self.next_token is not None: + serializer.write_string( + _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["nextToken"], + self.next_token, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["applicationId"] + ) + + case 1: + kwargs["query_text"] = de.read_string( + _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["queryText"] + ) + + case 2: + kwargs["content_source"] = _ContentSourceDeserializer().deserialize( + de + ) + + case 3: + kwargs["attribute_filter"] = AttributeFilter.deserialize(de) + + case 4: + kwargs["max_results"] = de.read_integer( + _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["maxResults"] + ) + + case 5: + kwargs["next_token"] = de.read_string( + _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["nextToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct( + _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT, consumer=_consumer + ) + return kwargs + + +CHAT_SYNC = APIOperation( + input=ChatSyncInput, + output=ChatSyncOutput, + schema=_SCHEMA_CHAT_SYNC, + input_schema=_SCHEMA_CHAT_SYNC_INPUT, + output_schema=_SCHEMA_CHAT_SYNC_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#ExternalResourceException" + ): ExternalResourceException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#LicenseNotFoundException" + ): LicenseNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + +SEARCH_RELEVANT_CONTENT = APIOperation( + input=SearchRelevantContentInput, + output=SearchRelevantContentOutput, + schema=_SCHEMA_SEARCH_RELEVANT_CONTENT, + input_schema=_SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT, + output_schema=_SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#LicenseNotFoundException" + ): LicenseNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class ActionConfiguration: + """Specifies an allowed action and its associated filter configuration.""" + + action: str + """The Amazon Q Business action that is allowed.""" + + filter_configuration: "ActionFilterConfiguration | None" = None + """The filter configuration for the action, if any.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_ACTION_CONFIGURATION, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_string( + _SCHEMA_ACTION_CONFIGURATION.members["action"], self.action + ) + if self.filter_configuration is not None: + serializer.write_struct( + _SCHEMA_ACTION_CONFIGURATION.members["filterConfiguration"], + self.filter_configuration, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["action"] = de.read_string( + _SCHEMA_ACTION_CONFIGURATION.members["action"] + ) + + case 1: + kwargs["filter_configuration"] = ( + ActionFilterConfiguration.deserialize(de) + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_ACTION_CONFIGURATION, consumer=_consumer) + return kwargs + + +@dataclass +class ChatInputStreamConfigurationEvent: + """ + A configuration event activated by an end user request to select a + specific chat mode. + """ + + value: ConfigurationEvent + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_INPUT_STREAM.members["configurationEvent"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=ConfigurationEvent.deserialize(deserializer)) + + +@dataclass +class ChatInputStreamTextEvent: + """ + Information about the payload of the `ChatInputStream` event containing + the end user message input. + """ + + value: TextInputEvent + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_INPUT_STREAM.members["textEvent"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=TextInputEvent.deserialize(deserializer)) + + +@dataclass +class ChatInputStreamAttachmentEvent: + """A request by an end user to upload a file during chat.""" + + value: AttachmentInputEvent + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_INPUT_STREAM.members["attachmentEvent"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=AttachmentInputEvent.deserialize(deserializer)) + + +@dataclass +class ChatInputStreamActionExecutionEvent: + """ + A request from an end user to perform an Amazon Q Business plugin + action. + """ + + value: ActionExecutionEvent + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_INPUT_STREAM.members["actionExecutionEvent"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=ActionExecutionEvent.deserialize(deserializer)) + + +@dataclass +class ChatInputStreamEndOfInputEvent: + """The end of the streaming input for the `Chat` API.""" + + value: EndOfInputEvent + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_INPUT_STREAM.members["endOfInputEvent"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=EndOfInputEvent.deserialize(deserializer)) + + +@dataclass +class ChatInputStreamAuthChallengeResponseEvent: + """ + An authentication verification event response by a third party + authentication server to Amazon Q Business. + """ + + value: AuthChallengeResponseEvent + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct( + _SCHEMA_CHAT_INPUT_STREAM.members["authChallengeResponseEvent"], self.value + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=AuthChallengeResponseEvent.deserialize(deserializer)) + + +@dataclass +class ChatInputStreamUnknown: + """ + Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + + +ChatInputStream = Union[ + ChatInputStreamConfigurationEvent + | ChatInputStreamTextEvent + | ChatInputStreamAttachmentEvent + | ChatInputStreamActionExecutionEvent + | ChatInputStreamEndOfInputEvent + | ChatInputStreamAuthChallengeResponseEvent + | ChatInputStreamUnknown +] +"""The streaming input for the `Chat` API.""" + + +class _ChatInputStreamDeserializer: + _result: ChatInputStream | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> ChatInputStream: + self._result = None + deserializer.read_struct(_SCHEMA_CHAT_INPUT_STREAM, self._consumer) + + if self._result is None: + raise SerializationError( + "Unions must have exactly one value, but found none." + ) + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(ChatInputStreamConfigurationEvent.deserialize(de)) + + case 1: + self._set_result(ChatInputStreamTextEvent.deserialize(de)) + + case 2: + self._set_result(ChatInputStreamAttachmentEvent.deserialize(de)) + + case 3: + self._set_result(ChatInputStreamActionExecutionEvent.deserialize(de)) + + case 4: + self._set_result(ChatInputStreamEndOfInputEvent.deserialize(de)) + + case 5: + self._set_result( + ChatInputStreamAuthChallengeResponseEvent.deserialize(de) + ) + + case _: + self._set_result( + ChatInputStreamUnknown(tag=schema.expect_member_name()) + ) + + def _set_result(self, value: ChatInputStream) -> None: + if self._result is not None: + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) + self._result = value + + +def _serialize_action_configuration_list( + serializer: ShapeSerializer, schema: Schema, value: list[ActionConfiguration] +) -> None: + member_schema = schema.members["member"] + with serializer.begin_list(schema, len(value)) as ls: + for e in value: + ls.write_struct(member_schema, e) + + +def _deserialize_action_configuration_list( + deserializer: ShapeDeserializer, schema: Schema +) -> list[ActionConfiguration]: + result: list[ActionConfiguration] = [] + + def _read_value(d: ShapeDeserializer): + if d.is_null(): + d.read_null() + + else: + result.append(ActionConfiguration.deserialize(d)) + + deserializer.read_list(schema, _read_value) + return result + + +@dataclass(kw_only=True) +class ChatInput: + """Dataclass for ChatInput structure.""" + + application_id: str | None = None + """ + The identifier of the Amazon Q Business application linked to a + streaming Amazon Q Business conversation. + """ + + user_id: str | None = None + """The identifier of the user attached to the chat input.""" + + user_groups: list[str] | None = None + """The group names that a user associated with the chat input belongs to.""" + + conversation_id: str | None = None + """The identifier of the Amazon Q Business conversation.""" + + parent_message_id: str | None = None + """ + The identifier used to associate a user message with a AI generated + response. + """ + + client_token: str | None = None + """A token that you provide to identify the chat input.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CHAT_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CHAT_INPUT.members["applicationId"], self.application_id + ) + + if self.user_id is not None: + serializer.write_string(_SCHEMA_CHAT_INPUT.members["userId"], self.user_id) + + if self.user_groups is not None: + _serialize_user_groups( + serializer, _SCHEMA_CHAT_INPUT.members["userGroups"], self.user_groups + ) + + if self.conversation_id is not None: + serializer.write_string( + _SCHEMA_CHAT_INPUT.members["conversationId"], self.conversation_id + ) + + if self.parent_message_id is not None: + serializer.write_string( + _SCHEMA_CHAT_INPUT.members["parentMessageId"], self.parent_message_id + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CHAT_INPUT.members["clientToken"], self.client_token + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CHAT_INPUT.members["applicationId"] + ) + + case 1: + kwargs["user_id"] = de.read_string( + _SCHEMA_CHAT_INPUT.members["userId"] + ) + + case 2: + kwargs["user_groups"] = _deserialize_user_groups( + de, _SCHEMA_CHAT_INPUT.members["userGroups"] + ) + + case 3: + kwargs["conversation_id"] = de.read_string( + _SCHEMA_CHAT_INPUT.members["conversationId"] + ) + + case 4: + kwargs["parent_message_id"] = de.read_string( + _SCHEMA_CHAT_INPUT.members["parentMessageId"] + ) + + case 5: + kwargs["client_token"] = de.read_string( + _SCHEMA_CHAT_INPUT.members["clientToken"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CHAT_INPUT, consumer=_consumer) + return kwargs + + +CHAT = APIOperation( + input=ChatInput, + output=ChatOutput, + schema=_SCHEMA_CHAT, + input_schema=_SCHEMA_CHAT_INPUT, + output_schema=_SCHEMA_CHAT_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#ExternalResourceException" + ): ExternalResourceException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#LicenseNotFoundException" + ): LicenseNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + + +@dataclass(kw_only=True) +class CreateDataAccessorInput: + """Dataclass for CreateDataAccessorInput structure.""" + + application_id: str | None = None + """The unique identifier of the Amazon Q Business application.""" + + principal: str | None = None + """ + The Amazon Resource Name (ARN) of the IAM role for the ISV that will be + accessing the data. + """ + + action_configurations: "list[ActionConfiguration] | None" = None + """ + A list of action configurations specifying the allowed actions and any + associated filters. + """ + + client_token: str | None = None + """ + A unique, case-sensitive identifier you provide to ensure idempotency of + the request. + """ + + display_name: str | None = field(repr=False, default=None) + """A friendly name for the data accessor.""" + + authentication_detail: DataAccessorAuthenticationDetail | None = None + """ + The authentication configuration details for the data accessor. This + specifies how the ISV will authenticate when accessing data through this + data accessor. + """ + + tags: list[Tag] | None = None + """The tags to associate with the data accessor.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_CREATE_DATA_ACCESSOR_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["applicationId"], + self.application_id, + ) + + if self.principal is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["principal"], self.principal + ) + + if self.action_configurations is not None: + _serialize_action_configuration_list( + serializer, + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["actionConfigurations"], + self.action_configurations, + ) + + if self.client_token is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["clientToken"], + self.client_token, + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["displayName"], + self.display_name, + ) + + if self.authentication_detail is not None: + serializer.write_struct( + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["authenticationDetail"], + self.authentication_detail, + ) + + if self.tags is not None: + _serialize_tags( + serializer, + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["tags"], + self.tags, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["applicationId"] + ) + + case 1: + kwargs["principal"] = de.read_string( + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["principal"] + ) + + case 2: + kwargs["action_configurations"] = ( + _deserialize_action_configuration_list( + de, + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members[ + "actionConfigurations" + ], + ) + ) + + case 3: + kwargs["client_token"] = de.read_string( + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["clientToken"] + ) + + case 4: + kwargs["display_name"] = de.read_string( + _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["displayName"] + ) + + case 5: + kwargs["authentication_detail"] = ( + DataAccessorAuthenticationDetail.deserialize(de) + ) + + case 6: + kwargs["tags"] = _deserialize_tags( + de, _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["tags"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_CREATE_DATA_ACCESSOR_INPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class GetDataAccessorOutput: + """Dataclass for GetDataAccessorOutput structure.""" + + display_name: str | None = field(repr=False, default=None) + """The friendly name of the data accessor.""" + + data_accessor_id: str | None = None + """The unique identifier of the data accessor.""" + + data_accessor_arn: str | None = None + """The Amazon Resource Name (ARN) of the data accessor.""" + + application_id: str | None = None + """ + The unique identifier of the Amazon Q Business application associated + with this data accessor. + """ + + idc_application_arn: str | None = None + """ + The Amazon Resource Name (ARN) of the IAM Identity Center application + associated with this data accessor. + """ + + principal: str | None = None + """ + The Amazon Resource Name (ARN) of the IAM role for the ISV associated + with this data accessor. + """ + + action_configurations: "list[ActionConfiguration] | None" = None + """ + The list of action configurations specifying the allowed actions and any + associated filters. + """ + + authentication_detail: DataAccessorAuthenticationDetail | None = None + """ + The authentication configuration details for the data accessor. This + specifies how the ISV authenticates when accessing data through this + data accessor. + """ + + created_at: datetime | None = None + """The timestamp when the data accessor was created.""" + + updated_at: datetime | None = None + """The timestamp when the data accessor was last updated.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_GET_DATA_ACCESSOR_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.display_name is not None: + serializer.write_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["displayName"], + self.display_name, + ) + + if self.data_accessor_id is not None: + serializer.write_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["dataAccessorId"], + self.data_accessor_id, + ) + + if self.data_accessor_arn is not None: + serializer.write_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["dataAccessorArn"], + self.data_accessor_arn, + ) + + if self.application_id is not None: + serializer.write_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["applicationId"], + self.application_id, + ) + + if self.idc_application_arn is not None: + serializer.write_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["idcApplicationArn"], + self.idc_application_arn, + ) + + if self.principal is not None: + serializer.write_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["principal"], self.principal + ) + + if self.action_configurations is not None: + _serialize_action_configuration_list( + serializer, + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["actionConfigurations"], + self.action_configurations, + ) + + if self.authentication_detail is not None: + serializer.write_struct( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["authenticationDetail"], + self.authentication_detail, + ) + + if self.created_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["createdAt"], self.created_at + ) + + if self.updated_at is not None: + serializer.write_timestamp( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["updatedAt"], self.updated_at + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["display_name"] = de.read_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["displayName"] + ) + + case 1: + kwargs["data_accessor_id"] = de.read_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["dataAccessorId"] + ) + + case 2: + kwargs["data_accessor_arn"] = de.read_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["dataAccessorArn"] + ) + + case 3: + kwargs["application_id"] = de.read_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["applicationId"] + ) + + case 4: + kwargs["idc_application_arn"] = de.read_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["idcApplicationArn"] + ) + + case 5: + kwargs["principal"] = de.read_string( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["principal"] + ) + + case 6: + kwargs["action_configurations"] = ( + _deserialize_action_configuration_list( + de, + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members[ + "actionConfigurations" + ], + ) + ) + + case 7: + kwargs["authentication_detail"] = ( + DataAccessorAuthenticationDetail.deserialize(de) + ) + + case 8: + kwargs["created_at"] = de.read_timestamp( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["createdAt"] + ) + + case 9: + kwargs["updated_at"] = de.read_timestamp( + _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["updatedAt"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_GET_DATA_ACCESSOR_OUTPUT, consumer=_consumer) + return kwargs + + +@dataclass(kw_only=True) +class UpdateDataAccessorInput: + """Dataclass for UpdateDataAccessorInput structure.""" + + application_id: str | None = None + """The unique identifier of the Amazon Q Business application.""" + + data_accessor_id: str | None = None + """The unique identifier of the data accessor to update.""" + + action_configurations: "list[ActionConfiguration] | None" = None + """ + The updated list of action configurations specifying the allowed actions + and any associated filters. + """ + + authentication_detail: DataAccessorAuthenticationDetail | None = None + """ + The updated authentication configuration details for the data accessor. + This specifies how the ISV will authenticate when accessing data through + this data accessor. + """ + + display_name: str | None = field(repr=False, default=None) + """The updated friendly name for the data accessor.""" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_UPDATE_DATA_ACCESSOR_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.application_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["applicationId"], + self.application_id, + ) + + if self.data_accessor_id is not None: + serializer.write_string( + _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["dataAccessorId"], + self.data_accessor_id, + ) + + if self.action_configurations is not None: + _serialize_action_configuration_list( + serializer, + _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["actionConfigurations"], + self.action_configurations, + ) + + if self.authentication_detail is not None: + serializer.write_struct( + _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["authenticationDetail"], + self.authentication_detail, + ) + + if self.display_name is not None: + serializer.write_string( + _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["displayName"], + self.display_name, + ) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["application_id"] = de.read_string( + _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["applicationId"] + ) + + case 1: + kwargs["data_accessor_id"] = de.read_string( + _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["dataAccessorId"] + ) + + case 2: + kwargs["action_configurations"] = ( + _deserialize_action_configuration_list( + de, + _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members[ + "actionConfigurations" + ], + ) + ) + + case 3: + kwargs["authentication_detail"] = ( + DataAccessorAuthenticationDetail.deserialize(de) + ) + + case 4: + kwargs["display_name"] = de.read_string( + _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["displayName"] + ) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_UPDATE_DATA_ACCESSOR_INPUT, consumer=_consumer) + return kwargs + + +CREATE_DATA_ACCESSOR = APIOperation( + input=CreateDataAccessorInput, + output=CreateDataAccessorOutput, + schema=_SCHEMA_CREATE_DATA_ACCESSOR, + input_schema=_SCHEMA_CREATE_DATA_ACCESSOR_INPUT, + output_schema=_SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID( + "com.amazonaws.qbusiness#ServiceQuotaExceededException" + ): ServiceQuotaExceededException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + +GET_DATA_ACCESSOR = APIOperation( + input=GetDataAccessorInput, + output=GetDataAccessorOutput, + schema=_SCHEMA_GET_DATA_ACCESSOR, + input_schema=_SCHEMA_GET_DATA_ACCESSOR_INPUT, + output_schema=_SCHEMA_GET_DATA_ACCESSOR_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) + +UPDATE_DATA_ACCESSOR = APIOperation( + input=UpdateDataAccessorInput, + output=UpdateDataAccessorOutput, + schema=_SCHEMA_UPDATE_DATA_ACCESSOR, + input_schema=_SCHEMA_UPDATE_DATA_ACCESSOR_INPUT, + output_schema=_SCHEMA_UPDATE_DATA_ACCESSOR_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.qbusiness#AccessDeniedException" + ): AccessDeniedException, + ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, + ShapeID( + "com.amazonaws.qbusiness#InternalServerException" + ): InternalServerException, + ShapeID( + "com.amazonaws.qbusiness#ResourceNotFoundException" + ): ResourceNotFoundException, + ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, + ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + error_schemas=[ + _SCHEMA_ACCESS_DENIED_EXCEPTION, + _SCHEMA_CONFLICT_EXCEPTION, + _SCHEMA_INTERNAL_SERVER_EXCEPTION, + _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, + _SCHEMA_THROTTLING_EXCEPTION, + _SCHEMA_VALIDATION_EXCEPTION, + ], +) diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/user_agent.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/user_agent.py new file mode 100644 index 0000000..af061fa --- /dev/null +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/user_agent.py @@ -0,0 +1,17 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from smithy_aws_core.interceptors.user_agent import UserAgentInterceptor + +from . import __version__ +from .config import Config + + +def aws_user_agent_plugin(config: Config): + config.interceptors.append( + UserAgentInterceptor( + ua_suffix=config.user_agent_extra, + ua_app_id=config.sdk_ua_app_id, + sdk_version=__version__, + service_id="QBusiness", + ) + ) diff --git a/clients/aws-sdk-qbusiness/tests/__init__.py b/clients/aws-sdk-qbusiness/tests/__init__.py new file mode 100644 index 0000000..247be3e --- /dev/null +++ b/clients/aws-sdk-qbusiness/tests/__init__.py @@ -0,0 +1 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. diff --git a/clients/aws-sdk-qbusiness/tests/integration/__init__.py b/clients/aws-sdk-qbusiness/tests/integration/__init__.py new file mode 100644 index 0000000..4f44e2c --- /dev/null +++ b/clients/aws-sdk-qbusiness/tests/integration/__init__.py @@ -0,0 +1,20 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +from smithy_aws_core.identity import EnvironmentCredentialsResolver + +from aws_sdk_qbusiness.client import QBusinessClient +from aws_sdk_qbusiness.config import Config + +REGION = "us-east-1" + + +def create_qbusiness_client(region: str) -> QBusinessClient: + """Helper to create a QBusinessClient for a given region.""" + return QBusinessClient( + config=Config( + endpoint_uri=f"https://qbusiness.{region}.api.aws", + region=region, + aws_credentials_identity_resolver=EnvironmentCredentialsResolver(), + ) + ) diff --git a/clients/aws-sdk-qbusiness/tests/integration/conftest.py b/clients/aws-sdk-qbusiness/tests/integration/conftest.py new file mode 100644 index 0000000..62054c5 --- /dev/null +++ b/clients/aws-sdk-qbusiness/tests/integration/conftest.py @@ -0,0 +1,156 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Pytest fixtures for Q Business integration tests. + +Creates and tears down a Q Business application, an index, +and a retriever once per test session. All integration tests +receive the application_id via the ``qbusiness_app`` fixture. +""" + +import uuid + +import boto3 +import pytest +from botocore.waiter import WaiterModel, create_waiter_with_client + +from . import REGION + +_UNIQUE_SUFFIX = uuid.uuid4().hex +APP_NAME = f"smithy-python-integ-test-{_UNIQUE_SUFFIX}" +INDEX_NAME = "integ-test-index" +RETRIEVER_NAME = "integ-test-retriever" + +# Custom waiter configs for Q Business resources. +# Q Business does not provide built-in boto3 waiters. +_WAITER_CONFIG = { + "version": 2, + "waiters": { + "ApplicationActive": { + "operation": "GetApplication", + "delay": 10, + "maxAttempts": 30, + "acceptors": [ + { + "matcher": "path", + "expected": "ACTIVE", + "argument": "status", + "state": "success", + }, + { + "matcher": "path", + "expected": "FAILED", + "argument": "status", + "state": "failure", + }, + { + "matcher": "path", + "expected": "DELETING", + "argument": "status", + "state": "failure", + }, + ], + }, + "IndexActive": { + "operation": "GetIndex", + "delay": 10, + "maxAttempts": 30, + "acceptors": [ + { + "matcher": "path", + "expected": "ACTIVE", + "argument": "status", + "state": "success", + }, + { + "matcher": "path", + "expected": "FAILED", + "argument": "status", + "state": "failure", + }, + { + "matcher": "path", + "expected": "DELETING", + "argument": "status", + "state": "failure", + }, + ], + }, + "RetrieverActive": { + "operation": "GetRetriever", + "delay": 10, + "maxAttempts": 30, + "acceptors": [ + { + "matcher": "path", + "expected": "ACTIVE", + "argument": "status", + "state": "success", + }, + { + "matcher": "path", + "expected": "FAILED", + "argument": "status", + "state": "failure", + }, + ], + }, + }, +} + +_waiter_model = WaiterModel(_WAITER_CONFIG) + + +def _create_qbusiness_app() -> str: + """Create a Q Business application with index and retriever. + + Returns: + The application ID. + """ + qbusiness = boto3.client("qbusiness", region_name=REGION) + + # Create application + resp = qbusiness.create_application(displayName=APP_NAME, identityType="ANONYMOUS") + app_id = resp["applicationId"] + create_waiter_with_client("ApplicationActive", _waiter_model, qbusiness).wait( + applicationId=app_id + ) + + # Create index + resp = qbusiness.create_index(applicationId=app_id, displayName=INDEX_NAME) + index_id = resp["indexId"] + create_waiter_with_client("IndexActive", _waiter_model, qbusiness).wait( + applicationId=app_id, indexId=index_id + ) + + # Create retriever + resp = qbusiness.create_retriever( + applicationId=app_id, + displayName=RETRIEVER_NAME, + type="NATIVE_INDEX", + configuration={"nativeIndexConfiguration": {"indexId": index_id}}, + ) + retriever_id = resp["retrieverId"] + create_waiter_with_client("RetrieverActive", _waiter_model, qbusiness).wait( + applicationId=app_id, retrieverId=retriever_id + ) + + return app_id + + +def _delete_qbusiness_app(app_id: str) -> None: + """Delete a Q Business application. + + Args: + app_id: The application ID to delete. + """ + qbusiness = boto3.client("qbusiness", region_name=REGION) + qbusiness.delete_application(applicationId=app_id) + + +@pytest.fixture(scope="session") +def qbusiness_app(): + """Create a Q Business application for the test session and delete it after.""" + app_id = _create_qbusiness_app() + yield app_id + _delete_qbusiness_app(app_id) diff --git a/clients/aws-sdk-qbusiness/tests/integration/test_bidirectional_streaming.py b/clients/aws-sdk-qbusiness/tests/integration/test_bidirectional_streaming.py new file mode 100644 index 0000000..fdc9b82 --- /dev/null +++ b/clients/aws-sdk-qbusiness/tests/integration/test_bidirectional_streaming.py @@ -0,0 +1,111 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Test bidirectional event stream handling for the Chat API.""" + +import asyncio +import uuid + +from smithy_core.aio.eventstream import DuplexEventStream + +from aws_sdk_qbusiness.models import ( + ChatInput, + ChatInputStream, + ChatInputStreamConfigurationEvent, + ChatInputStreamEndOfInputEvent, + ChatInputStreamTextEvent, + ChatOutput, + ChatOutputStream, + ChatOutputStreamMetadataEvent, + ChatOutputStreamTextEvent, + ChatOutputStreamUnknown, + ConfigurationEvent, + EndOfInputEvent, + TextInputEvent, +) + +from . import REGION, create_qbusiness_client + + +async def _send_chat_events( + stream: DuplexEventStream[ChatInputStream, ChatOutputStream, ChatOutput], +) -> None: + """Send chat input events: configuration, text message, end of input.""" + await stream.input_stream.send( + ChatInputStreamConfigurationEvent( + value=ConfigurationEvent(chat_mode="RETRIEVAL_MODE") + ) + ) + + await stream.input_stream.send( + ChatInputStreamTextEvent(value=TextInputEvent(user_message="Hello")) + ) + + await stream.input_stream.send( + ChatInputStreamEndOfInputEvent(value=EndOfInputEvent()) + ) + + await asyncio.sleep(1) + await stream.input_stream.close() + + +async def _receive_chat_output( + stream: DuplexEventStream[ChatInputStream, ChatOutputStream, ChatOutput], +) -> tuple[bool, bool]: + """Receive and validate chat output from the stream. + + Returns: + Tuple of (got_text_events, got_metadata_event) + """ + got_text_events = False + got_metadata_event = False + + _, output_stream = await stream.await_output() + if output_stream is None: + return got_text_events, got_metadata_event + + async for event in output_stream: + if isinstance(event, ChatOutputStreamTextEvent): + got_text_events = True + assert event.value.system_message_type is not None + assert event.value.system_message_type == "RESPONSE" + assert event.value.conversation_id is not None + assert event.value.user_message_id is not None + assert event.value.system_message_id is not None + assert event.value.system_message is not None + assert isinstance(event.value.system_message, str) + assert len(event.value.system_message) > 0 + elif isinstance(event, ChatOutputStreamMetadataEvent): + got_metadata_event = True + assert event.value.conversation_id is not None + assert event.value.user_message_id is not None + assert event.value.system_message_id is not None + assert event.value.source_attributions is not None + assert event.value.final_text_message is not None + assert isinstance(event.value.final_text_message, str) + assert len(event.value.final_text_message) > 0 + elif isinstance(event, ChatOutputStreamUnknown): + pass + else: + raise RuntimeError( + f"Received unexpected event type in stream: {type(event).__name__}" + ) + + return got_text_events, got_metadata_event + + +async def test_chat_bidirectional_streaming(qbusiness_app: str) -> None: + """Test bidirectional streaming with text input and chat output.""" + qbusiness_client = create_qbusiness_client(REGION) + + stream = await qbusiness_client.chat( + input=ChatInput(application_id=qbusiness_app, client_token=str(uuid.uuid4())) + ) + + results = await asyncio.gather( + _send_chat_events(stream), _receive_chat_output(stream) + ) + got_text_events, got_metadata_event = results[1] + + assert got_text_events, "Expected to receive text output events" + assert got_metadata_event, "Expected to receive a metadata event" diff --git a/clients/aws-sdk-qbusiness/tests/integration/test_non_streaming.py b/clients/aws-sdk-qbusiness/tests/integration/test_non_streaming.py new file mode 100644 index 0000000..3fb429b --- /dev/null +++ b/clients/aws-sdk-qbusiness/tests/integration/test_non_streaming.py @@ -0,0 +1,33 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Test non-streaming output type handling.""" + +import uuid + +from aws_sdk_qbusiness.models import ChatSyncInput, ChatSyncOutput + +from . import REGION, create_qbusiness_client + + +async def test_chat_sync(qbusiness_app: str) -> None: + """Test non-streaming ChatSync operation.""" + qbusiness_client = create_qbusiness_client(REGION) + + response = await qbusiness_client.chat_sync( + input=ChatSyncInput( + application_id=qbusiness_app, + user_message="Hello", + client_token=str(uuid.uuid4()), + ) + ) + + assert isinstance(response, ChatSyncOutput) + assert response.conversation_id is not None + assert response.system_message is not None + assert isinstance(response.system_message, str) + assert len(response.system_message) > 0 + assert response.system_message_id is not None + assert response.user_message_id is not None + assert response.source_attributions is not None + assert response.failed_attachments is not None diff --git a/clients/aws-sdk-qbusiness/tests/test_protocol.py b/clients/aws-sdk-qbusiness/tests/test_protocol.py new file mode 100644 index 0000000..46653fe --- /dev/null +++ b/clients/aws-sdk-qbusiness/tests/test_protocol.py @@ -0,0 +1,67 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from smithy_core.aio.utils import async_list +from smithy_http import tuples_to_fields +from smithy_http.aio import HTTPResponse as _smithy_http_aio_HTTPResponse +from smithy_http.aio.interfaces import ( + HTTPRequest, + HTTPResponse as _smithy_http_aio_interfaces_HTTPResponse, +) +from smithy_http.interfaces import HTTPClientConfiguration, HTTPRequestConfiguration + +from aws_sdk_qbusiness.models import ServiceError + + +class TestHttpServiceError(ServiceError): + """A test error that subclasses the service-error for protocol tests.""" + + def __init__(self, request: HTTPRequest): + self.request = request + + +class RequestTestHTTPClient: + """An asynchronous HTTP client solely for testing purposes.""" + + TIMEOUT_EXCEPTIONS = () + + def __init__(self, *, client_config: HTTPClientConfiguration | None = None): + self._client_config = client_config + + async def send( + self, + request: HTTPRequest, + *, + request_config: HTTPRequestConfiguration | None = None, + ) -> _smithy_http_aio_interfaces_HTTPResponse: + # Raise the exception with the request object to bypass actual request handling + raise TestHttpServiceError(request) + + +class ResponseTestHTTPClient: + """An asynchronous HTTP client solely for testing purposes.""" + + TIMEOUT_EXCEPTIONS = () + + def __init__( + self, + *, + client_config: HTTPClientConfiguration | None = None, + status: int = 200, + headers: list[tuple[str, str]] | None = None, + body: bytes = b"", + ): + self._client_config = client_config + self.status = status + self.fields = tuples_to_fields(headers or []) + self.body = body + + async def send( + self, + request: HTTPRequest, + *, + request_config: HTTPRequestConfiguration | None = None, + ) -> _smithy_http_aio_HTTPResponse: + # Pre-construct the response from the request and return it + return _smithy_http_aio_HTTPResponse( + status=self.status, fields=self.fields, body=async_list([self.body]) + ) diff --git a/codegen/aws-models/qbusiness.json b/codegen/aws-models/qbusiness.json new file mode 100644 index 0000000..d10839f --- /dev/null +++ b/codegen/aws-models/qbusiness.json @@ -0,0 +1,16894 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.qbusiness#APISchema": { + "type": "union", + "members": { + "payload": { + "target": "com.amazonaws.qbusiness#Payload", + "traits": { + "smithy.api#documentation": "
The JSON or YAML-formatted payload defining the OpenAPI schema for a custom plugin.
" + } + }, + "s3": { + "target": "com.amazonaws.qbusiness#S3", + "traits": { + "smithy.api#documentation": "Contains details about the S3 object containing the OpenAPI schema for a custom plugin. The schema could be in either JSON or YAML format.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Contains details about the OpenAPI schema for a custom plugin. For more information, see custom plugin OpenAPI schemas. You can either include the schema directly in the payload field or you can upload it to an S3 bucket and specify the S3 bucket location in the s3 field.
A list of AccessControlList objects.
Describes the member relation within the AccessControlList object.
Used to configure access permissions for a document.
" + } + }, + "com.amazonaws.qbusiness#AccessControl": { + "type": "structure", + "members": { + "principals": { + "target": "com.amazonaws.qbusiness#Principals", + "traits": { + "smithy.api#documentation": "Contains a list of principals, where a principal can be either a USER or a GROUP. Each principal can be have the following type of document access: ALLOW or DENY.
Describes the member relation within a principal list.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A list of principals. Each principal can be either a USER or a GROUP and can be designated document access permissions of either ALLOW or DENY.
You don't have access to perform this action. Make sure you have the required permission policies and user accounts and try again.
", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.qbusiness#ActionConfiguration": { + "type": "structure", + "members": { + "action": { + "target": "com.amazonaws.qbusiness#QIamAction", + "traits": { + "smithy.api#documentation": "The Amazon Q Business action that is allowed.
", + "smithy.api#required": {} + } + }, + "filterConfiguration": { + "target": "com.amazonaws.qbusiness#ActionFilterConfiguration", + "traits": { + "smithy.api#documentation": "The filter configuration for the action, if any.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Specifies an allowed action and its associated filter configuration.
" + } + }, + "com.amazonaws.qbusiness#ActionConfigurationList": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#ActionConfiguration" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#ActionExecution": { + "type": "structure", + "members": { + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the plugin the action is attached to.
", + "smithy.api#required": {} + } + }, + "payload": { + "target": "com.amazonaws.qbusiness#ActionExecutionPayload", + "traits": { + "smithy.api#documentation": "A mapping of field names to the field values in input that an end user provides to Amazon Q Business requests to perform their plugin action.
", + "smithy.api#required": {} + } + }, + "payloadFieldNameSeparator": { + "target": "com.amazonaws.qbusiness#ActionPayloadFieldNameSeparator", + "traits": { + "smithy.api#documentation": "A string used to retain information about the hierarchical contexts within an action execution event payload.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Performs an Amazon Q Business plugin action during a non-streaming chat conversation.
" + } + }, + "com.amazonaws.qbusiness#ActionExecutionEvent": { + "type": "structure", + "members": { + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the plugin for which the action is being requested.
", + "smithy.api#required": {} + } + }, + "payload": { + "target": "com.amazonaws.qbusiness#ActionExecutionPayload", + "traits": { + "smithy.api#documentation": "A mapping of field names to the field values in input that an end user provides to Amazon Q Business requests to perform their plugin action.
", + "smithy.api#required": {} + } + }, + "payloadFieldNameSeparator": { + "target": "com.amazonaws.qbusiness#ActionPayloadFieldNameSeparator", + "traits": { + "smithy.api#documentation": "A string used to retain information about the hierarchical contexts within a action execution event payload.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A request from an end user signalling an intent to perform an Amazon Q Business plugin action during a streaming chat.
" + } + }, + "com.amazonaws.qbusiness#ActionExecutionPayload": { + "type": "map", + "key": { + "target": "com.amazonaws.qbusiness#ActionPayloadFieldKey" + }, + "value": { + "target": "com.amazonaws.qbusiness#ActionExecutionPayloadField" + } + }, + "com.amazonaws.qbusiness#ActionExecutionPayloadField": { + "type": "structure", + "members": { + "value": { + "target": "com.amazonaws.qbusiness#ActionPayloadFieldValue", + "traits": { + "smithy.api#documentation": "The content of a user input field in an plugin action execution payload.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A user input field in an plugin action execution payload.
" + } + }, + "com.amazonaws.qbusiness#ActionFilterConfiguration": { + "type": "structure", + "members": { + "documentAttributeFilter": { + "target": "com.amazonaws.qbusiness#AttributeFilter", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Specifies filters to apply to an allowed action.
" + } + }, + "com.amazonaws.qbusiness#ActionPayloadFieldKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1 + } + } + }, + "com.amazonaws.qbusiness#ActionPayloadFieldNameSeparator": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, + "com.amazonaws.qbusiness#ActionPayloadFieldType": { + "type": "enum", + "members": { + "STRING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STRING" + } + }, + "NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NUMBER" + } + }, + "ARRAY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ARRAY" + } + }, + "BOOLEAN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BOOLEAN" + } + } + } + }, + "com.amazonaws.qbusiness#ActionPayloadFieldValue": { + "type": "document" + }, + "com.amazonaws.qbusiness#ActionReview": { + "type": "structure", + "members": { + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the plugin associated with the action review.
" + } + }, + "pluginType": { + "target": "com.amazonaws.qbusiness#PluginType", + "traits": { + "smithy.api#documentation": "The type of plugin.
" + } + }, + "payload": { + "target": "com.amazonaws.qbusiness#ActionReviewPayload", + "traits": { + "smithy.api#documentation": "Field values that an end user needs to provide to Amazon Q Business for Amazon Q Business to perform the requested plugin action.
" + } + }, + "payloadFieldNameSeparator": { + "target": "com.amazonaws.qbusiness#ActionPayloadFieldNameSeparator", + "traits": { + "smithy.api#documentation": "A string used to retain information about the hierarchical contexts within an action review payload.
" + } + } + }, + "traits": { + "smithy.api#documentation": "An output event that Amazon Q Business returns to an user who wants to perform a plugin action during a non-streaming chat conversation. It contains information about the selected action with a list of possible user input fields, some pre-populated by Amazon Q Business.
" + } + }, + "com.amazonaws.qbusiness#ActionReviewEvent": { + "type": "structure", + "members": { + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the conversation with which the action review event is associated.
" + } + }, + "userMessageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier of the conversation with which the plugin action is associated.
" + } + }, + "systemMessageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier of an Amazon Q Business AI generated associated with the action review event.
" + } + }, + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the plugin associated with the action review event.
" + } + }, + "pluginType": { + "target": "com.amazonaws.qbusiness#PluginType", + "traits": { + "smithy.api#documentation": "The type of plugin.
" + } + }, + "payload": { + "target": "com.amazonaws.qbusiness#ActionReviewPayload", + "traits": { + "smithy.api#documentation": "Field values that an end user needs to provide to Amazon Q Business for Amazon Q Business to perform the requested plugin action.
" + } + }, + "payloadFieldNameSeparator": { + "target": "com.amazonaws.qbusiness#ActionPayloadFieldNameSeparator", + "traits": { + "smithy.api#documentation": "A string used to retain information about the hierarchical contexts within an action review event payload.
" + } + } + }, + "traits": { + "smithy.api#documentation": "An output event that Amazon Q Business returns to an user who wants to perform a plugin action during a streaming chat conversation. It contains information about the selected action with a list of possible user input fields, some pre-populated by Amazon Q Business.
" + } + }, + "com.amazonaws.qbusiness#ActionReviewPayload": { + "type": "map", + "key": { + "target": "com.amazonaws.qbusiness#ActionPayloadFieldKey" + }, + "value": { + "target": "com.amazonaws.qbusiness#ActionReviewPayloadField" + } + }, + "com.amazonaws.qbusiness#ActionReviewPayloadField": { + "type": "structure", + "members": { + "displayName": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The name of the field.
" + } + }, + "displayOrder": { + "target": "com.amazonaws.qbusiness#Integer", + "traits": { + "smithy.api#documentation": "The display order of fields in a payload.
" + } + }, + "displayDescription": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The field level description of each action review input field. This could be an explanation of the field. In the Amazon Q Business web experience, these descriptions could be used to display as tool tips to help users understand the field.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#ActionPayloadFieldType", + "traits": { + "smithy.api#documentation": "The type of field.
" + } + }, + "value": { + "target": "com.amazonaws.qbusiness#ActionPayloadFieldValue", + "traits": { + "smithy.api#documentation": "The field value.
" + } + }, + "allowedValues": { + "target": "com.amazonaws.qbusiness#ActionReviewPayloadFieldAllowedValues", + "traits": { + "smithy.api#documentation": "Information about the field values that an end user can use to provide to Amazon Q Business for Amazon Q Business to perform the requested plugin action.
" + } + }, + "allowedFormat": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The expected data format for the action review input field value. For example, in PTO request, from and to would be of datetime allowed format.
Use to create a custom form with array fields (fields with nested objects inside an array).
" + } + }, + "required": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Information about whether the field is required.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A user input field in an plugin action review payload.
" + } + }, + "com.amazonaws.qbusiness#ActionReviewPayloadFieldAllowedValue": { + "type": "structure", + "members": { + "value": { + "target": "com.amazonaws.qbusiness#ActionPayloadFieldValue", + "traits": { + "smithy.api#documentation": "The field value.
" + } + }, + "displayValue": { + "target": "com.amazonaws.qbusiness#ActionPayloadFieldValue", + "traits": { + "smithy.api#documentation": "The name of the field.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Information about the field values that an end user can use to provide to Amazon Q Business for Amazon Q Business to perform the requested plugin action.
" + } + }, + "com.amazonaws.qbusiness#ActionReviewPayloadFieldAllowedValues": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#ActionReviewPayloadFieldAllowedValue" + } + }, + "com.amazonaws.qbusiness#ActionReviewPayloadFieldArrayItemJsonSchema": { + "type": "document" + }, + "com.amazonaws.qbusiness#ActionSummary": { + "type": "structure", + "members": { + "actionIdentifier": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The identifier of an Amazon Q Business plugin action.
" + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The display name assigned by Amazon Q Business to a plugin action. You can't modify this value.
" + } + }, + "instructionExample": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "An Amazon Q Business suggested prompt and end user can use to invoke a plugin action. This value can be modified and sent as input to initiate an action. For example:
Create a Jira task
Create a chat assistant task to find the root cause of a specific incident
The description of an Amazon Q Business plugin action.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Summary information for an Amazon Q Business plugin action.
" + } + }, + "com.amazonaws.qbusiness#Actions": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#ActionSummary" + } + }, + "com.amazonaws.qbusiness#AmazonResourceName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1011 + } + } + }, + "com.amazonaws.qbusiness#Application": { + "type": "structure", + "members": { + "displayName": { + "target": "com.amazonaws.qbusiness#ApplicationName", + "traits": { + "smithy.api#documentation": "The name of the Amazon Q Business application.
" + } + }, + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier for the Amazon Q Business application.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business application was created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business application was last updated.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#ApplicationStatus", + "traits": { + "smithy.api#documentation": "The status of the Amazon Q Business application. The application is ready to use when the status is ACTIVE.
The authentication type being used by a Amazon Q Business application.
" + } + }, + "quickSightConfiguration": { + "target": "com.amazonaws.qbusiness#QuickSightConfiguration", + "traits": { + "smithy.api#documentation": "The Amazon Quick Suite configuration for an Amazon Q Business application that uses Quick Suite as the identity provider.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Summary information for an Amazon Q Business application.
" + } + }, + "com.amazonaws.qbusiness#ApplicationArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$" + } + }, + "com.amazonaws.qbusiness#ApplicationId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#ApplicationName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1000 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + } + }, + "com.amazonaws.qbusiness#ApplicationResource": { + "type": "resource", + "identifiers": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId" + } + }, + "create": { + "target": "com.amazonaws.qbusiness#CreateApplication" + }, + "read": { + "target": "com.amazonaws.qbusiness#GetApplication" + }, + "update": { + "target": "com.amazonaws.qbusiness#UpdateApplication" + }, + "delete": { + "target": "com.amazonaws.qbusiness#DeleteApplication" + }, + "list": { + "target": "com.amazonaws.qbusiness#ListApplications" + }, + "resources": [ + { + "target": "com.amazonaws.qbusiness#DataAccessorResource" + }, + { + "target": "com.amazonaws.qbusiness#IndexResource" + }, + { + "target": "com.amazonaws.qbusiness#IntegrationResource" + }, + { + "target": "com.amazonaws.qbusiness#PluginResource" + }, + { + "target": "com.amazonaws.qbusiness#RetrieverResource" + }, + { + "target": "com.amazonaws.qbusiness#WebExperienceResource" + } + ], + "traits": { + "aws.cloudformation#cfnResource": { + "name": "Application" + } + } + }, + "com.amazonaws.qbusiness#ApplicationStatus": { + "type": "enum", + "members": { + "CREATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATING" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "UPDATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPDATING" + } + } + } + }, + "com.amazonaws.qbusiness#Applications": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Application" + } + }, + "com.amazonaws.qbusiness#AppliedAttachmentsConfiguration": { + "type": "structure", + "members": { + "attachmentsControlMode": { + "target": "com.amazonaws.qbusiness#AttachmentsControlMode", + "traits": { + "smithy.api#documentation": "Information about whether file upload during chat functionality is activated for your application.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration information about the file upload during chat feature for your application.
" + } + }, + "com.amazonaws.qbusiness#AppliedCreatorModeConfiguration": { + "type": "structure", + "members": { + "creatorModeControl": { + "target": "com.amazonaws.qbusiness#CreatorModeControl", + "traits": { + "smithy.api#documentation": "Information about whether creator mode is enabled or disabled for an Amazon Q Business application.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The creator mode specific admin controls configured for an Amazon Q Business application. Determines whether an end user can generate LLM-only responses when they use the web experience.
For more information, see Admin controls and guardrails and Conversation settings.
" + } + }, + "com.amazonaws.qbusiness#AppliedOrchestrationConfiguration": { + "type": "structure", + "members": { + "control": { + "target": "com.amazonaws.qbusiness#OrchestrationControl", + "traits": { + "smithy.api#documentation": "Information about whether chat orchestration is enabled or disabled for an Amazon Q Business application.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The chat orchestration specific admin controls configured for an Amazon Q Business application. Determines whether Amazon Q Business automatically routes chat requests across configured plugins and data sources in your Amazon Q Business application.
For more information, see Chat orchestration settings.
" + } + }, + "com.amazonaws.qbusiness#AssociatePermission": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#AssociatePermissionRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#AssociatePermissionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Adds or updates a permission policy for a Amazon Q Business application, allowing cross-account access for an ISV. This operation creates a new policy statement for the specified Amazon Q Business application. The policy statement defines the IAM actions that the ISV is allowed to perform on the Amazon Q Business application's resources.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/policy", + "method": "POST" + } + } + }, + "com.amazonaws.qbusiness#AssociatePermissionRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "statementId": { + "target": "com.amazonaws.qbusiness#StatementId", + "traits": { + "smithy.api#documentation": "A unique identifier for the policy statement.
", + "smithy.api#required": {} + } + }, + "actions": { + "target": "com.amazonaws.qbusiness#QIamActions", + "traits": { + "smithy.api#documentation": "The list of Amazon Q Business actions that the ISV is allowed to perform.
", + "smithy.api#required": {} + } + }, + "conditions": { + "target": "com.amazonaws.qbusiness#PermissionConditions", + "traits": { + "smithy.api#documentation": "The conditions that restrict when the permission is effective. These conditions can be used to limit the permission based on specific attributes of the request.
" + } + }, + "principal": { + "target": "com.amazonaws.qbusiness#PrincipalRoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name of the IAM role for the ISV that is being granted permission.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#AssociatePermissionResponse": { + "type": "structure", + "members": { + "statement": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The JSON representation of the added permission statement.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#AssociatedGroup": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.qbusiness#GroupName", + "traits": { + "smithy.api#documentation": "The name of the group associated with the user. This is used to identify the group in access control decisions.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#MembershipType", + "traits": { + "smithy.api#documentation": "The type of the associated group. This indicates the scope of the group's applicability.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Represents a group associated with a given user in the access control system.
" + } + }, + "com.amazonaws.qbusiness#AssociatedGroups": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#AssociatedGroup" + } + }, + "com.amazonaws.qbusiness#AssociatedUser": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The unique identifier of the associated user. This is used to identify the user in access control decisions.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#MembershipType", + "traits": { + "smithy.api#documentation": "The type of the associated user. This indicates the scope of the user's association.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Represents an associated user in the access control system.
" + } + }, + "com.amazonaws.qbusiness#AssociatedUsers": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#AssociatedUser" + } + }, + "com.amazonaws.qbusiness#Attachment": { + "type": "structure", + "members": { + "attachmentId": { + "target": "com.amazonaws.qbusiness#AttachmentId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business attachment.
" + } + }, + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business conversation the attachment is associated with.
" + } + }, + "name": { + "target": "com.amazonaws.qbusiness#AttachmentName", + "traits": { + "smithy.api#documentation": "Filename of the Amazon Q Business attachment.
" + } + }, + "copyFrom": { + "target": "com.amazonaws.qbusiness#CopyFromSource", + "traits": { + "smithy.api#documentation": "A CopyFromSource containing a reference to the original source of the Amazon Q Business attachment.
" + } + }, + "fileType": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "Filetype of the Amazon Q Business attachment.
" + } + }, + "fileSize": { + "target": "com.amazonaws.qbusiness#Integer", + "traits": { + "smithy.api#documentation": "Size in bytes of the Amazon Q Business attachment.
" + } + }, + "md5chksum": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "MD5 checksum of the Amazon Q Business attachment contents.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business attachment was created.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#AttachmentStatus", + "traits": { + "smithy.api#documentation": "AttachmentStatus of the Amazon Q Business attachment.
" + } + }, + "error": { + "target": "com.amazonaws.qbusiness#ErrorDetail", + "traits": { + "smithy.api#documentation": "ErrorDetail providing information about a Amazon Q Business attachment error.
" + } + } + }, + "traits": { + "smithy.api#documentation": "An attachment in an Amazon Q Business conversation.
" + } + }, + "com.amazonaws.qbusiness#AttachmentId": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" + } + }, + "com.amazonaws.qbusiness#AttachmentInput": { + "type": "structure", + "members": { + "data": { + "target": "com.amazonaws.qbusiness#Blob", + "traits": { + "smithy.api#documentation": "The contents of the attachment.
" + } + }, + "name": { + "target": "com.amazonaws.qbusiness#AttachmentName", + "traits": { + "smithy.api#documentation": "The filename of the attachment.
" + } + }, + "copyFrom": { + "target": "com.amazonaws.qbusiness#CopyFromSource", + "traits": { + "smithy.api#documentation": "A reference to an existing attachment.
" + } + } + }, + "traits": { + "smithy.api#documentation": "This is either a file directly uploaded into a web experience chat or a reference to an existing attachment that is part of a web experience chat.
" + } + }, + "com.amazonaws.qbusiness#AttachmentInputEvent": { + "type": "structure", + "members": { + "attachment": { + "target": "com.amazonaws.qbusiness#AttachmentInput" + } + }, + "traits": { + "smithy.api#documentation": "A file input event activated by a end user request to upload files into their web experience chat.
" + } + }, + "com.amazonaws.qbusiness#AttachmentList": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Attachment" + } + }, + "com.amazonaws.qbusiness#AttachmentName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1000 + }, + "smithy.api#pattern": "^\\P{C}*$" + } + }, + "com.amazonaws.qbusiness#AttachmentOutput": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.qbusiness#AttachmentName", + "traits": { + "smithy.api#documentation": "The name of a file uploaded during chat.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#AttachmentStatus", + "traits": { + "smithy.api#documentation": "The status of a file uploaded during chat.
" + } + }, + "error": { + "target": "com.amazonaws.qbusiness#ErrorDetail", + "traits": { + "smithy.api#documentation": "An error associated with a file uploaded during chat.
" + } + }, + "attachmentId": { + "target": "com.amazonaws.qbusiness#AttachmentId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business attachment.
" + } + }, + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business conversation.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The details of a file uploaded during chat.
" + } + }, + "com.amazonaws.qbusiness#AttachmentStatus": { + "type": "enum", + "members": { + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "SUCCESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SUCCESS" + } + } + } + }, + "com.amazonaws.qbusiness#AttachmentsConfiguration": { + "type": "structure", + "members": { + "attachmentsControlMode": { + "target": "com.amazonaws.qbusiness#AttachmentsControlMode", + "traits": { + "smithy.api#documentation": "Status information about whether file upload functionality is activated or deactivated for your end user.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration information for the file upload during chat feature.
" + } + }, + "com.amazonaws.qbusiness#AttachmentsControlMode": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.qbusiness#AttachmentsInput": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#AttachmentInput" + }, + "traits": { + "smithy.api#length": { + "min": 1 + } + } + }, + "com.amazonaws.qbusiness#AttachmentsOutput": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#AttachmentOutput" + } + }, + "com.amazonaws.qbusiness#AttributeFilter": { + "type": "structure", + "members": { + "andAllFilters": { + "target": "com.amazonaws.qbusiness#AttributeFilters", + "traits": { + "smithy.api#documentation": "Performs a logical AND operation on all supplied filters.
Performs a logical OR operation on all supplied filters.
Performs a logical NOT operation on all supplied filters.
Performs an equals operation on two document attributes or metadata fields. Supported for the following document attribute value types: dateValue, longValue, stringListValue and stringValue.
Returns true when a document contains all the specified document attributes or metadata fields. Supported for the following document attribute value types: stringListValue.
Returns true when a document contains any of the specified document attributes or metadata fields. Supported for the following document attribute value types: stringListValue.
Performs a greater than operation on two document attributes or metadata fields. Supported for the following document attribute value types: dateValue and longValue.
Performs a greater or equals than operation on two document attributes or metadata fields. Supported for the following document attribute value types: dateValue and longValue.
Performs a less than operation on two document attributes or metadata fields. Supported for the following document attribute value types: dateValue and longValue.
Performs a less than or equals operation on two document attributes or metadata fields.Supported for the following document attribute value type: dateValue and longValue.
Enables filtering of responses based on document attributes or metadata fields.
" + } + }, + "com.amazonaws.qbusiness#AttributeFilters": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#AttributeFilter" + } + }, + "com.amazonaws.qbusiness#AttributeType": { + "type": "enum", + "members": { + "STRING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STRING" + } + }, + "STRING_LIST": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STRING_LIST" + } + }, + "NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NUMBER" + } + }, + "DATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATE" + } + } + } + }, + "com.amazonaws.qbusiness#AttributeValueOperator": { + "type": "enum", + "members": { + "DELETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETE" + } + } + } + }, + "com.amazonaws.qbusiness#AudioExtractionConfiguration": { + "type": "structure", + "members": { + "audioExtractionStatus": { + "target": "com.amazonaws.qbusiness#AudioExtractionStatus", + "traits": { + "smithy.api#documentation": "The status of audio extraction (ENABLED or DISABLED) for processing audio content from files.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration settings for audio content extraction and processing.
" + } + }, + "com.amazonaws.qbusiness#AudioExtractionStatus": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.qbusiness#AudioExtractionType": { + "type": "enum", + "members": { + "TRANSCRIPT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TRANSCRIPT" + } + }, + "SUMMARY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SUMMARY" + } + } + } + }, + "com.amazonaws.qbusiness#AudioSourceDetails": { + "type": "structure", + "members": { + "mediaId": { + "target": "com.amazonaws.qbusiness#MediaId", + "traits": { + "smithy.api#documentation": "Unique identifier for the audio media file.
" + } + }, + "mediaMimeType": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The MIME type of the audio file (e.g., audio/mp3, audio/wav).
" + } + }, + "startTimeMilliseconds": { + "target": "com.amazonaws.qbusiness#Long", + "traits": { + "smithy.api#documentation": "The starting timestamp in milliseconds for the relevant audio segment.
" + } + }, + "endTimeMilliseconds": { + "target": "com.amazonaws.qbusiness#Long", + "traits": { + "smithy.api#documentation": "The ending timestamp in milliseconds for the relevant audio segment.
" + } + }, + "audioExtractionType": { + "target": "com.amazonaws.qbusiness#AudioExtractionType", + "traits": { + "smithy.api#documentation": "The type of audio extraction performed on the content.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Details about an audio source, including its identifier, format, and time information.
" + } + }, + "com.amazonaws.qbusiness#AuthChallengeRequest": { + "type": "structure", + "members": { + "authorizationUrl": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The URL sent by Amazon Q Business to the third party authentication server to authenticate a custom plugin user through an OAuth protocol.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A request made by Amazon Q Business to a third paty authentication server to authenticate a custom plugin user.
" + } + }, + "com.amazonaws.qbusiness#AuthChallengeRequestEvent": { + "type": "structure", + "members": { + "authorizationUrl": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The URL sent by Amazon Q Business to a third party authentication server in response to an authentication verification event activated by an end user request to use a custom plugin.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An authentication verification event activated by an end user request to use a custom plugin.
" + } + }, + "com.amazonaws.qbusiness#AuthChallengeResponse": { + "type": "structure", + "members": { + "responseMap": { + "target": "com.amazonaws.qbusiness#AuthorizationResponseMap", + "traits": { + "smithy.api#documentation": "The mapping of key-value pairs in an authentication challenge response.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Contains details of the authentication information received from a third party authentication server in response to an authentication challenge.
" + } + }, + "com.amazonaws.qbusiness#AuthChallengeResponseEvent": { + "type": "structure", + "members": { + "responseMap": { + "target": "com.amazonaws.qbusiness#AuthorizationResponseMap", + "traits": { + "smithy.api#documentation": "The mapping of key-value pairs in an authentication challenge response.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An authentication verification event response by a third party authentication server to Amazon Q Business.
" + } + }, + "com.amazonaws.qbusiness#AuthResponseKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#AuthResponseValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + } + } + }, + "com.amazonaws.qbusiness#AuthorizationResponseMap": { + "type": "map", + "key": { + "target": "com.amazonaws.qbusiness#AuthResponseKey" + }, + "value": { + "target": "com.amazonaws.qbusiness#AuthResponseValue" + } + }, + "com.amazonaws.qbusiness#AutoSubscriptionConfiguration": { + "type": "structure", + "members": { + "autoSubscribe": { + "target": "com.amazonaws.qbusiness#AutoSubscriptionStatus", + "traits": { + "smithy.api#documentation": "Describes whether automatic subscriptions are enabled for an Amazon Q Business application using IAM identity federation for user management.
", + "smithy.api#required": {} + } + }, + "defaultSubscriptionType": { + "target": "com.amazonaws.qbusiness#SubscriptionType", + "traits": { + "smithy.api#documentation": "Describes the default subscription type assigned to an Amazon Q Business application using IAM identity federation for user management. If the value for autoSubscribe is set to ENABLED you must select a value for this field.
Subscription configuration information for an Amazon Q Business application using IAM identity federation for user management.
" + } + }, + "com.amazonaws.qbusiness#AutoSubscriptionStatus": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.qbusiness#BasicAuthConfiguration": { + "type": "structure", + "members": { + "secretArn": { + "target": "com.amazonaws.qbusiness#SecretArn", + "traits": { + "smithy.api#documentation": "The ARN of the Secrets Manager secret that stores the basic authentication credentials used for plugin configuration..
", + "smithy.api#required": {} + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The ARN of an IAM role used by Amazon Q Business to access the basic authentication credentials stored in a Secrets Manager secret.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Information about the basic authentication credentials used to configure a plugin.
" + } + }, + "com.amazonaws.qbusiness#BatchDeleteDocument": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#BatchDeleteDocumentRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#BatchDeleteDocumentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Asynchronously deletes one or more documents added using the BatchPutDocument API from an Amazon Q Business index.
You can see the progress of the deletion, and any error messages related to the process, by using CloudWatch.
", + "smithy.api#http": { + "method": "POST", + "uri": "/applications/{applicationId}/indices/{indexId}/documents/delete" + } + } + }, + "com.amazonaws.qbusiness#BatchDeleteDocumentRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business index that contains the documents to delete.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "documents": { + "target": "com.amazonaws.qbusiness#DeleteDocuments", + "traits": { + "smithy.api#documentation": "Documents deleted from the Amazon Q Business index.
", + "smithy.api#required": {} + } + }, + "dataSourceSyncId": { + "target": "com.amazonaws.qbusiness#ExecutionId", + "traits": { + "smithy.api#documentation": "The identifier of the data source sync during which the documents were deleted.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#BatchDeleteDocumentResponse": { + "type": "structure", + "members": { + "failedDocuments": { + "target": "com.amazonaws.qbusiness#FailedDocuments", + "traits": { + "smithy.api#documentation": "A list of documents that couldn't be removed from the Amazon Q Business index. Each entry contains an error message that indicates why the document couldn't be removed from the index.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#BatchPutDocument": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#BatchPutDocumentRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#BatchPutDocumentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Adds one or more documents to an Amazon Q Business index.
You use this API to:
ingest your structured and unstructured documents and documents stored in an Amazon S3 bucket into an Amazon Q Business index.
add custom attributes to documents in an Amazon Q Business index.
attach an access control list to the documents added to an Amazon Q Business index.
You can see the progress of the deletion, and any error messages related to the process, by using CloudWatch.
", + "smithy.api#http": { + "method": "POST", + "uri": "/applications/{applicationId}/indices/{indexId}/documents" + } + } + }, + "com.amazonaws.qbusiness#BatchPutDocumentRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business index to add the documents to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "documents": { + "target": "com.amazonaws.qbusiness#Documents", + "traits": { + "smithy.api#documentation": "One or more documents to add to the index.
Ensure that the name of your document doesn't contain any confidential information. Amazon Q Business returns document names in chat responses and citations when relevant.
The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket.
" + } + }, + "dataSourceSyncId": { + "target": "com.amazonaws.qbusiness#ExecutionId", + "traits": { + "smithy.api#documentation": "The identifier of the data source sync during which the documents were added.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#BatchPutDocumentResponse": { + "type": "structure", + "members": { + "failedDocuments": { + "target": "com.amazonaws.qbusiness#FailedDocuments", + "traits": { + "smithy.api#documentation": "A list of documents that were not added to the Amazon Q Business index because the document failed a validation check. Each document contains an error message that indicates why the document couldn't be added to the index.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#Blob": { + "type": "blob" + }, + "com.amazonaws.qbusiness#BlockedPhrase": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 36 + }, + "smithy.api#pattern": "^\\P{C}*$" + } + }, + "com.amazonaws.qbusiness#BlockedPhrases": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#BlockedPhrase" + } + }, + "com.amazonaws.qbusiness#BlockedPhrasesConfiguration": { + "type": "structure", + "members": { + "blockedPhrases": { + "target": "com.amazonaws.qbusiness#BlockedPhrases", + "traits": { + "smithy.api#documentation": "A list of phrases blocked from a Amazon Q Business web experience chat.
Each phrase can contain a maximum of 36 characters. The list can contain a maximum of 20 phrases.
The configured custom message displayed to an end user informing them that they've used a blocked phrase during chat.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information about the phrases blocked from chat by your chat control configuration.
" + } + }, + "com.amazonaws.qbusiness#BlockedPhrasesConfigurationUpdate": { + "type": "structure", + "members": { + "blockedPhrasesToCreateOrUpdate": { + "target": "com.amazonaws.qbusiness#BlockedPhrases", + "traits": { + "smithy.api#documentation": "Creates or updates a blocked phrases configuration in your Amazon Q Business application.
" + } + }, + "blockedPhrasesToDelete": { + "target": "com.amazonaws.qbusiness#BlockedPhrases", + "traits": { + "smithy.api#documentation": "Deletes a blocked phrases configuration in your Amazon Q Business application.
" + } + }, + "systemMessageOverride": { + "target": "com.amazonaws.qbusiness#SystemMessageOverride", + "traits": { + "smithy.api#documentation": "The configured custom message displayed to your end user when they use blocked phrase during chat.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Updates a blocked phrases configuration in your Amazon Q Business application.
" + } + }, + "com.amazonaws.qbusiness#BoostingDurationInSeconds": { + "type": "long", + "traits": { + "smithy.api#range": { + "min": 0, + "max": 999999999 + } + } + }, + "com.amazonaws.qbusiness#BrowserExtension": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "FIREFOX", + "name": "FIREFOX" + }, + { + "value": "CHROME", + "name": "CHROME" + } + ] + } + }, + "com.amazonaws.qbusiness#BrowserExtensionConfiguration": { + "type": "structure", + "members": { + "enabledBrowserExtensions": { + "target": "com.amazonaws.qbusiness#BrowserExtensionList", + "traits": { + "smithy.api#documentation": "Specify the browser extensions allowed for your Amazon Q web experience.
CHROME \u2014 Enables the extension for Chromium-based browsers (Google Chrome, Microsoft Edge, Opera, etc.).
FIREFOX \u2014 Enables the extension for Mozilla Firefox.
CHROME and FIREFOX \u2014 Enable the extension for Chromium-based browsers and Mozilla Firefox.
The container for browser extension configuration for an Amazon Q Business web experience.
" + } + }, + "com.amazonaws.qbusiness#BrowserExtensionList": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#BrowserExtension" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 2 + }, + "smithy.api#uniqueItems": {} + } + }, + "com.amazonaws.qbusiness#CancelSubscription": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CancelSubscriptionRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CancelSubscriptionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Unsubscribes a user or a group from their pricing tier in an Amazon Q Business application. An unsubscribed user or group loses all Amazon Q Business feature access at the start of next month.
", + "smithy.api#http": { + "method": "DELETE", + "uri": "/applications/{applicationId}/subscriptions/{subscriptionId}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#CancelSubscriptionRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application for which the subscription is being cancelled.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "subscriptionId": { + "target": "com.amazonaws.qbusiness#SubscriptionId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business subscription being cancelled.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CancelSubscriptionResponse": { + "type": "structure", + "members": { + "subscriptionArn": { + "target": "com.amazonaws.qbusiness#SubscriptionArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the Amazon Q Business subscription being cancelled.
" + } + }, + "currentSubscription": { + "target": "com.amazonaws.qbusiness#SubscriptionDetails", + "traits": { + "smithy.api#documentation": "The type of your current Amazon Q Business subscription.
" + } + }, + "nextSubscription": { + "target": "com.amazonaws.qbusiness#SubscriptionDetails", + "traits": { + "smithy.api#documentation": "The type of the Amazon Q Business subscription for the next month.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#Chat": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ChatInput" + }, + "output": { + "target": "com.amazonaws.qbusiness#ChatOutput" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#ExternalResourceException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#LicenseNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Starts or continues a streaming Amazon Q Business conversation.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/conversations", + "method": "POST" + } + } + }, + "com.amazonaws.qbusiness#ChatInput": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application linked to a streaming Amazon Q Business conversation.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#UserId", + "traits": { + "smithy.api#documentation": "The identifier of the user attached to the chat input.
", + "smithy.api#httpQuery": "userId" + } + }, + "userGroups": { + "target": "com.amazonaws.qbusiness#UserGroups", + "traits": { + "smithy.api#documentation": "The group names that a user associated with the chat input belongs to.
", + "smithy.api#httpQuery": "userGroups" + } + }, + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business conversation.
", + "smithy.api#httpQuery": "conversationId" + } + }, + "parentMessageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier used to associate a user message with a AI generated response.
", + "smithy.api#httpQuery": "parentMessageId" + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A token that you provide to identify the chat input.
", + "smithy.api#httpQuery": "clientToken", + "smithy.api#idempotencyToken": {} + } + }, + "inputStream": { + "target": "com.amazonaws.qbusiness#ChatInputStream", + "traits": { + "smithy.api#documentation": "The streaming input for the Chat API.
A configuration event activated by an end user request to select a specific chat mode.
" + } + }, + "textEvent": { + "target": "com.amazonaws.qbusiness#TextInputEvent", + "traits": { + "smithy.api#documentation": "Information about the payload of the ChatInputStream event containing the end user message input.
A request by an end user to upload a file during chat.
" + } + }, + "actionExecutionEvent": { + "target": "com.amazonaws.qbusiness#ActionExecutionEvent", + "traits": { + "smithy.api#documentation": "A request from an end user to perform an Amazon Q Business plugin action.
" + } + }, + "endOfInputEvent": { + "target": "com.amazonaws.qbusiness#EndOfInputEvent", + "traits": { + "smithy.api#documentation": "The end of the streaming input for the Chat API.
An authentication verification event response by a third party authentication server to Amazon Q Business.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The streaming input for the Chat API.
Configuration information required to invoke chat in PLUGIN_MODE.
Configuration information for Amazon Q Business conversation modes.
For more information, see Admin controls and guardrails and Conversation settings.
" + } + }, + "com.amazonaws.qbusiness#ChatOutput": { + "type": "structure", + "members": { + "outputStream": { + "target": "com.amazonaws.qbusiness#ChatOutputStream", + "traits": { + "smithy.api#documentation": "The streaming output for the Chat API.
Information about the payload of the ChatOutputStream event containing the AI-generated message output.
A metadata event for a AI-generated text output message in a Amazon Q Business conversation.
" + } + }, + "actionReviewEvent": { + "target": "com.amazonaws.qbusiness#ActionReviewEvent", + "traits": { + "smithy.api#documentation": "A request from Amazon Q Business to the end user for information Amazon Q Business needs to successfully complete a requested plugin action.
" + } + }, + "failedAttachmentEvent": { + "target": "com.amazonaws.qbusiness#FailedAttachmentEvent", + "traits": { + "smithy.api#documentation": "A failed file upload event during a web experience chat.
" + } + }, + "authChallengeRequestEvent": { + "target": "com.amazonaws.qbusiness#AuthChallengeRequestEvent", + "traits": { + "smithy.api#documentation": "An authentication verification event activated by an end user request to use a custom plugin.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The streaming output for the Chat API.
A unique identifier for your chat response configuration settings, used to reference and manage the configuration within the Amazon Q Business service.
", + "smithy.api#required": {} + } + }, + "chatResponseConfigurationArn": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the chat response configuration, which uniquely identifies the resource across all Amazon Web Services services and accounts.
", + "smithy.api#required": {} + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#DisplayName", + "traits": { + "smithy.api#documentation": "A human-readable name for the chat response configuration, making it easier to identify and manage multiple configurations within an organization.
", + "smithy.api#required": {} + } + }, + "responseConfigurationSummary": { + "target": "com.amazonaws.qbusiness#ResponseConfigurationSummary", + "traits": { + "smithy.api#documentation": "A summary of the response configuration settings, providing a concise overview of the key parameters that define how responses are generated and formatted.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationStatus", + "traits": { + "smithy.api#documentation": "The current status of the chat response configuration, indicating whether it is active, pending, or in another state that affects its availability for use in chat interactions.
", + "smithy.api#required": {} + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp indicating when the chat response configuration was initially created, useful for tracking the lifecycle of configuration resources.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp indicating when the chat response configuration was last modified, helping administrators track changes and maintain version awareness.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration details that define how Amazon Q Business generates and formats responses to user queries in chat interactions. This configuration allows administrators to customize response characteristics to meet specific organizational needs and communication standards.
" + } + }, + "com.amazonaws.qbusiness#ChatResponseConfigurationArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$" + } + }, + "com.amazonaws.qbusiness#ChatResponseConfigurationDetail": { + "type": "structure", + "members": { + "responseConfigurations": { + "target": "com.amazonaws.qbusiness#ResponseConfigurations", + "traits": { + "smithy.api#documentation": "A collection of specific response configuration settings that collectively define how responses are generated, formatted, and presented to users in chat interactions.
" + } + }, + "responseConfigurationSummary": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "A summary of the response configuration details, providing a concise overview of the key parameters and settings that define the response generation behavior.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationStatus", + "traits": { + "smithy.api#documentation": "The current status of the chat response configuration, indicating whether it is active, pending, or in another state that affects its availability for use.
" + } + }, + "error": { + "target": "com.amazonaws.qbusiness#ErrorDetail" + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp indicating when the detailed chat response configuration was last modified, helping administrators track changes and maintain version awareness.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Detailed information about a chat response configuration, including comprehensive settings and parameters that define how Amazon Q Business generates and formats responses.
" + } + }, + "com.amazonaws.qbusiness#ChatResponseConfigurationId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#ChatResponseConfigurationStatus": { + "type": "enum", + "members": { + "CREATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATING" + } + }, + "UPDATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPDATING" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + } + } + }, + "com.amazonaws.qbusiness#ChatResponseConfigurations": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#ChatResponseConfiguration" + } + }, + "com.amazonaws.qbusiness#ChatSync": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ChatSyncInput" + }, + "output": { + "target": "com.amazonaws.qbusiness#ChatSyncOutput" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#ExternalResourceException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#LicenseNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Starts or continues a non-streaming Amazon Q Business conversation.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/conversations?sync", + "method": "POST" + } + } + }, + "com.amazonaws.qbusiness#ChatSyncInput": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application linked to the Amazon Q Business conversation.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#UserId", + "traits": { + "smithy.api#documentation": "The identifier of the user attached to the chat input.
", + "smithy.api#httpQuery": "userId" + } + }, + "userGroups": { + "target": "com.amazonaws.qbusiness#UserGroups", + "traits": { + "smithy.api#documentation": "The group names that a user associated with the chat input belongs to.
", + "smithy.api#httpQuery": "userGroups" + } + }, + "userMessage": { + "target": "com.amazonaws.qbusiness#UserMessage", + "traits": { + "smithy.api#documentation": "A end user message in a conversation.
" + } + }, + "attachments": { + "target": "com.amazonaws.qbusiness#AttachmentsInput", + "traits": { + "smithy.api#documentation": "A list of files uploaded directly during chat. You can upload a maximum of 5 files of upto 10 MB each.
" + } + }, + "actionExecution": { + "target": "com.amazonaws.qbusiness#ActionExecution", + "traits": { + "smithy.api#documentation": "A request from an end user to perform an Amazon Q Business plugin action.
" + } + }, + "authChallengeResponse": { + "target": "com.amazonaws.qbusiness#AuthChallengeResponse", + "traits": { + "smithy.api#documentation": "An authentication verification event response by a third party authentication server to Amazon Q Business.
" + } + }, + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business conversation.
" + } + }, + "parentMessageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier of the previous system message in a conversation.
" + } + }, + "attributeFilter": { + "target": "com.amazonaws.qbusiness#AttributeFilter", + "traits": { + "smithy.api#documentation": "Enables filtering of Amazon Q Business web experience responses based on document attributes or metadata fields.
" + } + }, + "chatMode": { + "target": "com.amazonaws.qbusiness#ChatMode", + "traits": { + "smithy.api#documentation": "The chatMode parameter determines the chat modes available to Amazon Q Business users:
RETRIEVAL_MODE - If you choose this mode, Amazon Q generates responses solely from the data sources connected and indexed by the application. If an answer is not found in the data sources or there are no data sources available, Amazon Q will respond with a \"No Answer Found\" message, unless LLM knowledge has been enabled. In that case, Amazon Q will generate a response from the LLM knowledge
CREATOR_MODE - By selecting this mode, you can choose to generate responses only from the LLM knowledge. You can also attach files and have Amazon Q generate a response based on the data in those files. If the attached files do not contain an answer for the query, Amazon Q will automatically fall back to generating a response from the LLM knowledge.
PLUGIN_MODE - By selecting this mode, users can choose to use plugins in chat to get their responses.
If none of the modes are selected, Amazon Q will only respond using the information from the attached files.
For more information, see Admin controls and guardrails, Plugins, and Response sources.
" + } + }, + "chatModeConfiguration": { + "target": "com.amazonaws.qbusiness#ChatModeConfiguration", + "traits": { + "smithy.api#documentation": "The chat mode configuration for an Amazon Q Business application.
" + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A token that you provide to identify a chat request.
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ChatSyncOutput": { + "type": "structure", + "members": { + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business conversation.
" + } + }, + "systemMessage": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "An AI-generated message in a conversation.
" + } + }, + "systemMessageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier of an Amazon Q Business AI generated message within the conversation.
" + } + }, + "userMessageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier of an Amazon Q Business end user text input message within the conversation.
" + } + }, + "actionReview": { + "target": "com.amazonaws.qbusiness#ActionReview", + "traits": { + "smithy.api#documentation": "A request from Amazon Q Business to the end user for information Amazon Q Business needs to successfully complete a requested plugin action.
" + } + }, + "authChallengeRequest": { + "target": "com.amazonaws.qbusiness#AuthChallengeRequest", + "traits": { + "smithy.api#documentation": "An authentication verification event activated by an end user request to use a custom plugin.
" + } + }, + "sourceAttributions": { + "target": "com.amazonaws.qbusiness#SourceAttributions", + "traits": { + "smithy.api#documentation": "The source documents used to generate the conversation response.
" + } + }, + "failedAttachments": { + "target": "com.amazonaws.qbusiness#AttachmentsOutput", + "traits": { + "smithy.api#documentation": "A list of files which failed to upload during chat.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#CheckDocumentAccess": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CheckDocumentAccessRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CheckDocumentAccessResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Verifies if a user has access permissions for a specified document and returns the actual ACL attached to the document. Resolves user access on the document via user aliases and groups when verifying user access.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/index/{indexId}/users/{userId}/documents/{documentId}/check-document-access" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#CheckDocumentAccessRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the application. This is required to identify the specific Amazon Q Business application context for the document access check.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The unique identifier of the index. Used to locate the correct index within the application where the document is stored.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The unique identifier of the user. Used to check the access permissions for this specific user against the document's ACL.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "documentId": { + "target": "com.amazonaws.qbusiness#DocumentId", + "traits": { + "smithy.api#documentation": "The unique identifier of the document. Specifies which document's access permissions are being checked.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The unique identifier of the data source. Identifies the specific data source from which the document originates. Should not be used when a document is uploaded directly with BatchPutDocument, as no dataSourceId is available or necessary.
", + "smithy.api#httpQuery": "dataSourceId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CheckDocumentAccessResponse": { + "type": "structure", + "members": { + "userGroups": { + "target": "com.amazonaws.qbusiness#AssociatedGroups", + "traits": { + "smithy.api#documentation": "An array of groups the user is part of for the specified data source. Each group has a name and type.
" + } + }, + "userAliases": { + "target": "com.amazonaws.qbusiness#AssociatedUsers", + "traits": { + "smithy.api#documentation": "An array of aliases associated with the user. This includes both global and local aliases, each with a name and type.
" + } + }, + "hasAccess": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "A boolean value indicating whether the specified user has access to the document, either direct access or transitive access via groups and aliases attached to the document.
" + } + }, + "documentAcl": { + "target": "com.amazonaws.qbusiness#DocumentAcl", + "traits": { + "smithy.api#documentation": "The Access Control List (ACL) associated with the document. Includes allowlist and denylist conditions that determine user access.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ClientIdForOIDC": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[a-zA-Z0-9_.:/()*?=-]*$" + } + }, + "com.amazonaws.qbusiness#ClientIdsForOIDC": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#ClientIdForOIDC" + } + }, + "com.amazonaws.qbusiness#ClientNamespace": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#pattern": "^[a-zA-Z0-9._-]*$" + } + }, + "com.amazonaws.qbusiness#ClientToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#ConfigurationEvent": { + "type": "structure", + "members": { + "chatMode": { + "target": "com.amazonaws.qbusiness#ChatMode", + "traits": { + "smithy.api#documentation": "The chat modes available to an Amazon Q Business end user.
RETRIEVAL_MODE - The default chat mode for an Amazon Q Business application. When this mode is enabled, Amazon Q Business generates responses only from data sources connected to an Amazon Q Business application.
CREATOR_MODE - By selecting this mode, users can choose to generate responses only from the LLM knowledge, without consulting connected data sources, for a chat request.
PLUGIN_MODE - By selecting this mode, users can choose to use plugins in chat.
For more information, see Admin controls and guardrails, Plugins, and Conversation settings.
" + } + }, + "chatModeConfiguration": { + "target": "com.amazonaws.qbusiness#ChatModeConfiguration" + }, + "attributeFilter": { + "target": "com.amazonaws.qbusiness#AttributeFilter" + } + }, + "traits": { + "smithy.api#documentation": "A configuration event activated by an end user request to select a specific chat mode.
" + } + }, + "com.amazonaws.qbusiness#ConflictException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.qbusiness#ErrorMessage", + "traits": { + "smithy.api#documentation": "The message describing a ConflictException.
The identifier of the resource affected.
", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The type of the resource affected.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "You are trying to perform an action that conflicts with the current status of your resource. Fix any inconsistencies with your resources and try again.
", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.qbusiness#ContentBlockerRule": { + "type": "structure", + "members": { + "systemMessageOverride": { + "target": "com.amazonaws.qbusiness#SystemMessageOverride", + "traits": { + "smithy.api#documentation": "The configured custom message displayed to an end user informing them that they've used a blocked phrase during chat.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A rule for configuring how Amazon Q Business responds when it encounters a a blocked topic. You can configure a custom message to inform your end users that they have asked about a restricted topic and suggest any next steps they should take.
" + } + }, + "com.amazonaws.qbusiness#ContentRetrievalRule": { + "type": "structure", + "members": { + "eligibleDataSources": { + "target": "com.amazonaws.qbusiness#EligibleDataSources", + "traits": { + "smithy.api#documentation": "Specifies data sources in a Amazon Q Business application to use for content generation.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Rules for retrieving content from data sources connected to a Amazon Q Business application for a specific topic control configuration.
" + } + }, + "com.amazonaws.qbusiness#ContentSource": { + "type": "union", + "members": { + "retriever": { + "target": "com.amazonaws.qbusiness#RetrieverContentSource", + "traits": { + "smithy.api#documentation": "The retriever to use as the content source.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Specifies the source of content to search in.
" + } + }, + "com.amazonaws.qbusiness#ContentType": { + "type": "enum", + "members": { + "PDF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PDF" + } + }, + "HTML": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HTML" + } + }, + "MS_WORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MS_WORD" + } + }, + "PLAIN_TEXT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PLAIN_TEXT" + } + }, + "PPT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PPT" + } + }, + "RTF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RTF" + } + }, + "XML": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "XML" + } + }, + "XSLT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "XSLT" + } + }, + "MS_EXCEL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MS_EXCEL" + } + }, + "CSV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CSV" + } + }, + "JSON": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "JSON" + } + }, + "MD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MD" + } + } + } + }, + "com.amazonaws.qbusiness#Conversation": { + "type": "structure", + "members": { + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business conversation.
" + } + }, + "title": { + "target": "com.amazonaws.qbusiness#ConversationTitle", + "traits": { + "smithy.api#documentation": "The title of the conversation.
" + } + }, + "startTime": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The start time of the conversation.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A conversation in an Amazon Q Business application.
" + } + }, + "com.amazonaws.qbusiness#ConversationId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#ConversationSource": { + "type": "structure", + "members": { + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business conversation.
", + "smithy.api#required": {} + } + }, + "attachmentId": { + "target": "com.amazonaws.qbusiness#AttachmentId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business attachment.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The source reference for an existing attachment in an existing conversation.
" + } + }, + "com.amazonaws.qbusiness#ConversationTitle": { + "type": "string" + }, + "com.amazonaws.qbusiness#Conversations": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Conversation" + } + }, + "com.amazonaws.qbusiness#CopyFromSource": { + "type": "union", + "members": { + "conversation": { + "target": "com.amazonaws.qbusiness#ConversationSource", + "traits": { + "smithy.api#documentation": "A reference to an attachment in an existing conversation.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The source reference for an existing attachment.
" + } + }, + "com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrl": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Creates a unique URL for anonymous Amazon Q Business web experience. This URL can only be used once and must be used within 5 minutes after it's generated.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}/anonymous-url", + "method": "POST" + } + } + }, + "com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application environment attached to the web experience.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "webExperienceId": { + "target": "com.amazonaws.qbusiness#WebExperienceId", + "traits": { + "smithy.api#documentation": "The identifier of the web experience.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "sessionDurationInMinutes": { + "target": "com.amazonaws.qbusiness#SessionDurationInMinutes", + "traits": { + "smithy.api#documentation": "The duration of the session associated with the unique URL for the web experience.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlResponse": { + "type": "structure", + "members": { + "anonymousUrl": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The unique URL for accessing the web experience.
This URL can only be used once and must be used within 5 minutes after it's generated.
Creates an Amazon Q Business application.
There are new tiers for Amazon Q Business. Not all features in Amazon Q Business Pro are also available in Amazon Q Business Lite. For information on what's included in Amazon Q Business Lite and what's included in Amazon Q Business Pro, see Amazon Q Business tiers. You must use the Amazon Q Business console to assign subscription tiers to users.
An Amazon Q Apps service linked role will be created if it's absent in the Amazon Web Services account when QAppsConfiguration is enabled in the request. For more information, see Using service-linked roles for Q Apps.
When you create an application, Amazon Q Business may securely transmit data for processing from your selected Amazon Web Services region, but within your geography. For more information, see Cross region inference in Amazon Q Business.
A name for the Amazon Q Business application.
", + "smithy.api#required": {} + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of an IAM role with permissions to access your Amazon CloudWatch logs and metrics. If this property is not specified, Amazon Q Business will create a service linked role (SLR) and use it as the application's role.
" + } + }, + "identityType": { + "target": "com.amazonaws.qbusiness#IdentityType", + "traits": { + "smithy.api#documentation": "The authentication type being used by a Amazon Q Business application.
" + } + }, + "iamIdentityProviderArn": { + "target": "com.amazonaws.qbusiness#IAMIdentityProviderArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of an identity provider being used by an Amazon Q Business application.
" + } + }, + "identityCenterInstanceArn": { + "target": "com.amazonaws.qbusiness#InstanceArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM Identity Center instance you are either creating for\u2014or connecting to\u2014your Amazon Q Business application.
" + } + }, + "clientIdsForOIDC": { + "target": "com.amazonaws.qbusiness#ClientIdsForOIDC", + "traits": { + "smithy.api#documentation": "The OIDC client ID for a Amazon Q Business application.
" + } + }, + "description": { + "target": "com.amazonaws.qbusiness#Description", + "traits": { + "smithy.api#documentation": "A description for the Amazon Q Business application.
" + } + }, + "encryptionConfiguration": { + "target": "com.amazonaws.qbusiness#EncryptionConfiguration", + "traits": { + "smithy.api#documentation": "The identifier of the KMS key that is used to encrypt your data. Amazon Q Business doesn't support asymmetric keys.
" + } + }, + "tags": { + "target": "com.amazonaws.qbusiness#Tags", + "traits": { + "aws.cloudformation#cfnMutability": "full", + "smithy.api#documentation": "A list of key-value pairs that identify or categorize your Amazon Q Business application. You can also use tags to help control access to the application. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
" + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A token that you provide to identify the request to create your Amazon Q Business application.
", + "smithy.api#idempotencyToken": {} + } + }, + "attachmentsConfiguration": { + "target": "com.amazonaws.qbusiness#AttachmentsConfiguration", + "traits": { + "aws.cloudformation#cfnMutability": "full", + "smithy.api#documentation": "An option to allow end users to upload files directly during chat.
" + } + }, + "qAppsConfiguration": { + "target": "com.amazonaws.qbusiness#QAppsConfiguration", + "traits": { + "smithy.api#documentation": "An option to allow end users to create and use Amazon Q Apps in the web experience.
" + } + }, + "personalizationConfiguration": { + "target": "com.amazonaws.qbusiness#PersonalizationConfiguration", + "traits": { + "smithy.api#documentation": "Configuration information about chat response personalization. For more information, see Personalizing chat responses
" + } + }, + "quickSightConfiguration": { + "target": "com.amazonaws.qbusiness#QuickSightConfiguration", + "traits": { + "smithy.api#documentation": "The Amazon Quick Suite configuration for an Amazon Q Business application that uses Quick Suite for authentication. This configuration is required if your application uses Quick Suite as the identity provider. For more information, see Creating an Amazon Quick Suite integrated application.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CreateApplicationResponse": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application.
" + } + }, + "applicationArn": { + "target": "com.amazonaws.qbusiness#ApplicationArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the Amazon Q Business application.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#CreateChatResponseConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CreateChatResponseConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CreateChatResponseConfigurationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#conditionKeys": [ + "aws:RequestTag/${TagKey}", + "aws:TagKeys" + ], + "aws.iam#iamAction": { + "requiredActions": [ + "qbusiness:GetChatResponseConfiguration", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource" + ] + }, + "smithy.api#documentation": "Creates a new chat response configuration for an Amazon Q Business application. This operation establishes a set of parameters that define how the system generates and formats responses to user queries in chat interactions.
", + "smithy.api#http": { + "method": "POST", + "uri": "/applications/{applicationId}/chatresponseconfigurations" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#CreateChatResponseConfigurationRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application for which to create the new chat response configuration.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#DisplayName", + "traits": { + "smithy.api#documentation": "A human-readable name for the new chat response configuration, making it easier to identify and manage among multiple configurations.
", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "A unique, case-sensitive identifier to ensure idempotency of the request. This helps prevent the same configuration from being created multiple times if retries occur.
", + "smithy.api#idempotencyToken": {} + } + }, + "responseConfigurations": { + "target": "com.amazonaws.qbusiness#ResponseConfigurations", + "traits": { + "smithy.api#documentation": "A collection of response configuration settings that define how Amazon Q Business will generate and format responses to user queries in chat interactions.
", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.qbusiness#Tags", + "traits": { + "aws.cloudformation#cfnMutability": "full", + "smithy.api#documentation": "A list of key-value pairs to apply as tags to the new chat response configuration, enabling categorization and management of resources across Amazon Web Services services.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CreateChatResponseConfigurationResponse": { + "type": "structure", + "members": { + "chatResponseConfigurationId": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationId", + "traits": { + "smithy.api#documentation": "The unique identifier assigned to a newly created chat response configuration, used for subsequent operations on this resource.
", + "smithy.api#required": {} + } + }, + "chatResponseConfigurationArn": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the newly created chat response configuration, which uniquely identifies the resource across all Amazon Web Services services.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#CreateDataAccessor": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CreateDataAccessorRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CreateDataAccessorResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#conditionKeys": [ + "aws:RequestTag/${TagKey}", + "aws:TagKeys" + ], + "aws.iam#requiredActions": [ + "qbusiness:GetDataAccessor", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource" + ], + "smithy.api#documentation": "Creates a new data accessor for an ISV to access data from a Amazon Q Business application. The data accessor is an entity that represents the ISV's access to the Amazon Q Business application's data. It includes the IAM role ARN for the ISV, a friendly name, and a set of action configurations that define the specific actions the ISV is allowed to perform and any associated data filters. When the data accessor is created, an IAM Identity Center application is also created to manage the ISV's identity and authentication for accessing the Amazon Q Business application.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/dataaccessors", + "method": "POST" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#CreateDataAccessorRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "principal": { + "target": "com.amazonaws.qbusiness#PrincipalRoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM role for the ISV that will be accessing the data.
", + "smithy.api#required": {} + } + }, + "actionConfigurations": { + "target": "com.amazonaws.qbusiness#ActionConfigurationList", + "traits": { + "smithy.api#documentation": "A list of action configurations specifying the allowed actions and any associated filters.
", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A unique, case-sensitive identifier you provide to ensure idempotency of the request.
", + "smithy.api#idempotencyToken": {} + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#DataAccessorName", + "traits": { + "smithy.api#documentation": "A friendly name for the data accessor.
", + "smithy.api#required": {} + } + }, + "authenticationDetail": { + "target": "com.amazonaws.qbusiness#DataAccessorAuthenticationDetail", + "traits": { + "smithy.api#documentation": "The authentication configuration details for the data accessor. This specifies how the ISV will authenticate when accessing data through this data accessor.
" + } + }, + "tags": { + "target": "com.amazonaws.qbusiness#Tags", + "traits": { + "aws.cloudformation#cfnMutability": "full", + "smithy.api#documentation": "The tags to associate with the data accessor.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CreateDataAccessorResponse": { + "type": "structure", + "members": { + "dataAccessorId": { + "target": "com.amazonaws.qbusiness#DataAccessorId", + "traits": { + "smithy.api#documentation": "The unique identifier of the created data accessor.
", + "smithy.api#required": {} + } + }, + "idcApplicationArn": { + "target": "com.amazonaws.qbusiness#IdcApplicationArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM Identity Center application created for this data accessor.
", + "smithy.api#required": {} + } + }, + "dataAccessorArn": { + "target": "com.amazonaws.qbusiness#DataAccessorArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the created data accessor.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#CreateDataSource": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CreateDataSourceRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CreateDataSourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#conditionKeys": [ + "aws:RequestTag/${TagKey}", + "aws:TagKeys" + ], + "aws.iam#requiredActions": [ + "qbusiness:GetDataSource", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole" + ], + "smithy.api#documentation": "Creates a data source connector for an Amazon Q Business application.
CreateDataSource is a synchronous operation. The operation returns 200 if the data source was successfully created. Otherwise, an exception is raised.
The identifier of the Amazon Q Business application the data source will be attached to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index that you want to use with the data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#DataSourceName", + "traits": { + "aws.cloudformation#cfnMutability": "full", + "smithy.api#documentation": "A name for the data source connector.
", + "smithy.api#required": {} + } + }, + "configuration": { + "target": "com.amazonaws.qbusiness#DataSourceConfiguration", + "traits": { + "smithy.api#documentation": "Configuration information to connect your data source repository to Amazon Q Business. Use this parameter to provide a JSON schema with configuration information specific to your data source connector.
Each data source has a JSON schema provided by Amazon Q Business that you must use. For example, the Amazon S3 and Web Crawler connectors require the following JSON schemas:
You can find configuration templates for your specific data source using the following steps:
Navigate to the Supported connectors page in the Amazon Q Business User Guide, and select the data source of your choice.
Then, from your specific data source connector page, select Using the API. You will find the JSON schema for your data source, including parameter descriptions, in this section.
Configuration information for an Amazon VPC (Virtual Private Cloud) to connect to your data source. For more information, see Using Amazon VPC with Amazon Q Business connectors.
" + } + }, + "description": { + "target": "com.amazonaws.qbusiness#Description", + "traits": { + "smithy.api#documentation": "A description for the data source connector.
" + } + }, + "tags": { + "target": "com.amazonaws.qbusiness#Tags", + "traits": { + "aws.cloudformation#cfnMutability": "full", + "smithy.api#documentation": "A list of key-value pairs that identify or categorize the data source connector. You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
" + } + }, + "syncSchedule": { + "target": "com.amazonaws.qbusiness#SyncSchedule", + "traits": { + "smithy.api#documentation": "Sets the frequency for Amazon Q Business to check the documents in your data source repository and update your index. If you don't set a schedule, Amazon Q Business won't periodically update the index.
Specify a cron- format schedule string or an empty string to indicate that the index is updated on demand. You can't specify the Schedule parameter when the Type parameter is set to CUSTOM. If you do, you receive a ValidationException exception.
The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources. This field is required for all connector types except custom connectors, where it is optional.
" + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A token you provide to identify a request to create a data source connector. Multiple calls to the CreateDataSource API with the same client token will create only one data source connector.
The configuration for extracting information from media in documents during ingestion.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CreateDataSourceResponse": { + "type": "structure", + "members": { + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source connector.
" + } + }, + "dataSourceArn": { + "target": "com.amazonaws.qbusiness#DataSourceArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of a data source in an Amazon Q Business application.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#CreateIndex": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CreateIndexRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CreateIndexResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#conditionKeys": [ + "aws:RequestTag/${TagKey}", + "aws:TagKeys" + ], + "aws.iam#requiredActions": [ + "qbusiness:GetIndex", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource" + ], + "smithy.api#documentation": "Creates an Amazon Q Business index.
To determine if index creation has completed, check the Status field returned from a call to DescribeIndex. The Status field is set to ACTIVE when the index is ready to use.
Once the index is active, you can index your documents using the BatchPutDocument API or the CreateDataSource API.
The identifier of the Amazon Q Business application using the index.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#IndexName", + "traits": { + "aws.cloudformation#cfnMutability": "full", + "smithy.api#documentation": "A name for the Amazon Q Business index.
", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.qbusiness#Description", + "traits": { + "smithy.api#documentation": "A description for the Amazon Q Business index.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#IndexType", + "traits": { + "smithy.api#documentation": "The index type that's suitable for your needs. For more information on what's included in each type of index, see Amazon Q Business tiers.
" + } + }, + "tags": { + "target": "com.amazonaws.qbusiness#Tags", + "traits": { + "aws.cloudformation#cfnMutability": "full", + "smithy.api#documentation": "A list of key-value pairs that identify or categorize the index. You can also use tags to help control access to the index. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
" + } + }, + "capacityConfiguration": { + "target": "com.amazonaws.qbusiness#IndexCapacityConfiguration", + "traits": { + "smithy.api#documentation": "The capacity units you want to provision for your index. You can add and remove capacity to fit your usage needs.
" + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A token that you provide to identify the request to create an index. Multiple calls to the CreateIndex API with the same client token will create only one index.
The identifier for the Amazon Q Business index.
" + } + }, + "indexArn": { + "target": "com.amazonaws.qbusiness#IndexArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of an Amazon Q Business index.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#CreatePlugin": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CreatePluginRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CreatePluginResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#conditionKeys": [ + "aws:RequestTag/${TagKey}", + "aws:TagKeys" + ], + "aws.iam#requiredActions": [ + "qbusiness:GetPlugin", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole" + ], + "smithy.api#documentation": "Creates an Amazon Q Business plugin.
", + "smithy.api#http": { + "method": "POST", + "uri": "/applications/{applicationId}/plugins" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#CreatePluginRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application that will contain the plugin.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#PluginName", + "traits": { + "smithy.api#documentation": "A the name for your plugin.
", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.qbusiness#PluginType", + "traits": { + "smithy.api#documentation": "The type of plugin you want to create.
", + "smithy.api#required": {} + } + }, + "authConfiguration": { + "target": "com.amazonaws.qbusiness#PluginAuthConfiguration", + "traits": { + "smithy.api#required": {} + } + }, + "serverUrl": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The source URL used for plugin configuration.
" + } + }, + "customPluginConfiguration": { + "target": "com.amazonaws.qbusiness#CustomPluginConfiguration", + "traits": { + "smithy.api#documentation": "Contains configuration for a custom plugin.
" + } + }, + "tags": { + "target": "com.amazonaws.qbusiness#Tags", + "traits": { + "aws.cloudformation#cfnMutability": "full", + "smithy.api#documentation": "A list of key-value pairs that identify or categorize the data source connector. You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
" + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A token that you provide to identify the request to create your Amazon Q Business plugin.
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CreatePluginResponse": { + "type": "structure", + "members": { + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the plugin created.
" + } + }, + "pluginArn": { + "target": "com.amazonaws.qbusiness#PluginArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of a plugin.
" + } + }, + "buildStatus": { + "target": "com.amazonaws.qbusiness#PluginBuildStatus", + "traits": { + "smithy.api#documentation": "The current status of a plugin. A plugin is modified asynchronously.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#CreateRetriever": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CreateRetrieverRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CreateRetrieverResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#conditionKeys": [ + "aws:RequestTag/${TagKey}", + "aws:TagKeys" + ], + "aws.iam#requiredActions": [ + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + "qbusiness:GetRetriever", + "iam:PassRole" + ], + "smithy.api#documentation": "Adds a retriever to your Amazon Q Business application.
", + "smithy.api#http": { + "method": "POST", + "uri": "/applications/{applicationId}/retrievers" + } + } + }, + "com.amazonaws.qbusiness#CreateRetrieverRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of your Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.qbusiness#RetrieverType", + "traits": { + "aws.cloudformation#cfnMutability": "create-and-read", + "smithy.api#documentation": "The type of retriever you are using.
", + "smithy.api#required": {} + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#RetrieverName", + "traits": { + "smithy.api#documentation": "The name of your retriever.
", + "smithy.api#required": {} + } + }, + "configuration": { + "target": "com.amazonaws.qbusiness#RetrieverConfiguration", + "traits": { + "smithy.api#required": {} + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The ARN of an IAM role used by Amazon Q Business to access the basic authentication credentials stored in a Secrets Manager secret.
" + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A token that you provide to identify the request to create your Amazon Q Business application retriever.
", + "smithy.api#idempotencyToken": {} + } + }, + "tags": { + "target": "com.amazonaws.qbusiness#Tags", + "traits": { + "aws.cloudformation#cfnMutability": "full", + "smithy.api#documentation": "A list of key-value pairs that identify or categorize the retriever. You can also use tags to help control access to the retriever. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CreateRetrieverResponse": { + "type": "structure", + "members": { + "retrieverId": { + "target": "com.amazonaws.qbusiness#RetrieverId", + "traits": { + "smithy.api#documentation": "The identifier of the retriever you are using.
" + } + }, + "retrieverArn": { + "target": "com.amazonaws.qbusiness#RetrieverArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of an IAM role associated with a retriever.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#CreateSubscription": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CreateSubscriptionRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CreateSubscriptionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Subscribes an IAM Identity Center user or a group to a pricing tier for an Amazon Q Business application.
Amazon Q Business offers two subscription tiers: Q_LITE and Q_BUSINESS. Subscription tier determines feature access for the user. For more information on subscriptions and pricing tiers, see Amazon Q Business pricing.
For an example IAM role policy for assigning subscriptions, see Set up required permissions in the Amazon Q Business User Guide.
The identifier of the Amazon Q Business application the subscription should be added to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "principal": { + "target": "com.amazonaws.qbusiness#SubscriptionPrincipal", + "traits": { + "smithy.api#documentation": "The IAM Identity Center UserId or GroupId of a user or group in the IAM Identity Center instance connected to the Amazon Q Business application.
The type of Amazon Q Business subscription you want to create.
", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A token that you provide to identify the request to create a subscription for your Amazon Q Business application.
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CreateSubscriptionResponse": { + "type": "structure", + "members": { + "subscriptionId": { + "target": "com.amazonaws.qbusiness#SubscriptionId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business subscription created.
" + } + }, + "subscriptionArn": { + "target": "com.amazonaws.qbusiness#SubscriptionArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the Amazon Q Business subscription created.
" + } + }, + "currentSubscription": { + "target": "com.amazonaws.qbusiness#SubscriptionDetails", + "traits": { + "smithy.api#documentation": "The type of your current Amazon Q Business subscription.
" + } + }, + "nextSubscription": { + "target": "com.amazonaws.qbusiness#SubscriptionDetails", + "traits": { + "smithy.api#documentation": "The type of the Amazon Q Business subscription for the next month.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#CreateUser": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CreateUserRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CreateUserResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Creates a universally unique identifier (UUID) mapped to a list of local user ids within an application.
", + "smithy.api#http": { + "method": "POST", + "uri": "/applications/{applicationId}/users" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#CreateUserRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application for which the user mapping will be created.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The user emails attached to a user mapping.
", + "smithy.api#required": {} + } + }, + "userAliases": { + "target": "com.amazonaws.qbusiness#UserAliases", + "traits": { + "smithy.api#documentation": "The list of user aliases in the mapping.
", + "smithy.api#length": { + "min": 0, + "max": 100 + } + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A token that you provide to identify the request to create your Amazon Q Business user mapping.
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CreateUserResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#CreateWebExperience": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#CreateWebExperienceRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#CreateWebExperienceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#conditionKeys": [ + "aws:RequestTag/${TagKey}", + "aws:TagKeys" + ], + "aws.iam#requiredActions": [ + "qbusiness:GetWebExperience", + "qbusiness:TagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole", + "sso:PutApplicationGrant", + "sso:UpdateApplication" + ], + "smithy.api#documentation": "Creates an Amazon Q Business web experience.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/experiences", + "method": "POST" + } + } + }, + "com.amazonaws.qbusiness#CreateWebExperienceRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business web experience.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "title": { + "target": "com.amazonaws.qbusiness#WebExperienceTitle", + "traits": { + "smithy.api#documentation": "The title for your Amazon Q Business web experience.
" + } + }, + "subtitle": { + "target": "com.amazonaws.qbusiness#WebExperienceSubtitle", + "traits": { + "smithy.api#documentation": "A subtitle to personalize your Amazon Q Business web experience.
" + } + }, + "welcomeMessage": { + "target": "com.amazonaws.qbusiness#WebExperienceWelcomeMessage", + "traits": { + "smithy.api#documentation": "The customized welcome message for end users of an Amazon Q Business web experience.
" + } + }, + "samplePromptsControlMode": { + "target": "com.amazonaws.qbusiness#WebExperienceSamplePromptsControlMode", + "traits": { + "smithy.api#documentation": "Determines whether sample prompts are enabled in the web experience for an end user.
" + } + }, + "origins": { + "target": "com.amazonaws.qbusiness#WebExperienceOrigins", + "traits": { + "smithy.api#documentation": "Sets the website domain origins that are allowed to embed the Amazon Q Business web experience. The domain origin refers to the base URL for accessing a website including the protocol (http/https), the domain name, and the port number (if specified).
You must only submit a base URL and not a full path. For example, https://docs.aws.amazon.com.
The Amazon Resource Name (ARN) of the service role attached to your web experience.
The roleArn parameter is required when your Amazon Q Business application is created with IAM Identity Center. It is not required for SAML-based applications.
A list of key-value pairs that identify or categorize your Amazon Q Business web experience. You can also use tags to help control access to the web experience. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
" + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A token you provide to identify a request to create an Amazon Q Business web experience.
", + "smithy.api#idempotencyToken": {} + } + }, + "identityProviderConfiguration": { + "target": "com.amazonaws.qbusiness#IdentityProviderConfiguration", + "traits": { + "smithy.api#documentation": "Information about the identity provider (IdP) used to authenticate end users of an Amazon Q Business web experience.
" + } + }, + "browserExtensionConfiguration": { + "target": "com.amazonaws.qbusiness#BrowserExtensionConfiguration", + "traits": { + "smithy.api#documentation": "The browser extension configuration for an Amazon Q Business web experience.
For Amazon Q Business application using external OIDC-compliant identity providers (IdPs). The IdP administrator must add the browser extension sign-in redirect URLs to the IdP application. For more information, see Configure external OIDC identity provider for your browser extensions..
Sets the custom logo, favicon, font, and color used in the Amazon Q web experience.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#CreateWebExperienceResponse": { + "type": "structure", + "members": { + "webExperienceId": { + "target": "com.amazonaws.qbusiness#WebExperienceId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business web experience.
" + } + }, + "webExperienceArn": { + "target": "com.amazonaws.qbusiness#WebExperienceArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of an Amazon Q Business web experience.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#CreatorModeConfiguration": { + "type": "structure", + "members": { + "creatorModeControl": { + "target": "com.amazonaws.qbusiness#CreatorModeControl", + "traits": { + "smithy.api#documentation": "Status information about whether CREATOR_MODE has been enabled or disabled. The default status is DISABLED.
Configuration information required to invoke chat in CREATOR_MODE.
For more information, see Admin controls and guardrails and Conversation settings.
" + } + }, + "com.amazonaws.qbusiness#CreatorModeControl": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.qbusiness#CustomCSSUrl": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^(https?://[a-zA-Z0-9-_.+%/]+\\.css)?$" + } + }, + "com.amazonaws.qbusiness#CustomPluginConfiguration": { + "type": "structure", + "members": { + "description": { + "target": "com.amazonaws.qbusiness#PluginDescription", + "traits": { + "smithy.api#documentation": "A description for your custom plugin configuration.
", + "smithy.api#required": {} + } + }, + "apiSchemaType": { + "target": "com.amazonaws.qbusiness#APISchemaType", + "traits": { + "smithy.api#documentation": "The type of OpenAPI schema to use.
", + "smithy.api#required": {} + } + }, + "apiSchema": { + "target": "com.amazonaws.qbusiness#APISchema", + "traits": { + "smithy.api#documentation": "Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration information required to create a custom plugin.
" + } + }, + "com.amazonaws.qbusiness#CustomizationConfiguration": { + "type": "structure", + "members": { + "customCSSUrl": { + "target": "com.amazonaws.qbusiness#CustomCSSUrl", + "traits": { + "smithy.api#documentation": "Provides the URL where the custom CSS file is hosted for an Amazon Q web experience.
" + } + }, + "logoUrl": { + "target": "com.amazonaws.qbusiness#LogoUrl", + "traits": { + "smithy.api#documentation": "Provides the URL where the custom logo file is hosted for an Amazon Q web experience.
" + } + }, + "fontUrl": { + "target": "com.amazonaws.qbusiness#FontUrl", + "traits": { + "smithy.api#documentation": "Provides the URL where the custom font file is hosted for an Amazon Q web experience.
" + } + }, + "faviconUrl": { + "target": "com.amazonaws.qbusiness#FaviconUrl", + "traits": { + "smithy.api#documentation": "Provides the URL where the custom favicon file is hosted for an Amazon Q web experience.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Contains the configuration information to customize the logo, font, and color of an Amazon Q Business web experience with individual files for each property or a CSS file for them all.
" + } + }, + "com.amazonaws.qbusiness#DataAccessor": { + "type": "structure", + "members": { + "displayName": { + "target": "com.amazonaws.qbusiness#DataAccessorName", + "traits": { + "smithy.api#documentation": "The friendly name of the data accessor.
" + } + }, + "dataAccessorId": { + "target": "com.amazonaws.qbusiness#DataAccessorId", + "traits": { + "smithy.api#documentation": "The unique identifier of the data accessor.
" + } + }, + "dataAccessorArn": { + "target": "com.amazonaws.qbusiness#DataAccessorArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the data accessor.
" + } + }, + "idcApplicationArn": { + "target": "com.amazonaws.qbusiness#IdcApplicationArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the associated IAM Identity Center application.
" + } + }, + "principal": { + "target": "com.amazonaws.qbusiness#PrincipalRoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM role for the ISV associated with this data accessor.
" + } + }, + "authenticationDetail": { + "target": "com.amazonaws.qbusiness#DataAccessorAuthenticationDetail", + "traits": { + "smithy.api#documentation": "The authentication configuration details for the data accessor. This specifies how the ISV authenticates when accessing data through this data accessor.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp when the data accessor was created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp when the data accessor was last updated.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides summary information about a data accessor.
" + } + }, + "com.amazonaws.qbusiness#DataAccessorArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$" + } + }, + "com.amazonaws.qbusiness#DataAccessorAuthenticationConfiguration": { + "type": "union", + "members": { + "idcTrustedTokenIssuerConfiguration": { + "target": "com.amazonaws.qbusiness#DataAccessorIdcTrustedTokenIssuerConfiguration", + "traits": { + "smithy.api#documentation": "Configuration for IAM Identity Center Trusted Token Issuer (TTI) authentication used when the authentication type is AWS_IAM_IDC_TTI.
A union type that contains the specific authentication configuration based on the authentication type selected.
" + } + }, + "com.amazonaws.qbusiness#DataAccessorAuthenticationDetail": { + "type": "structure", + "members": { + "authenticationType": { + "target": "com.amazonaws.qbusiness#DataAccessorAuthenticationType", + "traits": { + "smithy.api#documentation": "The type of authentication to use for the data accessor. This determines how the ISV authenticates when accessing data. You can use one of two authentication types:
AWS_IAM_IDC_TTI - Authentication using IAM Identity Center Trusted Token Issuer (TTI). This authentication type allows the ISV to use a trusted token issuer to generate tokens for accessing the data.
AWS_IAM_IDC_AUTH_CODE - Authentication using IAM Identity Center authorization code flow. This authentication type uses the standard OAuth 2.0 authorization code flow for authentication.
The specific authentication configuration based on the authentication type.
" + } + }, + "externalIds": { + "target": "com.amazonaws.qbusiness#DataAccessorExternalIds", + "traits": { + "smithy.api#documentation": "A list of external identifiers associated with this authentication configuration. These are used to correlate the data accessor with external systems.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Contains the authentication configuration details for a data accessor. This structure defines how the ISV authenticates when accessing data through the data accessor.
" + } + }, + "com.amazonaws.qbusiness#DataAccessorAuthenticationType": { + "type": "enum", + "members": { + "AWS_IAM_IDC_TTI": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AWS_IAM_IDC_TTI" + } + }, + "AWS_IAM_IDC_AUTH_CODE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AWS_IAM_IDC_AUTH_CODE" + } + } + }, + "traits": { + "smithy.api#documentation": "The type of authentication mechanism used by the data accessor.
" + } + }, + "com.amazonaws.qbusiness#DataAccessorExternalId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1000 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + } + }, + "com.amazonaws.qbusiness#DataAccessorExternalIds": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#DataAccessorExternalId" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, + "com.amazonaws.qbusiness#DataAccessorId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#DataAccessorIdcTrustedTokenIssuerConfiguration": { + "type": "structure", + "members": { + "idcTrustedTokenIssuerArn": { + "target": "com.amazonaws.qbusiness#IdcTrustedTokenIssuerArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM Identity Center Trusted Token Issuer that will be used for authentication.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration details for IAM Identity Center Trusted Token Issuer (TTI) authentication.
" + } + }, + "com.amazonaws.qbusiness#DataAccessorName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.qbusiness#DataAccessorResource": { + "type": "resource", + "identifiers": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId" + }, + "dataAccessorId": { + "target": "com.amazonaws.qbusiness#DataAccessorId" + } + }, + "create": { + "target": "com.amazonaws.qbusiness#CreateDataAccessor" + }, + "read": { + "target": "com.amazonaws.qbusiness#GetDataAccessor" + }, + "update": { + "target": "com.amazonaws.qbusiness#UpdateDataAccessor" + }, + "delete": { + "target": "com.amazonaws.qbusiness#DeleteDataAccessor" + }, + "list": { + "target": "com.amazonaws.qbusiness#ListDataAccessors" + }, + "traits": { + "aws.cloudformation#cfnResource": { + "name": "DataAccessor" + } + } + }, + "com.amazonaws.qbusiness#DataAccessors": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#DataAccessor" + } + }, + "com.amazonaws.qbusiness#DataSource": { + "type": "structure", + "members": { + "displayName": { + "target": "com.amazonaws.qbusiness#DataSourceName", + "traits": { + "smithy.api#documentation": "The name of the Amazon Q Business data source.
" + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business data source.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The type of the Amazon Q Business data source.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business data source was created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business data source was last updated.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#DataSourceStatus", + "traits": { + "smithy.api#documentation": "The status of the Amazon Q Business data source.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A data source in an Amazon Q Business application.
" + } + }, + "com.amazonaws.qbusiness#DataSourceArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$" + } + }, + "com.amazonaws.qbusiness#DataSourceConfiguration": { + "type": "document", + "traits": { + "smithy.api#documentation": "Provides the configuration information for an Amazon Q Business data source.
" + } + }, + "com.amazonaws.qbusiness#DataSourceId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#DataSourceIds": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#DataSourceId" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, + "com.amazonaws.qbusiness#DataSourceName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1000 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + } + }, + "com.amazonaws.qbusiness#DataSourceResource": { + "type": "resource", + "identifiers": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId" + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId" + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId" + } + }, + "create": { + "target": "com.amazonaws.qbusiness#CreateDataSource" + }, + "read": { + "target": "com.amazonaws.qbusiness#GetDataSource" + }, + "update": { + "target": "com.amazonaws.qbusiness#UpdateDataSource" + }, + "delete": { + "target": "com.amazonaws.qbusiness#DeleteDataSource" + }, + "list": { + "target": "com.amazonaws.qbusiness#ListDataSources" + }, + "traits": { + "aws.cloudformation#cfnResource": { + "name": "DataSource" + } + } + }, + "com.amazonaws.qbusiness#DataSourceStatus": { + "type": "enum", + "members": { + "PENDING_CREATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PENDING_CREATION" + } + }, + "CREATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATING" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "UPDATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPDATING" + } + } + } + }, + "com.amazonaws.qbusiness#DataSourceSyncJob": { + "type": "structure", + "members": { + "executionId": { + "target": "com.amazonaws.qbusiness#ExecutionId", + "traits": { + "smithy.api#documentation": "The identifier of a data source synchronization job.
" + } + }, + "startTime": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix time stamp when the data source synchronization job started.
" + } + }, + "endTime": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the synchronization job completed.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#DataSourceSyncJobStatus", + "traits": { + "smithy.api#documentation": "The status of the synchronization job. When the Status field is set to SUCCEEDED, the synchronization job is done. If the status code is FAILED, the ErrorCode and ErrorMessage fields give you the reason for the failure.
If the Status field is set to FAILED, the ErrorCode field indicates the reason the synchronization failed.
If the reason that the synchronization failed is due to an error with the underlying data source, this field contains a code that identifies the error.
" + } + }, + "metrics": { + "target": "com.amazonaws.qbusiness#DataSourceSyncJobMetrics", + "traits": { + "smithy.api#documentation": "Maps a batch delete document request to a specific data source sync job. This is optional and should only be supplied when documents are deleted by a data source connector.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information about an Amazon Q Business data source connector synchronization job.
" + } + }, + "com.amazonaws.qbusiness#DataSourceSyncJobMetrics": { + "type": "structure", + "members": { + "documentsAdded": { + "target": "com.amazonaws.qbusiness#MetricValue", + "traits": { + "smithy.api#documentation": "The current count of documents added from the data source during the data source sync.
" + } + }, + "documentsModified": { + "target": "com.amazonaws.qbusiness#MetricValue", + "traits": { + "smithy.api#documentation": "The current count of documents modified in the data source during the data source sync.
" + } + }, + "documentsDeleted": { + "target": "com.amazonaws.qbusiness#MetricValue", + "traits": { + "smithy.api#documentation": "The current count of documents deleted from the data source during the data source sync.
" + } + }, + "documentsFailed": { + "target": "com.amazonaws.qbusiness#MetricValue", + "traits": { + "smithy.api#documentation": "The current count of documents that failed to sync from the data source during the data source sync.
" + } + }, + "documentsScanned": { + "target": "com.amazonaws.qbusiness#MetricValue", + "traits": { + "smithy.api#documentation": "The current count of documents crawled by the ongoing sync job in the data source.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Maps a batch delete document request to a specific Amazon Q Business data source connector sync job.
" + } + }, + "com.amazonaws.qbusiness#DataSourceSyncJobStatus": { + "type": "enum", + "members": { + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "SUCCEEDED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SUCCEEDED" + } + }, + "SYNCING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SYNCING" + } + }, + "INCOMPLETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INCOMPLETE" + } + }, + "STOPPING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STOPPING" + } + }, + "ABORTED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ABORTED" + } + }, + "SYNCING_INDEXING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SYNCING_INDEXING" + } + } + } + }, + "com.amazonaws.qbusiness#DataSourceSyncJobs": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#DataSourceSyncJob" + } + }, + "com.amazonaws.qbusiness#DataSourceUserId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^\\P{C}*$" + } + }, + "com.amazonaws.qbusiness#DataSourceVpcConfiguration": { + "type": "structure", + "members": { + "subnetIds": { + "target": "com.amazonaws.qbusiness#SubnetIds", + "traits": { + "smithy.api#documentation": "A list of identifiers for subnets within your Amazon VPC. The subnets should be able to connect to each other in the VPC, and they should have outgoing access to the Internet through a NAT device.
", + "smithy.api#required": {} + } + }, + "securityGroupIds": { + "target": "com.amazonaws.qbusiness#SecurityGroupIds", + "traits": { + "smithy.api#documentation": "A list of identifiers of security groups within your Amazon VPC. The security groups should enable Amazon Q Business to connect to the data source.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Provides configuration information needed to connect to an Amazon VPC (Virtual Private Cloud).
" + } + }, + "com.amazonaws.qbusiness#DataSources": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#DataSource" + } + }, + "com.amazonaws.qbusiness#DateAttributeBoostingConfiguration": { + "type": "structure", + "members": { + "boostingLevel": { + "target": "com.amazonaws.qbusiness#DocumentAttributeBoostingLevel", + "traits": { + "smithy.api#documentation": "Specifies the priority tier ranking of boosting applied to document attributes. For version 2, this parameter indicates the relative ranking between boosted fields (ONE being highest priority, TWO being second highest, etc.) and determines the order in which attributes influence document ranking in search results. For version 1, this parameter specifies the boosting intensity. For version 2, boosting intensity (VERY HIGH, HIGH, MEDIUM, LOW, NONE) are not supported. Note that in version 2, you are not allowed to boost on only one field and make this value TWO.
", + "smithy.api#required": {} + } + }, + "boostingDurationInSeconds": { + "target": "com.amazonaws.qbusiness#BoostingDurationInSeconds", + "traits": { + "smithy.api#documentation": "Specifies the duration, in seconds, of a boost applies to a DATE type document attribute.
Provides information on boosting DATE type document attributes.
For more information on how boosting document attributes work in Amazon Q Business, see Boosting using document attributes.
" + } + }, + "com.amazonaws.qbusiness#DeleteApplication": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteApplicationRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteApplicationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetApplication", + "kms:RetireGrant", + "sso:DeleteApplication" + ], + "smithy.api#documentation": "Deletes an Amazon Q Business application.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DeleteApplicationRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteApplicationResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeleteAttachment": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteAttachmentRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteAttachmentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#LicenseNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Deletes an attachment associated with a specific Amazon Q Business conversation.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/conversations/{conversationId}/attachments/{attachmentId}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DeleteAttachmentRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier for the Amazon Q Business application environment.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the conversation.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "attachmentId": { + "target": "com.amazonaws.qbusiness#AttachmentId", + "traits": { + "smithy.api#documentation": "The unique identifier for the attachment.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#UserId", + "traits": { + "smithy.api#documentation": "The unique identifier of the user involved in the conversation.
", + "smithy.api#httpQuery": "userId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteAttachmentResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeleteChatControlsConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteChatControlsConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteChatControlsConfigurationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Deletes chat controls configured for an existing Amazon Q Business application.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/chatcontrols", + "method": "DELETE", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DeleteChatControlsConfigurationRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application the chat controls have been configured for.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteChatControlsConfigurationResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeleteChatResponseConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteChatResponseConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteChatResponseConfigurationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "requiredActions": [ + "qbusiness:GetChatResponseConfiguration" + ] + }, + "smithy.api#documentation": "Deletes a specified chat response configuration from an Amazon Q Business application.
", + "smithy.api#http": { + "method": "DELETE", + "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DeleteChatResponseConfigurationRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of theAmazon Q Business application from which to delete the chat response configuration.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "chatResponseConfigurationId": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the chat response configuration to delete from the specified application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteChatResponseConfigurationResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeleteConversation": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteConversationRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteConversationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#LicenseNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Deletes an Amazon Q Business web experience conversation.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/conversations/{conversationId}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DeleteConversationRequest": { + "type": "structure", + "members": { + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business web experience conversation being deleted.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application associated with the conversation.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#UserId", + "traits": { + "smithy.api#documentation": "The identifier of the user who is deleting the conversation.
", + "smithy.api#httpQuery": "userId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteConversationResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeleteDataAccessor": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteDataAccessorRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteDataAccessorResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetDataAccessor" + ], + "smithy.api#documentation": "Deletes a specified data accessor. This operation permanently removes the data accessor and its associated IAM Identity Center application. Any access granted to the ISV through this data accessor will be revoked.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DeleteDataAccessorRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataAccessorId": { + "target": "com.amazonaws.qbusiness#DataAccessorId", + "traits": { + "smithy.api#documentation": "The unique identifier of the data accessor to delete.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteDataAccessorResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeleteDataSource": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteDataSourceRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteDataSourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetDataSource" + ], + "smithy.api#documentation": "Deletes an Amazon Q Business data source connector. While the data source is being deleted, the Status field returned by a call to the DescribeDataSource API is set to DELETING.
The identifier of the Amazon Q Business application used with the data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index used with the data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source connector that you want to delete.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteDataSourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeleteDocument": { + "type": "structure", + "members": { + "documentId": { + "target": "com.amazonaws.qbusiness#DocumentId", + "traits": { + "smithy.api#documentation": "The identifier of the deleted document.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A document deleted from an Amazon Q Business data source connector.
" + } + }, + "com.amazonaws.qbusiness#DeleteDocuments": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#DeleteDocument" + } + }, + "com.amazonaws.qbusiness#DeleteGroup": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteGroupRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteGroupResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Deletes a group so that all users and sub groups that belong to the group can no longer access documents only available to that group. For example, after deleting the group \"Summer Interns\", all interns who belonged to that group no longer see intern-only documents in their chat results.
If you want to delete, update, or replace users or sub groups of a group, you need to use the PutGroup operation. For example, if a user in the group \"Engineering\" leaves the engineering team and another user takes their place, you provide an updated list of users or sub groups that belong to the \"Engineering\" group when calling PutGroup.
The identifier of the application in which the group mapping belongs.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index you want to delete the group from.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "groupName": { + "target": "com.amazonaws.qbusiness#GroupName", + "traits": { + "smithy.api#documentation": "The name of the group you want to delete.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source linked to the group
A group can be tied to multiple data sources. You can delete a group from accessing documents in a certain data source. For example, the groups \"Research\", \"Engineering\", and \"Sales and Marketing\" are all tied to the company's documents stored in the data sources Confluence and Salesforce. You want to delete \"Research\" and \"Engineering\" groups from Salesforce, so that these groups cannot access customer-related documents stored in Salesforce. Only \"Sales and Marketing\" should access documents in the Salesforce data source.
", + "smithy.api#httpQuery": "dataSourceId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteGroupResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeleteIndex": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteIndexRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteIndexResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetIndex" + ], + "smithy.api#documentation": "Deletes an Amazon Q Business index.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/indices/{indexId}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DeleteIndexRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application the Amazon Q Business index is linked to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business index.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteIndexResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeletePlugin": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeletePluginRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeletePluginResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetPlugin" + ], + "smithy.api#documentation": "Deletes an Amazon Q Business plugin.
", + "smithy.api#http": { + "method": "DELETE", + "uri": "/applications/{applicationId}/plugins/{pluginId}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DeletePluginRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier the application attached to the Amazon Q Business plugin.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the plugin being deleted.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeletePluginResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeleteRetriever": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteRetrieverRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteRetrieverResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetRetriever" + ], + "smithy.api#documentation": "Deletes the retriever used by an Amazon Q Business application.
", + "smithy.api#http": { + "method": "DELETE", + "uri": "/applications/{applicationId}/retrievers/{retrieverId}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DeleteRetrieverRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application using the retriever.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "retrieverId": { + "target": "com.amazonaws.qbusiness#RetrieverId", + "traits": { + "smithy.api#documentation": "The identifier of the retriever being deleted.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteRetrieverResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeleteUser": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteUserRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteUserResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Deletes a user by email id.
", + "smithy.api#http": { + "method": "DELETE", + "uri": "/applications/{applicationId}/users/{userId}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DeleteUserRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application from which the user is being deleted.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The user email being deleted.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteUserResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DeleteWebExperience": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DeleteWebExperienceRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DeleteWebExperienceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetWebExperience" + ], + "smithy.api#documentation": "Deletes an Amazon Q Business web experience.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DeleteWebExperienceRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application linked to the Amazon Q Business web experience.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "webExperienceId": { + "target": "com.amazonaws.qbusiness#WebExperienceId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business web experience being deleted.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DeleteWebExperienceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#Description": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1000 + }, + "smithy.api#pattern": "^[\\s\\S]*$" + } + }, + "com.amazonaws.qbusiness#DisassociatePermission": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#DisassociatePermissionRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#DisassociatePermissionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Removes a permission policy from a Amazon Q Business application, revoking the cross-account access that was previously granted to an ISV. This operation deletes the specified policy statement from the application's permission policy.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/policy/{statementId}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#DisassociatePermissionRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "statementId": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The statement ID of the permission to remove.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#DisassociatePermissionResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#DisplayName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#Document": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.qbusiness#DocumentId", + "traits": { + "smithy.api#documentation": "The identifier of the document.
", + "smithy.api#required": {} + } + }, + "attributes": { + "target": "com.amazonaws.qbusiness#DocumentAttributes", + "traits": { + "smithy.api#documentation": "Custom attributes to apply to the document for refining Amazon Q Business web experience responses.
" + } + }, + "content": { + "target": "com.amazonaws.qbusiness#DocumentContent", + "traits": { + "smithy.api#documentation": "The contents of the document.
" + } + }, + "contentType": { + "target": "com.amazonaws.qbusiness#ContentType", + "traits": { + "smithy.api#documentation": "The file type of the document in the Blob field.
If you want to index snippets or subsets of HTML documents instead of the entirety of the HTML documents, you add the HTML start and closing tags (<HTML>content</HTML>) around the content.
The title of the document.
" + } + }, + "accessConfiguration": { + "target": "com.amazonaws.qbusiness#AccessConfiguration", + "traits": { + "smithy.api#documentation": "Configuration information for access permission to a document.
" + } + }, + "documentEnrichmentConfiguration": { + "target": "com.amazonaws.qbusiness#DocumentEnrichmentConfiguration", + "traits": { + "smithy.api#documentation": "The configuration information for altering document metadata and content during the document ingestion process.
" + } + }, + "mediaExtractionConfiguration": { + "target": "com.amazonaws.qbusiness#MediaExtractionConfiguration", + "traits": { + "smithy.api#documentation": "The configuration for extracting information from media in the document.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A document in an Amazon Q Business application.
" + } + }, + "com.amazonaws.qbusiness#DocumentAcl": { + "type": "structure", + "members": { + "allowlist": { + "target": "com.amazonaws.qbusiness#DocumentAclMembership", + "traits": { + "smithy.api#documentation": "The allowlist conditions for the document. Users or groups matching these conditions are granted access to the document.
" + } + }, + "denyList": { + "target": "com.amazonaws.qbusiness#DocumentAclMembership", + "traits": { + "smithy.api#documentation": "The denylist conditions for the document. Users or groups matching these conditions are denied access to the document, overriding allowlist permissions.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the Access Control List (ACL) for a document, containing both allowlist and denylist conditions.
" + } + }, + "com.amazonaws.qbusiness#DocumentAclCondition": { + "type": "structure", + "members": { + "memberRelation": { + "target": "com.amazonaws.qbusiness#MemberRelation", + "traits": { + "smithy.api#documentation": "The logical relation between members in the condition, determining how multiple user or group conditions are combined.
" + } + }, + "users": { + "target": "com.amazonaws.qbusiness#DocumentAclUsers", + "traits": { + "smithy.api#documentation": "An array of user identifiers that this condition applies to. Users listed here are subject to the access rule defined by this condition.
" + } + }, + "groups": { + "target": "com.amazonaws.qbusiness#DocumentAclGroups", + "traits": { + "smithy.api#documentation": "An array of group identifiers that this condition applies to. Groups listed here are subject to the access rule defined by this condition.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Represents a condition in the document's ACL, specifying access rules for users and groups.
" + } + }, + "com.amazonaws.qbusiness#DocumentAclConditions": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#DocumentAclCondition" + } + }, + "com.amazonaws.qbusiness#DocumentAclGroup": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.qbusiness#GroupName", + "traits": { + "smithy.api#documentation": "The name of the group in the document's ACL. This is used to identify the group when applying access rules.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#MembershipType", + "traits": { + "smithy.api#documentation": "The type of the group. This indicates the scope of the group's applicability in access control.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Represents a group in the document's ACL, used to define access permissions for multiple users collectively.
" + } + }, + "com.amazonaws.qbusiness#DocumentAclGroups": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#DocumentAclGroup" + } + }, + "com.amazonaws.qbusiness#DocumentAclMembership": { + "type": "structure", + "members": { + "memberRelation": { + "target": "com.amazonaws.qbusiness#MemberRelation", + "traits": { + "smithy.api#documentation": "The logical relation between members in the membership rule, determining how multiple conditions are combined.
" + } + }, + "conditions": { + "target": "com.amazonaws.qbusiness#DocumentAclConditions", + "traits": { + "smithy.api#documentation": "An array of conditions that define the membership rules. Each condition specifies criteria for users or groups to be included in this membership.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Represents membership rules in the document's ACL, defining how users or groups are associated with access permissions.
" + } + }, + "com.amazonaws.qbusiness#DocumentAclUser": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The unique identifier of the user in the document's ACL. This is used to identify the user when applying access rules.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#MembershipType", + "traits": { + "smithy.api#documentation": "The type of the user. This indicates the scope of the user's applicability in access control.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Represents a user in the document's ACL, used to define access permissions for individual users.
" + } + }, + "com.amazonaws.qbusiness#DocumentAclUsers": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#DocumentAclUser" + } + }, + "com.amazonaws.qbusiness#DocumentAttribute": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.qbusiness#DocumentAttributeKey", + "traits": { + "smithy.api#documentation": "The identifier for the attribute.
", + "smithy.api#required": {} + } + }, + "value": { + "target": "com.amazonaws.qbusiness#DocumentAttributeValue", + "traits": { + "smithy.api#documentation": "The value of the attribute.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A document attribute or metadata field.
" + } + }, + "com.amazonaws.qbusiness#DocumentAttributeBoostingConfiguration": { + "type": "union", + "members": { + "numberConfiguration": { + "target": "com.amazonaws.qbusiness#NumberAttributeBoostingConfiguration", + "traits": { + "smithy.api#documentation": "Provides information on boosting NUMBER type document attributes.
NUMBER attributes are not supported when using NativeIndexConfiguration version 2, which focuses on DATE attributes for recency and STRING attributes for source prioritization.
Provides information on boosting STRING type document attributes.
Version 2 assigns priority tiers to STRING attributes, establishing clear hierarchical relationships with other boosted attributes.
Provides information on boosting DATE type document attributes.
Version 2 assigns priority tiers to DATE attributes, establishing clear hierarchical relationships with other boosted attributes.
Provides information on boosting STRING_LIST type document attributes.
STRING_LIST attributes are not supported when using NativeIndexConfiguration version 2, which focuses on DATE attributes for recency and STRING attributes for source prioritization.
Provides information on boosting supported Amazon Q Business document attribute types. When an end user chat query matches document attributes that have been boosted, Amazon Q Business prioritizes generating responses from content that matches the boosted document attributes.
In version 2, boosting uses numeric values (ONE, TWO) to indicate priority tiers that establish clear hierarchical relationships between boosted attributes. This allows for more precise control over how different attributes influence search results.
For STRING and STRING_LIST type document attributes to be used for boosting on the console and the API, they must be enabled for search using the DocumentAttributeConfiguration object of the UpdateIndex API. If you haven't enabled searching on these attributes, you can't boost attributes of these data types on either the console or the API.
For more information on how boosting document attributes work in Amazon Q Business, see Boosting using document attributes.
" + } + }, + "com.amazonaws.qbusiness#DocumentAttributeBoostingLevel": { + "type": "enum", + "members": { + "NONE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NONE" + } + }, + "LOW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOW" + } + }, + "MEDIUM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEDIUM" + } + }, + "HIGH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HIGH" + } + }, + "VERY_HIGH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VERY_HIGH" + } + }, + "ONE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ONE" + } + }, + "TWO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TWO" + } + } + } + }, + "com.amazonaws.qbusiness#DocumentAttributeBoostingOverrideMap": { + "type": "map", + "key": { + "target": "com.amazonaws.qbusiness#DocumentAttributeKey" + }, + "value": { + "target": "com.amazonaws.qbusiness#DocumentAttributeBoostingConfiguration" + }, + "traits": { + "smithy.api#length": { + "min": 1 + } + } + }, + "com.amazonaws.qbusiness#DocumentAttributeCondition": { + "type": "structure", + "members": { + "key": { + "target": "com.amazonaws.qbusiness#DocumentAttributeKey", + "traits": { + "smithy.api#documentation": "The identifier of the document attribute used for the condition.
For example, 'Source_URI' could be an identifier for the attribute or metadata field that contains source URIs associated with the documents.
Amazon Q Business currently doesn't support _document_body as an attribute key used for the condition.
The identifier of the document attribute used for the condition.
For example, 'Source_URI' could be an identifier for the attribute or metadata field that contains source URIs associated with the documents.
Amazon Q Business currently does not support _document_body as an attribute key used for the condition.
The condition used for the target document attribute or metadata field when ingesting documents into Amazon Q Business. You use this with DocumentAttributeTarget to apply the condition.
For example, you can create the 'Department' target field and have it prefill department names associated with the documents based on information in the 'Source_URI' field. Set the condition that if the 'Source_URI' field contains 'financial' in its URI value, then prefill the target field 'Department' with the target value 'Finance' for the document.
Amazon Q Business can't create a target field if it has not already been created as an index field. After you create your index field, you can create a document metadata field using DocumentAttributeTarget. Amazon Q Business then will map your newly created metadata field to your index field.
The name of the document attribute.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#AttributeType", + "traits": { + "smithy.api#documentation": "The type of document attribute.
" + } + }, + "search": { + "target": "com.amazonaws.qbusiness#Status", + "traits": { + "smithy.api#documentation": "Information about whether the document attribute can be used by an end user to search for information on their web experience.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration information for document attributes. Document attributes are metadata or fields associated with your documents. For example, the company department name associated with each document.
For more information, see Understanding document attributes.
" + } + }, + "com.amazonaws.qbusiness#DocumentAttributeConfigurations": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#DocumentAttributeConfiguration" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 500 + } + } + }, + "com.amazonaws.qbusiness#DocumentAttributeKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 200 + }, + "smithy.api#pattern": "^[a-zA-Z0-9_][a-zA-Z0-9_-]*$" + } + }, + "com.amazonaws.qbusiness#DocumentAttributeStringListValue": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#String" + } + }, + "com.amazonaws.qbusiness#DocumentAttributeStringValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 2048 + } + } + }, + "com.amazonaws.qbusiness#DocumentAttributeTarget": { + "type": "structure", + "members": { + "key": { + "target": "com.amazonaws.qbusiness#DocumentAttributeKey", + "traits": { + "smithy.api#documentation": "The identifier of the target document attribute or metadata field. For example, 'Department' could be an identifier for the target attribute or metadata field that includes the department names associated with the documents.
", + "smithy.api#required": {} + } + }, + "value": { + "target": "com.amazonaws.qbusiness#DocumentAttributeValue" + }, + "attributeValueOperator": { + "target": "com.amazonaws.qbusiness#AttributeValueOperator", + "traits": { + "smithy.api#documentation": " TRUE to delete the existing target value for your specified target attribute key. You cannot create a target value and set this to TRUE.
The target document attribute or metadata field you want to alter when ingesting documents into Amazon Q Business.
For example, you can delete all customer identification numbers associated with the documents, stored in the document metadata field called 'Customer_ID' by setting the target key as 'Customer_ID' and the deletion flag to TRUE. This removes all customer ID values in the field 'Customer_ID'. This would scrub personally identifiable information from each document's metadata.
Amazon Q Business can't create a target field if it has not already been created as an index field. After you create your index field, you can create a document metadata field using DocumentAttributeTarget . Amazon Q Business will then map your newly created document attribute to your index field.
You can also use this with DocumentAttributeCondition .
A string.
", + "smithy.api#length": { + "max": 2048 + } + } + }, + "stringListValue": { + "target": "com.amazonaws.qbusiness#DocumentAttributeStringListValue", + "traits": { + "smithy.api#documentation": "A list of strings.
" + } + }, + "longValue": { + "target": "com.amazonaws.qbusiness#Long", + "traits": { + "smithy.api#documentation": "A long integer value.
" + } + }, + "dateValue": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "A date expressed as an ISO 8601 string.
It's important for the time zone to be included in the ISO 8601 date-time format. For example, 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The value of a document attribute. You can only provide one value for a document attribute.
" + } + }, + "com.amazonaws.qbusiness#DocumentAttributes": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#DocumentAttribute" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 500 + } + } + }, + "com.amazonaws.qbusiness#DocumentContent": { + "type": "union", + "members": { + "blob": { + "target": "smithy.api#Blob", + "traits": { + "smithy.api#documentation": "The contents of the document. Documents passed to the blob parameter must be base64 encoded. Your code might not need to encode the document file bytes if you're using an Amazon Web Services SDK to call Amazon Q Business APIs. If you are calling the Amazon Q Business endpoint directly using REST, you must base64 encode the contents before sending.
The path to the document in an Amazon S3 bucket.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The contents of a document.
Documents have size limitations. The maximum file size for a document is 50 MB. The maximum amount of text that can be extracted from a single document is 5 MB. For more information, see Supported document formats in Amazon Q Business.
The identifier of the document.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#DocumentStatus", + "traits": { + "smithy.api#documentation": "The current status of the document.
" + } + }, + "error": { + "target": "com.amazonaws.qbusiness#ErrorDetail", + "traits": { + "smithy.api#documentation": "An error message associated with the document.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp for when the document was created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp for when the document was last updated.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The details of a document within an Amazon Q Business index.
" + } + }, + "com.amazonaws.qbusiness#DocumentEnrichmentConditionOperator": { + "type": "enum", + "members": { + "GREATER_THAN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GREATER_THAN" + } + }, + "GREATER_THAN_OR_EQUALS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GREATER_THAN_OR_EQUALS" + } + }, + "LESS_THAN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LESS_THAN" + } + }, + "LESS_THAN_OR_EQUALS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LESS_THAN_OR_EQUALS" + } + }, + "EQUALS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EQUALS" + } + }, + "NOT_EQUALS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_EQUALS" + } + }, + "CONTAINS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CONTAINS" + } + }, + "NOT_CONTAINS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_CONTAINS" + } + }, + "EXISTS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EXISTS" + } + }, + "NOT_EXISTS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_EXISTS" + } + }, + "BEGINS_WITH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BEGINS_WITH" + } + } + } + }, + "com.amazonaws.qbusiness#DocumentEnrichmentConfiguration": { + "type": "structure", + "members": { + "inlineConfigurations": { + "target": "com.amazonaws.qbusiness#InlineDocumentEnrichmentConfigurations", + "traits": { + "smithy.api#documentation": "Configuration information to alter document attributes or metadata fields and content when ingesting documents into Amazon Q Business.
" + } + }, + "preExtractionHookConfiguration": { + "target": "com.amazonaws.qbusiness#HookConfiguration" + }, + "postExtractionHookConfiguration": { + "target": "com.amazonaws.qbusiness#HookConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Provides the configuration information for altering document metadata and content during the document ingestion process.
For more information, see Custom document enrichment.
" + } + }, + "com.amazonaws.qbusiness#DocumentId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1825 + }, + "smithy.api#pattern": "^\\P{C}*$" + } + }, + "com.amazonaws.qbusiness#DocumentMetadataConfigurationName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 30 + }, + "smithy.api#pattern": "^[a-zA-Z0-9_][a-zA-Z0-9_-]*$" + } + }, + "com.amazonaws.qbusiness#DocumentStatus": { + "type": "enum", + "members": { + "RECEIVED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RECEIVED" + } + }, + "PROCESSING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PROCESSING" + } + }, + "INDEXED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INDEXED" + } + }, + "UPDATED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPDATED" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + }, + "DELETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETED" + } + }, + "DOCUMENT_FAILED_TO_INDEX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT_FAILED_TO_INDEX" + } + } + } + }, + "com.amazonaws.qbusiness#Documents": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Document" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#EligibleDataSource": { + "type": "structure", + "members": { + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index the data source is attached to.
" + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The identifier of the data source Amazon Q Business will generate responses from.
" + } + }, + "com.amazonaws.qbusiness#EligibleDataSources": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#EligibleDataSource" + }, + "traits": { + "smithy.api#length": { + "max": 5 + } + } + }, + "com.amazonaws.qbusiness#EncryptionConfiguration": { + "type": "structure", + "members": { + "kmsKeyId": { + "target": "com.amazonaws.qbusiness#KmsKeyId", + "traits": { + "smithy.api#documentation": "The identifier of the KMS key. Amazon Q Business doesn't support asymmetric keys.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides the identifier of the KMS key used to encrypt data indexed by Amazon Q Business. Amazon Q Business doesn't support asymmetric keys.
" + } + }, + "com.amazonaws.qbusiness#EndOfInputEvent": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "The end of the streaming input for the Chat API.
The message explaining the Amazon Q Business request error.
" + } + }, + "errorCode": { + "target": "com.amazonaws.qbusiness#ErrorCode", + "traits": { + "smithy.api#documentation": "The code associated with the Amazon Q Business request error.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information about a Amazon Q Business request error.
" + } + }, + "com.amazonaws.qbusiness#ErrorMessage": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^[\\s\\S]*$" + } + }, + "com.amazonaws.qbusiness#ExampleChatMessage": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 350 + }, + "smithy.api#pattern": "^\\P{C}*$" + } + }, + "com.amazonaws.qbusiness#ExampleChatMessages": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#ExampleChatMessage" + }, + "traits": { + "smithy.api#length": { + "max": 5 + } + } + }, + "com.amazonaws.qbusiness#ExecutionId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#ExpertQ": { + "type": "service", + "version": "2023-11-27", + "operations": [ + { + "target": "com.amazonaws.qbusiness#AssociatePermission" + }, + { + "target": "com.amazonaws.qbusiness#BatchDeleteDocument" + }, + { + "target": "com.amazonaws.qbusiness#BatchPutDocument" + }, + { + "target": "com.amazonaws.qbusiness#CancelSubscription" + }, + { + "target": "com.amazonaws.qbusiness#Chat" + }, + { + "target": "com.amazonaws.qbusiness#ChatSync" + }, + { + "target": "com.amazonaws.qbusiness#CheckDocumentAccess" + }, + { + "target": "com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrl" + }, + { + "target": "com.amazonaws.qbusiness#CreateChatResponseConfiguration" + }, + { + "target": "com.amazonaws.qbusiness#CreateSubscription" + }, + { + "target": "com.amazonaws.qbusiness#CreateUser" + }, + { + "target": "com.amazonaws.qbusiness#DeleteAttachment" + }, + { + "target": "com.amazonaws.qbusiness#DeleteChatControlsConfiguration" + }, + { + "target": "com.amazonaws.qbusiness#DeleteChatResponseConfiguration" + }, + { + "target": "com.amazonaws.qbusiness#DeleteConversation" + }, + { + "target": "com.amazonaws.qbusiness#DeleteGroup" + }, + { + "target": "com.amazonaws.qbusiness#DeleteUser" + }, + { + "target": "com.amazonaws.qbusiness#DisassociatePermission" + }, + { + "target": "com.amazonaws.qbusiness#GetChatControlsConfiguration" + }, + { + "target": "com.amazonaws.qbusiness#GetChatResponseConfiguration" + }, + { + "target": "com.amazonaws.qbusiness#GetDocumentContent" + }, + { + "target": "com.amazonaws.qbusiness#GetGroup" + }, + { + "target": "com.amazonaws.qbusiness#GetMedia" + }, + { + "target": "com.amazonaws.qbusiness#GetPolicy" + }, + { + "target": "com.amazonaws.qbusiness#GetUser" + }, + { + "target": "com.amazonaws.qbusiness#ListAttachments" + }, + { + "target": "com.amazonaws.qbusiness#ListChatResponseConfigurations" + }, + { + "target": "com.amazonaws.qbusiness#ListConversations" + }, + { + "target": "com.amazonaws.qbusiness#ListDataSourceSyncJobs" + }, + { + "target": "com.amazonaws.qbusiness#ListDocuments" + }, + { + "target": "com.amazonaws.qbusiness#ListGroups" + }, + { + "target": "com.amazonaws.qbusiness#ListMessages" + }, + { + "target": "com.amazonaws.qbusiness#ListPluginActions" + }, + { + "target": "com.amazonaws.qbusiness#ListPluginTypeActions" + }, + { + "target": "com.amazonaws.qbusiness#ListPluginTypeMetadata" + }, + { + "target": "com.amazonaws.qbusiness#ListSubscriptions" + }, + { + "target": "com.amazonaws.qbusiness#ListTagsForResource" + }, + { + "target": "com.amazonaws.qbusiness#PutFeedback" + }, + { + "target": "com.amazonaws.qbusiness#PutGroup" + }, + { + "target": "com.amazonaws.qbusiness#SearchRelevantContent" + }, + { + "target": "com.amazonaws.qbusiness#StartDataSourceSyncJob" + }, + { + "target": "com.amazonaws.qbusiness#StopDataSourceSyncJob" + }, + { + "target": "com.amazonaws.qbusiness#TagResource" + }, + { + "target": "com.amazonaws.qbusiness#UntagResource" + }, + { + "target": "com.amazonaws.qbusiness#UpdateChatControlsConfiguration" + }, + { + "target": "com.amazonaws.qbusiness#UpdateChatResponseConfiguration" + }, + { + "target": "com.amazonaws.qbusiness#UpdateSubscription" + }, + { + "target": "com.amazonaws.qbusiness#UpdateUser" + } + ], + "resources": [ + { + "target": "com.amazonaws.qbusiness#ApplicationResource" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "QBusiness", + "cloudFormationName": "QBusiness", + "arnNamespace": "qbusiness", + "cloudTrailEventSource": "qbusiness.amazonaws.com" + }, + "aws.auth#sigv4": { + "name": "qbusiness" + }, + "aws.protocols#restJson1": { + "http": [ + "h2", + "http/1.1" + ], + "eventStreamHttp": [ + "h2" + ] + }, + "smithy.api#documentation": "This is the Amazon Q Business API Reference. Amazon Q Business is a fully managed, generative-AI powered enterprise chat assistant that you can deploy within your organization. Amazon Q Business enhances employee productivity by supporting key tasks such as question-answering, knowledge discovery, writing email messages, summarizing text, drafting document outlines, and brainstorming ideas. Users ask questions of Amazon Q Business and get answers that are presented in a conversational manner. For an introduction to the service, see the Amazon Q Business User Guide .
For an overview of the Amazon Q Business APIs, see Overview of Amazon Q Business API operations.
For information about the IAM access control permissions you need to use this API, see IAM roles for Amazon Q Business in the Amazon Q Business User Guide.
The following resources provide additional information about using the Amazon Q Business API:
An external resource that you configured with your application is returning errors and preventing this operation from succeeding. Fix those errors and try again.
", + "smithy.api#error": "client", + "smithy.api#httpError": 424 + } + }, + "com.amazonaws.qbusiness#FailedAttachmentEvent": { + "type": "structure", + "members": { + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the conversation associated with the failed file upload.
" + } + }, + "userMessageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier of the end user chat message associated with the file upload.
" + } + }, + "systemMessageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier of the AI-generated message associated with the file upload.
" + } + }, + "attachment": { + "target": "com.amazonaws.qbusiness#AttachmentOutput" + } + }, + "traits": { + "smithy.api#documentation": "A failed file upload during web experience chat.
" + } + }, + "com.amazonaws.qbusiness#FailedDocument": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.qbusiness#DocumentId", + "traits": { + "smithy.api#documentation": "The identifier of the document that couldn't be removed from the Amazon Q Business index.
" + } + }, + "error": { + "target": "com.amazonaws.qbusiness#ErrorDetail", + "traits": { + "smithy.api#documentation": "An explanation for why the document couldn't be removed from the index.
" + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business data source connector that contains the failed document.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A list of documents that could not be removed from an Amazon Q Business index. Each entry contains an error message that indicates why the document couldn't be removed from the index.
" + } + }, + "com.amazonaws.qbusiness#FailedDocuments": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#FailedDocument" + } + }, + "com.amazonaws.qbusiness#FaviconUrl": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^(https?://[a-zA-Z0-9-_.+%/]+\\.(svg|ico))?$" + } + }, + "com.amazonaws.qbusiness#FontUrl": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^(https?://[a-zA-Z0-9-_.+%/]+\\.(ttf|woff|woff2|otf))?$" + } + }, + "com.amazonaws.qbusiness#GetApplication": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetApplicationRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetApplicationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:ListTagsForResource" + ], + "smithy.api#documentation": "Gets information about an existing Amazon Q Business application.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetApplicationRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetApplicationResponse": { + "type": "structure", + "members": { + "displayName": { + "target": "com.amazonaws.qbusiness#ApplicationName", + "traits": { + "smithy.api#documentation": "The name of the Amazon Q Business application.
" + } + }, + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application.
" + } + }, + "applicationArn": { + "target": "com.amazonaws.qbusiness#ApplicationArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the Amazon Q Business application.
" + } + }, + "identityType": { + "target": "com.amazonaws.qbusiness#IdentityType", + "traits": { + "smithy.api#documentation": "The authentication type being used by a Amazon Q Business application.
" + } + }, + "iamIdentityProviderArn": { + "target": "com.amazonaws.qbusiness#IAMIdentityProviderArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of an identity provider being used by an Amazon Q Business application.
" + } + }, + "identityCenterApplicationArn": { + "target": "com.amazonaws.qbusiness#IdcApplicationArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the AWS IAM Identity Center instance attached to your Amazon Q Business application.
" + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM with permissions to access your CloudWatch logs and metrics.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#ApplicationStatus", + "traits": { + "smithy.api#documentation": "The status of the Amazon Q Business application.
" + } + }, + "description": { + "target": "com.amazonaws.qbusiness#Description", + "traits": { + "smithy.api#documentation": "A description for the Amazon Q Business application.
" + } + }, + "encryptionConfiguration": { + "target": "com.amazonaws.qbusiness#EncryptionConfiguration", + "traits": { + "aws.cloudformation#cfnMutability": "create-and-read", + "smithy.api#documentation": "The identifier of the Amazon Web Services KMS key that is used to encrypt your data. Amazon Q Business doesn't support asymmetric keys.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business application was last updated.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business application was last updated.
" + } + }, + "error": { + "target": "com.amazonaws.qbusiness#ErrorDetail", + "traits": { + "aws.cloudformation#cfnExcludeProperty": {}, + "smithy.api#documentation": "If the Status field is set to ERROR, the ErrorMessage field contains a description of the error that caused the synchronization to fail.
Settings for whether end users can upload files directly during chat.
" + } + }, + "qAppsConfiguration": { + "target": "com.amazonaws.qbusiness#QAppsConfiguration", + "traits": { + "smithy.api#documentation": "Settings for whether end users can create and use Amazon Q Apps in the web experience.
" + } + }, + "personalizationConfiguration": { + "target": "com.amazonaws.qbusiness#PersonalizationConfiguration", + "traits": { + "smithy.api#documentation": "Configuration information about chat response personalization. For more information, see Personalizing chat responses.
" + } + }, + "autoSubscriptionConfiguration": { + "target": "com.amazonaws.qbusiness#AutoSubscriptionConfiguration", + "traits": { + "smithy.api#documentation": "Settings for auto-subscription behavior for this application. This is only applicable to SAML and OIDC applications.
" + } + }, + "clientIdsForOIDC": { + "target": "com.amazonaws.qbusiness#ClientIdsForOIDC", + "traits": { + "smithy.api#documentation": "The OIDC client ID for a Amazon Q Business application.
" + } + }, + "quickSightConfiguration": { + "target": "com.amazonaws.qbusiness#QuickSightConfiguration", + "traits": { + "smithy.api#documentation": "The Amazon Quick Suite authentication configuration for the Amazon Q Business application.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetChatControlsConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetChatControlsConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetChatControlsConfigurationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Gets information about chat controls configured for an existing Amazon Q Business application.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/chatcontrols", + "method": "GET", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "topicConfigurations" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetChatControlsConfigurationRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application for which the chat controls are configured.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "maxResults": { + "target": "com.amazonaws.qbusiness#MaxResultsIntegerForGetTopicConfigurations", + "traits": { + "smithy.api#documentation": "The maximum number of configured chat controls to return.
", + "smithy.api#httpQuery": "maxResults" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of Amazon Q Business chat controls configured.
The response scope configured for a Amazon Q Business application. This determines whether your application uses its retrieval augmented generation (RAG) system to generate answers only from your enterprise data, or also uses the large language models (LLM) knowledge to respons to end user questions in chat.
" + } + }, + "orchestrationConfiguration": { + "target": "com.amazonaws.qbusiness#AppliedOrchestrationConfiguration", + "traits": { + "smithy.api#documentation": "The chat response orchestration settings for your application.
Chat orchestration is optimized to work for English language content. For more details on language support in Amazon Q Business, see Supported languages.
The phrases blocked from chat by your chat control configuration.
" + } + }, + "topicConfigurations": { + "target": "com.amazonaws.qbusiness#TopicConfigurations", + "traits": { + "smithy.api#documentation": "The topic specific controls configured for a Amazon Q Business application.
" + } + }, + "creatorModeConfiguration": { + "target": "com.amazonaws.qbusiness#AppliedCreatorModeConfiguration", + "traits": { + "smithy.api#documentation": "The configuration details for CREATOR_MODE.
If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of Amazon Q Business chat controls configured.
The hallucination reduction settings for your application.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetChatResponseConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetChatResponseConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetChatResponseConfigurationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "requiredActions": [ + "qbusiness:ListTagsForResource" + ] + }, + "smithy.api#documentation": "Retrieves detailed information about a specific chat response configuration from an Amazon Q Business application. This operation returns the complete configuration settings and metadata.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetChatResponseConfigurationRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application containing the chat response configuration to retrieve.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "chatResponseConfigurationId": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the chat response configuration to retrieve from the specified application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetChatResponseConfigurationResponse": { + "type": "structure", + "members": { + "chatResponseConfigurationId": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the retrieved chat response configuration.
" + } + }, + "chatResponseConfigurationArn": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the retrieved chat response configuration, which uniquely identifies the resource across all Amazon Web Services services.
" + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#DisplayName", + "traits": { + "smithy.api#documentation": "The human-readable name of the retrieved chat response configuration, making it easier to identify among multiple configurations.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp indicating when the chat response configuration was initially created.
" + } + }, + "inUseConfiguration": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationDetail", + "traits": { + "smithy.api#documentation": "The currently active configuration settings that are being used to generate responses in the Amazon Q Business application.
" + } + }, + "lastUpdateConfiguration": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationDetail", + "traits": { + "smithy.api#documentation": "Information about the most recent update to the configuration, including timestamp and modification details.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetDataAccessor": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetDataAccessorRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetDataAccessorResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:ListTagsForResource" + ], + "smithy.api#documentation": "Retrieves information about a specified data accessor. This operation returns details about the data accessor, including its display name, unique identifier, Amazon Resource Name (ARN), the associated Amazon Q Business application and IAM Identity Center application, the IAM role for the ISV, the action configurations, and the timestamps for when the data accessor was created and last updated.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetDataAccessorRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataAccessorId": { + "target": "com.amazonaws.qbusiness#DataAccessorId", + "traits": { + "smithy.api#documentation": "The unique identifier of the data accessor to retrieve.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetDataAccessorResponse": { + "type": "structure", + "members": { + "displayName": { + "target": "com.amazonaws.qbusiness#DataAccessorName", + "traits": { + "smithy.api#documentation": "The friendly name of the data accessor.
" + } + }, + "dataAccessorId": { + "target": "com.amazonaws.qbusiness#DataAccessorId", + "traits": { + "smithy.api#documentation": "The unique identifier of the data accessor.
" + } + }, + "dataAccessorArn": { + "target": "com.amazonaws.qbusiness#DataAccessorArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the data accessor.
" + } + }, + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application associated with this data accessor.
" + } + }, + "idcApplicationArn": { + "target": "com.amazonaws.qbusiness#IdcApplicationArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM Identity Center application associated with this data accessor.
" + } + }, + "principal": { + "target": "com.amazonaws.qbusiness#PrincipalRoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM role for the ISV associated with this data accessor.
" + } + }, + "actionConfigurations": { + "target": "com.amazonaws.qbusiness#ActionConfigurationList", + "traits": { + "smithy.api#documentation": "The list of action configurations specifying the allowed actions and any associated filters.
" + } + }, + "authenticationDetail": { + "target": "com.amazonaws.qbusiness#DataAccessorAuthenticationDetail", + "traits": { + "smithy.api#documentation": "The authentication configuration details for the data accessor. This specifies how the ISV authenticates when accessing data through this data accessor.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp when the data accessor was created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp when the data accessor was last updated.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetDataSource": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetDataSourceRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetDataSourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:ListTagsForResource" + ], + "smithy.api#documentation": "Gets information about an existing Amazon Q Business data source connector.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetDataSourceRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identfier of the index used with the data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetDataSourceResponse": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application.
" + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index linked to the data source connector.
" + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source connector.
" + } + }, + "dataSourceArn": { + "target": "com.amazonaws.qbusiness#DataSourceArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the data source.
" + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#DataSourceName", + "traits": { + "smithy.api#documentation": "The name for the data source connector.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The type of the data source connector. For example, S3.
The details of how the data source connector is configured.
" + } + }, + "vpcConfiguration": { + "target": "com.amazonaws.qbusiness#DataSourceVpcConfiguration", + "traits": { + "smithy.api#documentation": "Configuration information for an Amazon VPC (Virtual Private Cloud) to connect to your data source.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the data source connector was created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the data source connector was last updated.
" + } + }, + "description": { + "target": "com.amazonaws.qbusiness#Description", + "traits": { + "smithy.api#documentation": "The description for the data source connector.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#DataSourceStatus", + "traits": { + "smithy.api#documentation": "The current status of the data source connector. When the Status field value is FAILED, the ErrorMessage field contains a description of the error that caused the data source connector to fail.
The schedule for Amazon Q Business to update the index.
" + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the role with permission to access the data source and required resources.
" + } + }, + "error": { + "target": "com.amazonaws.qbusiness#ErrorDetail", + "traits": { + "aws.cloudformation#cfnExcludeProperty": {}, + "smithy.api#documentation": "When the Status field value is FAILED, the ErrorMessage field contains a description of the error that caused the data source connector to fail.
The configuration for extracting information from media in documents for the data source.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetDocumentContent": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetDocumentContentRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetDocumentContentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Retrieves the content of a document that was ingested into Amazon Q Business. This API validates user authorization against document ACLs before returning a pre-signed URL for secure document access. You can download or view source documents referenced in chat responses through the URL.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/index/{indexId}/documents/{documentId}/content", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetDocumentContentRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application containing the document. This ensures the request is scoped to the correct application environment and its associated security policies.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index where documents are indexed.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source from which the document was ingested. This field is not present if the document is ingested by directly calling the BatchPutDocument API. If the document is from a file-upload data source, the datasource will be \"uploaded-docs-file-stat-datasourceid\".
", + "smithy.api#httpQuery": "dataSourceId" + } + }, + "documentId": { + "target": "com.amazonaws.qbusiness#DocumentId", + "traits": { + "smithy.api#documentation": "The unique identifier of the document that is indexed via BatchPutDocument API or file-upload or connector sync. It is also found in chat or chatSync response.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "outputFormat": { + "target": "com.amazonaws.qbusiness#OutputFormat", + "traits": { + "smithy.api#documentation": "Document outputFormat. Defaults to RAW if not selected.
", + "smithy.api#httpQuery": "outputFormat" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetDocumentContentResponse": { + "type": "structure", + "members": { + "presignedUrl": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "A pre-signed URL that provides temporary access to download the document content directly from Amazon Q Business. The URL expires after 5 minutes for security purposes. This URL is generated only after successful ACL validation.
", + "smithy.api#required": {} + } + }, + "mimeType": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The MIME type of the document content. When outputFormat is RAW, this corresponds to the original document's MIME type (e.g., application/pdf, text/plain, application/vnd.openxmlformats-officedocument.wordprocessingml.document). When outputFormat is EXTRACTED, the MIME type is always application/json.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetGroup": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetGroupRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetGroupResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Describes a group by group name.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/indices/{indexId}/groups/{groupName}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetGroupRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application id the group is attached to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index the group is attached to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "groupName": { + "target": "com.amazonaws.qbusiness#GroupName", + "traits": { + "smithy.api#documentation": "The name of the group.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source the group is attached to.
", + "smithy.api#httpQuery": "dataSourceId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetGroupResponse": { + "type": "structure", + "members": { + "status": { + "target": "com.amazonaws.qbusiness#GroupStatusDetail", + "traits": { + "smithy.api#documentation": "The current status of the group.
" + } + }, + "statusHistory": { + "target": "com.amazonaws.qbusiness#GroupStatusDetails", + "traits": { + "smithy.api#documentation": "The status history of the group.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetIndex": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetIndexRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetIndexResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:ListTagsForResource" + ], + "smithy.api#documentation": "Gets information about an existing Amazon Q Business index.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/indices/{indexId}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetIndexRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application connected to the index.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business index you want information on.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetIndexResponse": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application associated with the index.
" + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business index.
" + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#IndexName", + "traits": { + "smithy.api#documentation": "The name of the Amazon Q Business index.
" + } + }, + "indexArn": { + "target": "com.amazonaws.qbusiness#IndexArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the Amazon Q Business index.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#IndexStatus", + "traits": { + "smithy.api#documentation": "The current status of the index. When the value is ACTIVE, the index is ready for use. If the Status field value is FAILED, the ErrorMessage field contains a message that explains why.
The type of index attached to your Amazon Q Business application.
" + } + }, + "description": { + "target": "com.amazonaws.qbusiness#Description", + "traits": { + "smithy.api#documentation": "The description for the Amazon Q Business index.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business index was created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business index was last updated.
" + } + }, + "capacityConfiguration": { + "target": "com.amazonaws.qbusiness#IndexCapacityConfiguration", + "traits": { + "smithy.api#documentation": "The storage capacity units chosen for your Amazon Q Business index.
" + } + }, + "documentAttributeConfigurations": { + "target": "com.amazonaws.qbusiness#DocumentAttributeConfigurations", + "traits": { + "smithy.api#documentation": "Configuration information for document attributes or metadata. Document metadata are fields associated with your documents. For example, the company department name associated with each document. For more information, see Understanding document attributes.
" + } + }, + "error": { + "target": "com.amazonaws.qbusiness#ErrorDetail", + "traits": { + "aws.cloudformation#cfnExcludeProperty": {}, + "smithy.api#documentation": "When the Status field value is FAILED, the ErrorMessage field contains a message that explains why.
Provides information about the number of documents indexed.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetMedia": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetMediaRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetMediaResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#LicenseNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#MediaTooLargeException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Returns the image bytes corresponding to a media object. If you have implemented your own application with the Chat and ChatSync APIs, and have enabled content extraction from visual data in Amazon Q Business, you use the GetMedia API operation to download the images so you can show them in your UI with responses.
For more information, see Extracting semantic meaning from images and visuals.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/conversations/{conversationId}/messages/{messageId}/media/{mediaId}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetMediaRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business which contains the media object.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business conversation.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "messageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business message.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "mediaId": { + "target": "com.amazonaws.qbusiness#MediaId", + "traits": { + "smithy.api#documentation": "The identifier of the media object. You can find this in the sourceAttributions returned by the Chat, ChatSync, and ListMessages API responses.
The base64-encoded bytes of the media object.
" + } + }, + "mediaMimeType": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The MIME type of the media object (image/png).
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetPlugin": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetPluginRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetPluginResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:ListTagsForResource" + ], + "smithy.api#documentation": "Gets information about an existing Amazon Q Business plugin.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/plugins/{pluginId}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetPluginRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application which contains the plugin.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the plugin.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetPluginResponse": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application which contains the plugin.
" + } + }, + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the plugin.
" + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#PluginName", + "traits": { + "smithy.api#documentation": "The name of the plugin.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#PluginType", + "traits": { + "smithy.api#documentation": "The type of the plugin.
" + } + }, + "serverUrl": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The source URL used for plugin configuration.
" + } + }, + "authConfiguration": { + "target": "com.amazonaws.qbusiness#PluginAuthConfiguration" + }, + "customPluginConfiguration": { + "target": "com.amazonaws.qbusiness#CustomPluginConfiguration", + "traits": { + "smithy.api#documentation": "Configuration information required to create a custom plugin.
" + } + }, + "buildStatus": { + "target": "com.amazonaws.qbusiness#PluginBuildStatus", + "traits": { + "smithy.api#documentation": "The current status of a plugin. A plugin is modified asynchronously.
" + } + }, + "pluginArn": { + "target": "com.amazonaws.qbusiness#PluginArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the role with permission to access resources needed to create the plugin.
" + } + }, + "state": { + "target": "com.amazonaws.qbusiness#PluginState", + "traits": { + "smithy.api#documentation": "The current state of the plugin.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp for when the plugin was created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp for when the plugin was last updated.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetPolicy": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetPolicyRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetPolicyResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Retrieves the current permission policy for a Amazon Q Business application. The policy is returned as a JSON-formatted string and defines the IAM actions that are allowed or denied for the application's resources.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/policy", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetPolicyRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetPolicyResponse": { + "type": "structure", + "members": { + "policy": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The JSON representation of the permission policy.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetRetriever": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetRetrieverRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetRetrieverResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:ListTagsForResource" + ], + "smithy.api#documentation": "Gets information about an existing retriever used by an Amazon Q Business application.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/retrievers/{retrieverId}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetRetrieverRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application using the retriever.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "retrieverId": { + "target": "com.amazonaws.qbusiness#RetrieverId", + "traits": { + "smithy.api#documentation": "The identifier of the retriever.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetRetrieverResponse": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application using the retriever.
" + } + }, + "retrieverId": { + "target": "com.amazonaws.qbusiness#RetrieverId", + "traits": { + "smithy.api#documentation": "The identifier of the retriever.
" + } + }, + "retrieverArn": { + "target": "com.amazonaws.qbusiness#RetrieverArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM role associated with the retriever.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#RetrieverType", + "traits": { + "smithy.api#documentation": "The type of the retriever.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#RetrieverStatus", + "traits": { + "smithy.api#documentation": "The status of the retriever.
" + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#RetrieverName", + "traits": { + "smithy.api#documentation": "The name of the retriever.
" + } + }, + "configuration": { + "target": "com.amazonaws.qbusiness#RetrieverConfiguration" + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the role with the permission to access the retriever and required resources.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the retriever was created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the retriever was last updated.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetUser": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetUserRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetUserResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Describes the universally unique identifier (UUID) associated with a local user in a data source.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/users/{userId}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetUserRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application connected to the user.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The user email address attached to the user.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetUserResponse": { + "type": "structure", + "members": { + "userAliases": { + "target": "com.amazonaws.qbusiness#UserAliases", + "traits": { + "smithy.api#documentation": "A list of user aliases attached to a user.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GetWebExperience": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#GetWebExperienceRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#GetWebExperienceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:ListTagsForResource" + ], + "smithy.api#documentation": "Gets information about an existing Amazon Q Business web experience.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#GetWebExperienceRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application linked to the web experience.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "webExperienceId": { + "target": "com.amazonaws.qbusiness#WebExperienceId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business web experience.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#GetWebExperienceResponse": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application linked to the web experience.
" + } + }, + "webExperienceId": { + "target": "com.amazonaws.qbusiness#WebExperienceId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business web experience.
" + } + }, + "webExperienceArn": { + "target": "com.amazonaws.qbusiness#WebExperienceArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the role with the permission to access the Amazon Q Business web experience and required resources.
" + } + }, + "defaultEndpoint": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The endpoint of your Amazon Q Business web experience.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#WebExperienceStatus", + "traits": { + "smithy.api#documentation": "The current status of the Amazon Q Business web experience. When the Status field value is FAILED, the ErrorMessage field contains a description of the error that caused the data source connector to fail.
The Unix timestamp when the Amazon Q Business web experience was last created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business web experience was last updated.
" + } + }, + "title": { + "target": "com.amazonaws.qbusiness#WebExperienceTitle", + "traits": { + "smithy.api#documentation": "The title for your Amazon Q Business web experience.
" + } + }, + "subtitle": { + "target": "com.amazonaws.qbusiness#WebExperienceSubtitle", + "traits": { + "smithy.api#documentation": "The subtitle for your Amazon Q Business web experience.
" + } + }, + "welcomeMessage": { + "target": "com.amazonaws.qbusiness#WebExperienceWelcomeMessage", + "traits": { + "smithy.api#documentation": "The customized welcome message for end users of an Amazon Q Business web experience.
" + } + }, + "samplePromptsControlMode": { + "target": "com.amazonaws.qbusiness#WebExperienceSamplePromptsControlMode", + "traits": { + "smithy.api#documentation": "Determines whether sample prompts are enabled in the web experience for an end user.
" + } + }, + "origins": { + "target": "com.amazonaws.qbusiness#WebExperienceOrigins", + "traits": { + "smithy.api#documentation": "Gets the website domain origins that are allowed to embed the Amazon Q Business web experience. The domain origin refers to the base URL for accessing a website including the protocol (http/https), the domain name, and the port number (if specified).
The Amazon Resource Name (ARN) of the service role attached to your web experience.
" + } + }, + "identityProviderConfiguration": { + "target": "com.amazonaws.qbusiness#IdentityProviderConfiguration", + "traits": { + "smithy.api#documentation": "Information about the identity provider (IdP) used to authenticate end users of an Amazon Q Business web experience.
" + } + }, + "authenticationConfiguration": { + "target": "com.amazonaws.qbusiness#WebExperienceAuthConfiguration", + "traits": { + "smithy.api#deprecated": { + "message": "Property associated with legacy SAML IdP flow. Deprecated in favor of using AWS IAM Identity Center for user management." + }, + "smithy.api#documentation": "The authentication configuration information for your Amazon Q Business web experience.
" + } + }, + "error": { + "target": "com.amazonaws.qbusiness#ErrorDetail", + "traits": { + "aws.cloudformation#cfnExcludeProperty": {}, + "smithy.api#documentation": "When the Status field value is FAILED, the ErrorMessage field contains a description of the error that caused the data source connector to fail.
The browser extension configuration for an Amazon Q Business web experience.
" + } + }, + "customizationConfiguration": { + "target": "com.amazonaws.qbusiness#CustomizationConfiguration", + "traits": { + "smithy.api#documentation": "Gets the custom logo, favicon, font, and color used in the Amazon Q web experience.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#GroupIdentifier": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 47 + }, + "smithy.api#pattern": "^([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$" + } + }, + "com.amazonaws.qbusiness#GroupMembers": { + "type": "structure", + "members": { + "memberGroups": { + "target": "com.amazonaws.qbusiness#MemberGroups", + "traits": { + "smithy.api#documentation": "A list of sub groups that belong to a group. For example, the sub groups \"Research\", \"Engineering\", and \"Sales and Marketing\" all belong to the group \"Company\".
" + } + }, + "memberUsers": { + "target": "com.amazonaws.qbusiness#MemberUsers", + "traits": { + "smithy.api#documentation": "A list of users that belong to a group. For example, a list of interns all belong to the \"Interns\" group.
" + } + }, + "s3PathForGroupMembers": { + "target": "com.amazonaws.qbusiness#S3" + } + }, + "traits": { + "smithy.api#documentation": "A list of users or sub groups that belong to a group. This is for generating Amazon Q Business chat results only from document a user has access to.
" + } + }, + "com.amazonaws.qbusiness#GroupName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^\\P{C}*$" + } + }, + "com.amazonaws.qbusiness#GroupStatus": { + "type": "enum", + "members": { + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "SUCCEEDED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SUCCEEDED" + } + }, + "PROCESSING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PROCESSING" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + }, + "DELETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETED" + } + } + } + }, + "com.amazonaws.qbusiness#GroupStatusDetail": { + "type": "structure", + "members": { + "status": { + "target": "com.amazonaws.qbusiness#GroupStatus", + "traits": { + "smithy.api#documentation": "The status of a group.
" + } + }, + "lastUpdatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business application was last updated.
" + } + }, + "errorDetail": { + "target": "com.amazonaws.qbusiness#ErrorDetail", + "traits": { + "smithy.api#documentation": "The details of an error associated a group status.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides the details of a group's status.
" + } + }, + "com.amazonaws.qbusiness#GroupStatusDetails": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#GroupStatusDetail" + } + }, + "com.amazonaws.qbusiness#GroupSummary": { + "type": "structure", + "members": { + "groupName": { + "target": "com.amazonaws.qbusiness#GroupName", + "traits": { + "smithy.api#documentation": "The name of the group the summary information is for.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Summary information for groups.
" + } + }, + "com.amazonaws.qbusiness#GroupSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#GroupSummary" + } + }, + "com.amazonaws.qbusiness#HallucinationReductionConfiguration": { + "type": "structure", + "members": { + "hallucinationReductionControl": { + "target": "com.amazonaws.qbusiness#HallucinationReductionControl", + "traits": { + "smithy.api#documentation": "Controls whether hallucination reduction has been enabled or disabled for your application. The default status is DISABLED.
Configuration information required to setup hallucination reduction. For more information, see hallucination reduction.
The hallucination reduction feature won't work if chat orchestration controls are enabled for your application.
The condition used for when a Lambda function should be invoked.
For example, you can specify a condition that if there are empty date-time values, then Amazon Q Business should invoke a function that inserts the current date-time.
" + } + }, + "lambdaArn": { + "target": "com.amazonaws.qbusiness#LambdaArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the Lambda function during ingestion. For more information, see Using Lambda functions for Amazon Q Business document enrichment.
" + } + }, + "s3BucketName": { + "target": "com.amazonaws.qbusiness#S3BucketName", + "traits": { + "smithy.api#documentation": "Stores the original, raw documents or the structured, parsed documents before and after altering them. For more information, see Data contracts for Lambda functions.
" + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of a role with permission to run PreExtractionHookConfiguration and PostExtractionHookConfiguration for altering document metadata and content during the document ingestion process.
Provides the configuration information for invoking a Lambda function in Lambda to alter document metadata and content when ingesting documents into Amazon Q Business.
You can configure your Lambda function using the PreExtractionHookConfiguration parameter if you want to apply advanced alterations on the original or raw documents.
If you want to apply advanced alterations on the Amazon Q Business structured documents, you must configure your Lambda function using PostExtractionHookConfiguration.
You can only invoke one Lambda function. However, this function can invoke other functions it requires.
For more information, see Custom document enrichment.
" + } + }, + "com.amazonaws.qbusiness#IAMIdentityProviderArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 2048 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:iam::\\d{12}:(oidc-provider|saml-provider)/[a-zA-Z0-9_\\.\\/@\\-]+$" + } + }, + "com.amazonaws.qbusiness#IdcApplicationArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 10, + "max": 1224 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:sso::\\d{12}:application/(sso)?ins-[a-zA-Z0-9-.]{16}/apl-[a-zA-Z0-9]{16}$" + } + }, + "com.amazonaws.qbusiness#IdcAuthConfiguration": { + "type": "structure", + "members": { + "idcApplicationArn": { + "target": "com.amazonaws.qbusiness#IdcApplicationArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM Identity Center Application used to configure authentication.
", + "smithy.api#required": {} + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM role with permissions to perform actions on Amazon Web Services services on your behalf.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Information about the IAM Identity Center Application used to configure authentication for a plugin.
" + } + }, + "com.amazonaws.qbusiness#IdcTrustedTokenIssuerArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:sso::[0-9]{12}:trustedTokenIssuer/(sso)?ins-[a-zA-Z0-9-.]{16}/tti-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" + } + }, + "com.amazonaws.qbusiness#IdentityProviderConfiguration": { + "type": "union", + "members": { + "samlConfiguration": { + "target": "com.amazonaws.qbusiness#SamlProviderConfiguration" + }, + "openIDConnectConfiguration": { + "target": "com.amazonaws.qbusiness#OpenIDConnectProviderConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Provides information about the identity provider (IdP) used to authenticate end users of an Amazon Q Business web experience.
" + } + }, + "com.amazonaws.qbusiness#IdentityType": { + "type": "enum", + "members": { + "AWS_IAM_IDP_SAML": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AWS_IAM_IDP_SAML" + } + }, + "AWS_IAM_IDP_OIDC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AWS_IAM_IDP_OIDC" + } + }, + "AWS_IAM_IDC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AWS_IAM_IDC" + } + }, + "AWS_QUICKSIGHT_IDP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AWS_QUICKSIGHT_IDP" + } + }, + "ANONYMOUS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ANONYMOUS" + } + } + } + }, + "com.amazonaws.qbusiness#ImageExtractionConfiguration": { + "type": "structure", + "members": { + "imageExtractionStatus": { + "target": "com.amazonaws.qbusiness#ImageExtractionStatus", + "traits": { + "smithy.api#documentation": "Specify whether to extract semantic meaning from images and visuals from documents.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The configuration for extracting semantic meaning from images in documents. For more information, see Extracting semantic meaning from images and visuals.
" + } + }, + "com.amazonaws.qbusiness#ImageExtractionStatus": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.qbusiness#ImageSourceDetails": { + "type": "structure", + "members": { + "mediaId": { + "target": "com.amazonaws.qbusiness#MediaId", + "traits": { + "smithy.api#documentation": "Unique identifier for the image file.
" + } + }, + "mediaMimeType": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The MIME type of the image file.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Details about an image source, including its identifier and format.
" + } + }, + "com.amazonaws.qbusiness#Index": { + "type": "structure", + "members": { + "displayName": { + "target": "com.amazonaws.qbusiness#IndexName", + "traits": { + "smithy.api#documentation": "The name of the index.
" + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier for the index.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the index was created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the index was last updated.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#IndexStatus", + "traits": { + "smithy.api#documentation": "The current status of the index. When the status is ACTIVE, the index is ready.
Summary information for your Amazon Q Business index.
" + } + }, + "com.amazonaws.qbusiness#IndexArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$" + } + }, + "com.amazonaws.qbusiness#IndexCapacityConfiguration": { + "type": "structure", + "members": { + "units": { + "target": "com.amazonaws.qbusiness#IndexCapacityInteger", + "traits": { + "smithy.api#documentation": "The number of storage units configured for an Amazon Q Business index.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information about index capacity configuration.
" + } + }, + "com.amazonaws.qbusiness#IndexCapacityInteger": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1 + } + } + }, + "com.amazonaws.qbusiness#IndexId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#IndexName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1000 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + } + }, + "com.amazonaws.qbusiness#IndexResource": { + "type": "resource", + "identifiers": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId" + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId" + } + }, + "create": { + "target": "com.amazonaws.qbusiness#CreateIndex" + }, + "read": { + "target": "com.amazonaws.qbusiness#GetIndex" + }, + "update": { + "target": "com.amazonaws.qbusiness#UpdateIndex" + }, + "delete": { + "target": "com.amazonaws.qbusiness#DeleteIndex" + }, + "list": { + "target": "com.amazonaws.qbusiness#ListIndices" + }, + "resources": [ + { + "target": "com.amazonaws.qbusiness#DataSourceResource" + } + ], + "traits": { + "aws.cloudformation#cfnResource": { + "name": "Index" + } + } + }, + "com.amazonaws.qbusiness#IndexStatistics": { + "type": "structure", + "members": { + "textDocumentStatistics": { + "target": "com.amazonaws.qbusiness#TextDocumentStatistics", + "traits": { + "smithy.api#documentation": "The number of documents indexed.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information about the number of documents in an index.
" + } + }, + "com.amazonaws.qbusiness#IndexStatus": { + "type": "enum", + "members": { + "CREATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATING" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "UPDATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPDATING" + } + } + } + }, + "com.amazonaws.qbusiness#IndexType": { + "type": "enum", + "members": { + "ENTERPRISE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENTERPRISE" + } + }, + "STARTER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STARTER" + } + } + } + }, + "com.amazonaws.qbusiness#IndexedTextBytes": { + "type": "long", + "traits": { + "smithy.api#range": { + "min": 0 + } + } + }, + "com.amazonaws.qbusiness#IndexedTextDocument": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0 + } + } + }, + "com.amazonaws.qbusiness#Indices": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Index" + } + }, + "com.amazonaws.qbusiness#InlineDocumentEnrichmentConfiguration": { + "type": "structure", + "members": { + "condition": { + "target": "com.amazonaws.qbusiness#DocumentAttributeCondition" + }, + "target": { + "target": "com.amazonaws.qbusiness#DocumentAttributeTarget" + }, + "documentContentOperator": { + "target": "com.amazonaws.qbusiness#DocumentContentOperator", + "traits": { + "smithy.api#documentation": " TRUE to delete content if the condition used for the target attribute is met.
Provides the configuration information for applying basic logic to alter document metadata and content when ingesting documents into Amazon Q Business.
To apply advanced logic, to go beyond what you can do with basic logic, see HookConfiguration .
For more information, see Custom document enrichment.
" + } + }, + "com.amazonaws.qbusiness#InlineDocumentEnrichmentConfigurations": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#InlineDocumentEnrichmentConfiguration" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#InstanceArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 10, + "max": 1224 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}$" + } + }, + "com.amazonaws.qbusiness#Instruction": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 5, + "max": 1000 + }, + "smithy.api#pattern": "^[\\s\\S]*$" + } + }, + "com.amazonaws.qbusiness#InstructionCollection": { + "type": "structure", + "members": { + "responseLength": { + "target": "com.amazonaws.qbusiness#Instruction", + "traits": { + "smithy.api#documentation": "Specifies the desired length of responses generated by Amazon Q Business. This parameter allows administrators to control whether responses are concise and brief or more detailed and comprehensive.
" + } + }, + "targetAudience": { + "target": "com.amazonaws.qbusiness#Instruction", + "traits": { + "smithy.api#documentation": "Defines the intended audience for the responses, allowing Amazon Q Business to tailor its language, terminology, and explanations appropriately. This could range from technical experts to general users with varying levels of domain knowledge.
" + } + }, + "perspective": { + "target": "com.amazonaws.qbusiness#Instruction", + "traits": { + "smithy.api#documentation": "Determines the point of view or perspective from which Amazon Q Business generates responses, such as first-person, second-person, or third-person perspective, affecting how information is presented to users.
" + } + }, + "outputStyle": { + "target": "com.amazonaws.qbusiness#Instruction", + "traits": { + "smithy.api#documentation": "Specifies the formatting and structural style of responses, such as bullet points, paragraphs, step-by-step instructions, or other organizational formats that enhance readability and comprehension.
" + } + }, + "identity": { + "target": "com.amazonaws.qbusiness#Instruction", + "traits": { + "smithy.api#documentation": "Defines the persona or identity that Amazon Q Business should adopt when responding to users, allowing for customization of the assistant's character, role, or representation within an organization.
" + } + }, + "tone": { + "target": "com.amazonaws.qbusiness#Instruction", + "traits": { + "smithy.api#documentation": "Controls the emotional tone and communication style of responses, such as formal, casual, technical, friendly, or professional, to align with organizational communication standards and user expectations.
" + } + }, + "customInstructions": { + "target": "com.amazonaws.qbusiness#Instruction", + "traits": { + "smithy.api#documentation": "Allows administrators to provide specific, custom instructions that guide how Amazon Q Business should respond in particular scenarios or to certain types of queries, enabling fine-grained control over response generation.
" + } + }, + "examples": { + "target": "com.amazonaws.qbusiness#Instruction", + "traits": { + "smithy.api#documentation": "Provides sample responses or templates that Amazon Q Business can reference when generating responses, helping to establish consistent patterns and formats for different types of user queries.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A set of instructions that define how Amazon Q Business should generate and format responses to user queries. This collection includes parameters for controlling response characteristics such as length, audience targeting, perspective, style, identity, tone, and custom instructions.
" + } + }, + "com.amazonaws.qbusiness#Integer": { + "type": "integer" + }, + "com.amazonaws.qbusiness#IntegrationId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]*$" + } + }, + "com.amazonaws.qbusiness#IntegrationResource": { + "type": "resource", + "identifiers": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId" + }, + "integrationId": { + "target": "com.amazonaws.qbusiness#IntegrationId" + } + }, + "traits": { + "aws.cloudformation#cfnResource": { + "name": "Integration" + } + } + }, + "com.amazonaws.qbusiness#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.qbusiness#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact Support for help.
", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.amazonaws.qbusiness#KendraIndexConfiguration": { + "type": "structure", + "members": { + "indexId": { + "target": "com.amazonaws.qbusiness#KendraIndexId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Kendra index.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Stores an Amazon Kendra index as a retriever.
" + } + }, + "com.amazonaws.qbusiness#KendraIndexId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#KmsKeyId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.qbusiness#LambdaArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:lambda:[a-z-]*-[0-9]:[0-9]{12}:function:[a-zA-Z0-9-_]+(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?(:[a-zA-Z0-9-_]+)?$" + } + }, + "com.amazonaws.qbusiness#LicenseNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.qbusiness#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "You don't have permissions to perform the action because your license is inactive. Ask your admin to activate your license and try again after your licence is active.
", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.qbusiness#ListApplications": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListApplicationsRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListApplicationsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists Amazon Q Business applications.
Amazon Q Business applications may securely transmit data for processing across Amazon Web Services Regions within your geography. For more information, see Cross region inference in Amazon Q Business.
If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of Amazon Q Business applications.
The maximum number of Amazon Q Business applications to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListApplicationsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token. You can use this token in a subsequent request to retrieve the next set of applications.
" + } + }, + "applications": { + "target": "com.amazonaws.qbusiness#Applications", + "traits": { + "smithy.api#documentation": "An array of summary information on the configuration of one or more Amazon Q Business applications.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListAttachments": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListAttachmentsRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListAttachmentsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#LicenseNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Gets a list of attachments associated with an Amazon Q Business web experience or a list of attachements associated with a specific Amazon Q Business conversation.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/attachments", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "attachments" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListAttachmentsRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier for the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business web experience conversation.
", + "smithy.api#httpQuery": "conversationId" + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#UserId", + "traits": { + "smithy.api#documentation": "The unique identifier of the user involved in the Amazon Q Business web experience conversation.
", + "smithy.api#httpQuery": "userId" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the number of attachments returned exceeds maxResults, Amazon Q Business returns a next token as a pagination token to retrieve the next set of attachments.
The maximum number of attachements to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListAttachmentsResponse": { + "type": "structure", + "members": { + "attachments": { + "target": "com.amazonaws.qbusiness#AttachmentList", + "traits": { + "smithy.api#documentation": "An array of information on one or more attachments.
" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token, which you can use in a later request to list the next set of attachments.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListChatResponseConfigurations": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListChatResponseConfigurationsRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListChatResponseConfigurationsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Retrieves a list of all chat response configurations available in a specified Amazon Q Business application. This operation returns summary information about each configuration to help administrators manage and select appropriate response settings.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/chatresponseconfigurations" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "chatResponseConfigurations" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListChatResponseConfigurationsRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application for which to list available chat response configurations.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "maxResults": { + "target": "com.amazonaws.qbusiness#Integer", + "traits": { + "smithy.api#documentation": "The maximum number of chat response configurations to return in a single response. This parameter helps control pagination of results when many configurations exist.
", + "smithy.api#httpQuery": "maxResults" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "A pagination token used to retrieve the next set of results when the number of configurations exceeds the specified maxResults value.
A list of chat response configuration summaries, each containing key information about an available configuration in the specified application.
" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "A pagination token that can be used in a subsequent request to retrieve additional chat response configurations if the results were truncated due to the maxResults parameter.
Lists one or more Amazon Q Business conversations.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/conversations", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "conversations" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListConversationsRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#UserId", + "traits": { + "smithy.api#documentation": "The identifier of the user involved in the Amazon Q Business web experience conversation.
", + "smithy.api#httpQuery": "userId" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of Amazon Q Business conversations.
The maximum number of Amazon Q Business conversations to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListConversationsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token, which you can use in a later request to list the next set of messages.
" + } + }, + "conversations": { + "target": "com.amazonaws.qbusiness#Conversations", + "traits": { + "smithy.api#documentation": "An array of summary information on the configuration of one or more Amazon Q Business web experiences.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListDataAccessors": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListDataAccessorsRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListDataAccessorsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists the data accessors for a Amazon Q Business application. This operation returns a paginated list of data accessor summaries, including the friendly name, unique identifier, ARN, associated IAM role, and creation/update timestamps for each data accessor.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/dataaccessors", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "dataAccessors" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListDataAccessorsRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken1500", + "traits": { + "smithy.api#documentation": "The token for the next set of results. (You received this token from a previous call.)
", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "com.amazonaws.qbusiness#MaxResultsIntegerForListDataAccessors", + "traits": { + "smithy.api#documentation": "The maximum number of results to return in a single call.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListDataAccessorsResponse": { + "type": "structure", + "members": { + "dataAccessors": { + "target": "com.amazonaws.qbusiness#DataAccessors", + "traits": { + "smithy.api#documentation": "The list of data accessors.
" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken1500", + "traits": { + "smithy.api#documentation": "The token to use to retrieve the next set of results, if there are any.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListDataSourceSyncJobs": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListDataSourceSyncJobsRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListDataSourceSyncJobsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Get information about an Amazon Q Business data source connector synchronization.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/syncjobs", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "history" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListDataSourceSyncJobsRequest": { + "type": "structure", + "members": { + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application connected to the data source.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index used with the Amazon Q Business data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the maxResults response was incpmplete because there is more data to retriever, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of responses.
The maximum number of synchronization jobs to return in the response.
", + "smithy.api#httpQuery": "maxResults" + } + }, + "startTime": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The start time of the data source connector sync.
", + "smithy.api#httpQuery": "startTime" + } + }, + "endTime": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The end time of the data source connector sync.
", + "smithy.api#httpQuery": "endTime" + } + }, + "statusFilter": { + "target": "com.amazonaws.qbusiness#DataSourceSyncJobStatus", + "traits": { + "smithy.api#documentation": "Only returns synchronization jobs with the Status field equal to the specified status.
A history of synchronization jobs for the data source connector.
" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token. You can use this token in any subsequent request to retrieve the next set of jobs.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListDataSources": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListDataSourcesRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListDataSourcesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists the Amazon Q Business data source connectors that you have created.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "dataSources" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListDataSourcesRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application linked to the data source connectors.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index used with one or more data source connectors.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of Amazon Q Business data source connectors.
The maximum number of data source connectors to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListDataSourcesResponse": { + "type": "structure", + "members": { + "dataSources": { + "target": "com.amazonaws.qbusiness#DataSources", + "traits": { + "smithy.api#documentation": "An array of summary information for one or more data source connector.
" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token. You can use this token in a subsequent request to retrieve the next set of data source connectors.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListDocuments": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListDocumentsRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListDocumentsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "A list of documents attached to an index.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/index/{indexId}/documents", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "documentDetailList" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListDocumentsRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application id the documents are attached to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index the documents are attached to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceIds": { + "target": "com.amazonaws.qbusiness#DataSourceIds", + "traits": { + "smithy.api#documentation": "The identifier of the data sources the documents are attached to.
", + "smithy.api#httpQuery": "dataSourceIds" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of documents.
The maximum number of documents to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListDocumentsResponse": { + "type": "structure", + "members": { + "documentDetailList": { + "target": "com.amazonaws.qbusiness#DocumentDetailList", + "traits": { + "smithy.api#documentation": "A list of document details.
" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of documents.
Provides a list of groups that are mapped to users.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/indices/{indexId}/groups" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListGroupsRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application for getting a list of groups mapped to users.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index for getting a list of groups mapped to users.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "updatedEarlierThan": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp identifier used for the latest PUT or DELETE action for mapping users to their groups.
The identifier of the data source for getting a list of groups mapped to users.
", + "smithy.api#httpQuery": "dataSourceId" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the previous response was incomplete (because there is more data to retrieve), Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of groups that are mapped to users.
", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "com.amazonaws.qbusiness#MaxResultsIntegerForListGroupsRequest", + "traits": { + "smithy.api#documentation": "The maximum number of returned groups that are mapped to users.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListGroupsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token that you can use in the subsequent request to retrieve the next set of groups that are mapped to users.
" + } + }, + "items": { + "target": "com.amazonaws.qbusiness#GroupSummaryList", + "traits": { + "smithy.api#documentation": "Summary information for list of groups that are mapped to users.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListIndices": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListIndicesRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListIndicesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists the Amazon Q Business indices you have created.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/indices", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "indices" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListIndicesRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application connected to the index.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of Amazon Q Business indices.
", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "com.amazonaws.qbusiness#MaxResultsIntegerForListIndices", + "traits": { + "smithy.api#documentation": "The maximum number of indices to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListIndicesResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token that you can use in the subsequent request to retrieve the next set of indexes.
" + } + }, + "indices": { + "target": "com.amazonaws.qbusiness#Indices", + "traits": { + "smithy.api#documentation": "An array of information on the items in one or more indexes.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListMessages": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListMessagesRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListMessagesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#LicenseNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Gets a list of messages associated with an Amazon Q Business web experience.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/conversations/{conversationId}", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "messages" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListMessagesRequest": { + "type": "structure", + "members": { + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business web experience conversation.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier for the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#UserId", + "traits": { + "smithy.api#documentation": "The identifier of the user involved in the Amazon Q Business web experience conversation.
", + "smithy.api#httpQuery": "userId" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the number of messages returned exceeds maxResults, Amazon Q Business returns a next token as a pagination token to retrieve the next set of messages.
The maximum number of messages to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListMessagesResponse": { + "type": "structure", + "members": { + "messages": { + "target": "com.amazonaws.qbusiness#Messages", + "traits": { + "smithy.api#documentation": "An array of information on one or more messages.
" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token, which you can use in a later request to list the next set of messages.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListPluginActions": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListPluginActionsRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListPluginActionsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists configured Amazon Q Business actions for a specific plugin in an Amazon Q Business application.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/plugins/{pluginId}/actions" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListPluginActionsRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application the plugin is attached to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business plugin.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the number of plugin actions returned exceeds maxResults, Amazon Q Business returns a next token as a pagination token to retrieve the next set of plugin actions.
The maximum number of plugin actions to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListPluginActionsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token, which you can use in a later request to list the next set of plugin actions.
" + } + }, + "items": { + "target": "com.amazonaws.qbusiness#Actions", + "traits": { + "smithy.api#documentation": "An array of information on one or more plugin actions.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListPluginTypeActions": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListPluginTypeActionsRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListPluginTypeActionsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists configured Amazon Q Business actions for any plugin type\u2014both built-in and custom.
", + "smithy.api#http": { + "method": "GET", + "uri": "/pluginTypes/{pluginType}/actions" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListPluginTypeActionsRequest": { + "type": "structure", + "members": { + "pluginType": { + "target": "com.amazonaws.qbusiness#PluginType", + "traits": { + "smithy.api#documentation": "The type of the plugin.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the number of plugins returned exceeds maxResults, Amazon Q Business returns a next token as a pagination token to retrieve the next set of plugins.
The maximum number of plugins to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListPluginTypeActionsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token, which you can use in a later request to list the next set of plugins.
" + } + }, + "items": { + "target": "com.amazonaws.qbusiness#Actions", + "traits": { + "smithy.api#documentation": "An array of information on one or more plugins.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListPluginTypeMetadata": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListPluginTypeMetadataRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListPluginTypeMetadataResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists metadata for all Amazon Q Business plugin types.
", + "smithy.api#http": { + "method": "GET", + "uri": "/pluginTypeMetadata" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListPluginTypeMetadataRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the metadata returned exceeds maxResults, Amazon Q Business returns a next token as a pagination token to retrieve the next set of metadata.
The maximum number of plugin metadata items to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListPluginTypeMetadataResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token, which you can use in a later request to list the next set of plugin metadata.
" + } + }, + "items": { + "target": "com.amazonaws.qbusiness#ListPluginTypeMetadataSummaries", + "traits": { + "smithy.api#documentation": "An array of information on plugin metadata.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListPluginTypeMetadataSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#PluginTypeMetadataSummary" + } + }, + "com.amazonaws.qbusiness#ListPlugins": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListPluginsRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListPluginsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists configured Amazon Q Business plugins.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/plugins" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "plugins" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListPluginsRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application the plugin is attached to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of plugins.
The maximum number of documents to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListPluginsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of plugins.
Information about a configured plugin.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListRetrievers": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListRetrieversRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListRetrieversResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists the retriever used by an Amazon Q Business application.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/retrievers", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "retrievers" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListRetrieversRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application using the retriever.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the number of retrievers returned exceeds maxResults, Amazon Q Business returns a next token as a pagination token to retrieve the next set of retrievers.
The maximum number of retrievers returned.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListRetrieversResponse": { + "type": "structure", + "members": { + "retrievers": { + "target": "com.amazonaws.qbusiness#Retrievers", + "traits": { + "smithy.api#documentation": "An array of summary information for one or more retrievers.
" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token, which you can use in a later request to list the next set of retrievers.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListSubscriptions": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListSubscriptionsRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListSubscriptionsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists all subscriptions created in an Amazon Q Business application.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/subscriptions" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "subscriptions" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListSubscriptionsRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application linked to the subscription.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of Amazon Q Business subscriptions.
The maximum number of Amazon Q Business subscriptions to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListSubscriptionsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token. You can use this token in a subsequent request to retrieve the next set of subscriptions.
" + } + }, + "subscriptions": { + "target": "com.amazonaws.qbusiness#Subscriptions", + "traits": { + "smithy.api#documentation": "An array of summary information on the subscriptions configured for an Amazon Q Business application.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListTagsForResourceRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListTagsForResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Gets a list of tags associated with a specified resource. Amazon Q Business applications and data sources can have tags associated with them.
", + "smithy.api#http": { + "uri": "/v1/tags/{resourceARN}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListTagsForResourceRequest": { + "type": "structure", + "members": { + "resourceARN": { + "target": "com.amazonaws.qbusiness#AmazonResourceName", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the Amazon Q Business application or data source to get a list of tags for.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListTagsForResourceResponse": { + "type": "structure", + "members": { + "tags": { + "target": "com.amazonaws.qbusiness#Tags", + "traits": { + "smithy.api#documentation": "A list of tags associated with the Amazon Q Business application or data source.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#ListWebExperiences": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#ListWebExperiencesRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#ListWebExperiencesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists one or more Amazon Q Business Web Experiences.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/experiences", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "webExperiences" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.qbusiness#ListWebExperiencesRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application linked to the listed web experiences.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of Amazon Q Business conversations.
The maximum number of Amazon Q Business Web Experiences to return.
", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#ListWebExperiencesResponse": { + "type": "structure", + "members": { + "webExperiences": { + "target": "com.amazonaws.qbusiness#WebExperiences", + "traits": { + "smithy.api#documentation": "An array of summary information for one or more Amazon Q Business experiences.
" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "If the response is truncated, Amazon Q Business returns this token, which you can use in a later request to list the next set of messages.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#LogoUrl": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^(https?://[a-zA-Z0-9-_.+%/]+\\.(svg|png))?$" + } + }, + "com.amazonaws.qbusiness#Long": { + "type": "long" + }, + "com.amazonaws.qbusiness#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForGetTopicConfigurations": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 50 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListApplications": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListAttachments": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListConversations": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListDataAccessors": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListDataSources": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListDataSourcesSyncJobs": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListDocuments": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListGroupsRequest": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListIndices": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListMessages": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListPluginActions": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 50 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListPluginTypeActions": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 50 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListPluginTypeMetadata": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 50 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListPlugins": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 50 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListRetrieversRequest": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 50 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListSubscriptions": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#MaxResultsIntegerForListWebExperiencesRequest": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.qbusiness#MediaExtractionConfiguration": { + "type": "structure", + "members": { + "imageExtractionConfiguration": { + "target": "com.amazonaws.qbusiness#ImageExtractionConfiguration", + "traits": { + "smithy.api#documentation": "The configuration for extracting semantic meaning from images in documents. For more information, see Extracting semantic meaning from images and visuals.
" + } + }, + "audioExtractionConfiguration": { + "target": "com.amazonaws.qbusiness#AudioExtractionConfiguration", + "traits": { + "smithy.api#documentation": "Configuration settings for extracting and processing audio content from media files.
" + } + }, + "videoExtractionConfiguration": { + "target": "com.amazonaws.qbusiness#VideoExtractionConfiguration", + "traits": { + "smithy.api#documentation": "Configuration settings for extracting and processing video content from media files.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The configuration for extracting information from media in documents.
" + } + }, + "com.amazonaws.qbusiness#MediaId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#MediaTooLargeException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.qbusiness#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The requested media object is too large to be returned.
", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.qbusiness#MemberGroup": { + "type": "structure", + "members": { + "groupName": { + "target": "com.amazonaws.qbusiness#GroupName", + "traits": { + "smithy.api#documentation": "The name of the sub group.
", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.qbusiness#MembershipType", + "traits": { + "smithy.api#documentation": "The type of the sub group.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The sub groups that belong to a group.
" + } + }, + "com.amazonaws.qbusiness#MemberGroups": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#MemberGroup" + } + }, + "com.amazonaws.qbusiness#MemberRelation": { + "type": "enum", + "members": { + "AND": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AND" + } + }, + "OR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OR" + } + } + } + }, + "com.amazonaws.qbusiness#MemberUser": { + "type": "structure", + "members": { + "userId": { + "target": "com.amazonaws.qbusiness#DataSourceUserId", + "traits": { + "smithy.api#documentation": "The identifier of the user you want to map to a group.
", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.qbusiness#MembershipType", + "traits": { + "smithy.api#documentation": "The type of the user.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The users that belong to a group.
" + } + }, + "com.amazonaws.qbusiness#MemberUsers": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#MemberUser" + } + }, + "com.amazonaws.qbusiness#MembershipType": { + "type": "enum", + "members": { + "INDEX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INDEX" + } + }, + "DATASOURCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATASOURCE" + } + } + } + }, + "com.amazonaws.qbusiness#Message": { + "type": "structure", + "members": { + "messageId": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business web experience message.
" + } + }, + "body": { + "target": "com.amazonaws.qbusiness#MessageBody", + "traits": { + "smithy.api#documentation": "The content of the Amazon Q Business web experience message.
" + } + }, + "time": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp of the first Amazon Q Business web experience message.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#MessageType", + "traits": { + "smithy.api#documentation": "The type of Amazon Q Business message, whether HUMAN or AI generated.
A file directly uploaded into an Amazon Q Business web experience chat.
" + } + }, + "sourceAttribution": { + "target": "com.amazonaws.qbusiness#SourceAttributions", + "traits": { + "smithy.api#documentation": "The source documents used to generate Amazon Q Business web experience message.
" + } + }, + "actionReview": { + "target": "com.amazonaws.qbusiness#ActionReview" + }, + "actionExecution": { + "target": "com.amazonaws.qbusiness#ActionExecution" + } + }, + "traits": { + "smithy.api#documentation": "A message in an Amazon Q Business web experience.
" + } + }, + "com.amazonaws.qbusiness#MessageBody": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1000 + }, + "smithy.api#pattern": "^\\P{C}*$}$" + } + }, + "com.amazonaws.qbusiness#MessageId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#MessageType": { + "type": "enum", + "members": { + "USER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USER" + } + }, + "SYSTEM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SYSTEM" + } + } + } + }, + "com.amazonaws.qbusiness#MessageUsefulness": { + "type": "enum", + "members": { + "USEFUL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USEFUL" + } + }, + "NOT_USEFUL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_USEFUL" + } + } + } + }, + "com.amazonaws.qbusiness#MessageUsefulnessComment": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1000 + }, + "smithy.api#pattern": "^\\P{C}*$" + } + }, + "com.amazonaws.qbusiness#MessageUsefulnessFeedback": { + "type": "structure", + "members": { + "usefulness": { + "target": "com.amazonaws.qbusiness#MessageUsefulness", + "traits": { + "smithy.api#documentation": "The usefulness value assigned by an end user to a message.
", + "smithy.api#required": {} + } + }, + "reason": { + "target": "com.amazonaws.qbusiness#MessageUsefulnessReason", + "traits": { + "smithy.api#documentation": "The reason for a usefulness rating.
" + } + }, + "comment": { + "target": "com.amazonaws.qbusiness#MessageUsefulnessComment", + "traits": { + "smithy.api#documentation": "A comment given by an end user on the usefulness of an AI-generated chat message.
" + } + }, + "submittedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp for when the feedback was submitted.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "End user feedback on an AI-generated web experience chat message usefulness.
" + } + }, + "com.amazonaws.qbusiness#MessageUsefulnessReason": { + "type": "enum", + "members": { + "NOT_FACTUALLY_CORRECT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_FACTUALLY_CORRECT" + } + }, + "HARMFUL_OR_UNSAFE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HARMFUL_OR_UNSAFE" + } + }, + "INCORRECT_OR_MISSING_SOURCES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INCORRECT_OR_MISSING_SOURCES" + } + }, + "NOT_HELPFUL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_HELPFUL" + } + }, + "FACTUALLY_CORRECT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FACTUALLY_CORRECT" + } + }, + "COMPLETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETE" + } + }, + "RELEVANT_SOURCES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RELEVANT_SOURCES" + } + }, + "HELPFUL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HELPFUL" + } + }, + "NOT_BASED_ON_DOCUMENTS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_BASED_ON_DOCUMENTS" + } + }, + "NOT_COMPLETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_COMPLETE" + } + }, + "NOT_CONCISE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_CONCISE" + } + }, + "OTHER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OTHER" + } + } + } + }, + "com.amazonaws.qbusiness#Messages": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Message" + } + }, + "com.amazonaws.qbusiness#MetadataEvent": { + "type": "structure", + "members": { + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the conversation with which the generated metadata is associated.
" + } + }, + "userMessageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier of an Amazon Q Business end user text input message within the conversation.
" + } + }, + "systemMessageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier of an Amazon Q Business AI generated message within the conversation.
" + } + }, + "sourceAttributions": { + "target": "com.amazonaws.qbusiness#SourceAttributions", + "traits": { + "smithy.api#documentation": "The source documents used to generate the conversation response.
" + } + }, + "finalTextMessage": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The final text output message generated by the system.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A metadata event for a AI-generated text output message in a Amazon Q Business conversation, containing associated metadata generated.
" + } + }, + "com.amazonaws.qbusiness#MetricValue": { + "type": "string", + "traits": { + "smithy.api#pattern": "^(([1-9][0-9]*)|0)$" + } + }, + "com.amazonaws.qbusiness#NativeIndexConfiguration": { + "type": "structure", + "members": { + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier for the Amazon Q Business index.
", + "smithy.api#required": {} + } + }, + "version": { + "target": "com.amazonaws.qbusiness#Long", + "traits": { + "smithy.api#documentation": "A read-only field that specifies the version of the NativeIndexConfiguration.
Amazon Q Business introduces enhanced document retrieval capabilities in version 2 of NativeIndexConfiguration, focusing on streamlined metadata boosting that prioritizes recency and source relevance to deliver more accurate responses to your queries. Version 2 has the following differences from version 1:
Version 2 supports a single Date field (created_at OR last_updated_at) for recency boosting
Version 2 supports a single String field with an ordered list of up to 5 values
Version 2 introduces number-based boost levels (ONE, TWO) alongside the text-based levels
Version 2 allows specifying prioritization between Date and String fields
Version 2 maintains backward compatibility with existing configurations
Overrides the default boosts applied by Amazon Q Business to supported document attribute data types.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration information for an Amazon Q Business index.
" + } + }, + "com.amazonaws.qbusiness#NextToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 800 + } + } + }, + "com.amazonaws.qbusiness#NextToken1500": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1500 + } + } + }, + "com.amazonaws.qbusiness#NoAuthConfiguration": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "Information about invoking a custom plugin without any authentication or authorization requirement.
" + } + }, + "com.amazonaws.qbusiness#NumberAttributeBoostingConfiguration": { + "type": "structure", + "members": { + "boostingLevel": { + "target": "com.amazonaws.qbusiness#DocumentAttributeBoostingLevel", + "traits": { + "smithy.api#documentation": "Specifies the priority of boosted document attributes in relation to other boosted attributes. This parameter determines how strongly the attribute influences document ranking in search results. NUMBER attributes can serve as additional boosting factors when needed, but are not supported when using NativeIndexConfiguration version 2.
Specifies whether higher or lower numeric values should be prioritized when boosting. Valid values are ASCENDING (higher numbers are more important) and DESCENDING (lower numbers are more important).
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information on boosting NUMBER type document attributes.
In the current boosting implementation, boosting focuses primarily on DATE attributes for recency and STRING attributes for source prioritization. NUMBER attributes can serve as additional boosting factors when needed, but are not supported when using NativeIndexConfiguration version 2.
For more information on how boosting document attributes work in Amazon Q Business, see Boosting using document attributes.
" + } + }, + "com.amazonaws.qbusiness#NumberAttributeBoostingType": { + "type": "enum", + "members": { + "PRIORITIZE_LARGER_VALUES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PRIORITIZE_LARGER_VALUES" + } + }, + "PRIORITIZE_SMALLER_VALUES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PRIORITIZE_SMALLER_VALUES" + } + } + } + }, + "com.amazonaws.qbusiness#OAuth2ClientCredentialConfiguration": { + "type": "structure", + "members": { + "secretArn": { + "target": "com.amazonaws.qbusiness#SecretArn", + "traits": { + "smithy.api#documentation": "The ARN of the Secrets Manager secret that stores the OAuth 2.0 credentials/token used for plugin configuration.
", + "smithy.api#required": {} + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The ARN of an IAM role used by Amazon Q Business to access the OAuth 2.0 authentication credentials stored in a Secrets Manager secret.
", + "smithy.api#required": {} + } + }, + "authorizationUrl": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The redirect URL required by the OAuth 2.0 protocol for Amazon Q Business to authenticate a plugin user through a third party authentication server.
" + } + }, + "tokenUrl": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The URL required by the OAuth 2.0 protocol to exchange an end user authorization code for an access token.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Information about the OAuth 2.0 authentication credential/token used to configure a plugin.
" + } + }, + "com.amazonaws.qbusiness#OpenIDConnectProviderConfiguration": { + "type": "structure", + "members": { + "secretsArn": { + "target": "com.amazonaws.qbusiness#SecretArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of a Secrets Manager secret containing the OIDC client secret.
", + "smithy.api#required": {} + } + }, + "secretsRole": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "An IAM role with permissions to access KMS to decrypt the Secrets Manager secret containing your OIDC client secret.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Information about the OIDC-compliant identity provider (IdP) used to authenticate end users of an Amazon Q Business web experience.
" + } + }, + "com.amazonaws.qbusiness#OrchestrationConfiguration": { + "type": "structure", + "members": { + "control": { + "target": "com.amazonaws.qbusiness#OrchestrationControl", + "traits": { + "smithy.api#documentation": "Status information about whether chat orchestration is activated or deactivated for your Amazon Q Business application.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration information required to enable chat orchestration for your Amazon Q Business application.
Chat orchestration is optimized to work for English language content. For more details on language support in Amazon Q Business, see Supported languages.
The operator to use for the condition evaluation. This determines how the condition values are compared.
", + "smithy.api#required": {} + } + }, + "conditionKey": { + "target": "com.amazonaws.qbusiness#PermissionConditionKey", + "traits": { + "smithy.api#documentation": "The key for the condition. This identifies the attribute that the condition applies to.
", + "smithy.api#required": {} + } + }, + "conditionValues": { + "target": "com.amazonaws.qbusiness#PermissionConditionValues", + "traits": { + "smithy.api#documentation": "The values to compare against using the specified condition operator.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Defines a condition that restricts when a permission is effective. Conditions allow you to control access based on specific attributes of the request.
" + } + }, + "com.amazonaws.qbusiness#PermissionConditionKey": { + "type": "string", + "traits": { + "smithy.api#pattern": "^aws:[a-zA-Z][a-zA-Z0-9-/:]*$" + } + }, + "com.amazonaws.qbusiness#PermissionConditionOperator": { + "type": "enum", + "members": { + "STRING_EQUALS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "StringEquals" + } + } + } + }, + "com.amazonaws.qbusiness#PermissionConditionValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1000 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*$" + } + }, + "com.amazonaws.qbusiness#PermissionConditionValues": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#PermissionConditionValue" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, + "com.amazonaws.qbusiness#PermissionConditions": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#PermissionCondition" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#PersonalizationConfiguration": { + "type": "structure", + "members": { + "personalizationControlMode": { + "target": "com.amazonaws.qbusiness#PersonalizationControlMode", + "traits": { + "smithy.api#documentation": "An option to allow Amazon Q Business to customize chat responses using user specific metadata\u2014specifically, location and job information\u2014in your IAM Identity Center instance.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration information about chat response personalization. For more information, see Personalizing chat responses.
" + } + }, + "com.amazonaws.qbusiness#PersonalizationControlMode": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.qbusiness#Plugin": { + "type": "structure", + "members": { + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the plugin.
" + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#PluginName", + "traits": { + "smithy.api#documentation": "The name of the plugin.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#PluginType", + "traits": { + "smithy.api#documentation": "The type of the plugin.
" + } + }, + "serverUrl": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The plugin server URL used for configuration.
" + } + }, + "state": { + "target": "com.amazonaws.qbusiness#PluginState", + "traits": { + "smithy.api#documentation": "The current status of the plugin.
" + } + }, + "buildStatus": { + "target": "com.amazonaws.qbusiness#PluginBuildStatus", + "traits": { + "smithy.api#documentation": "The status of the plugin.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp for when the plugin was created.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp for when the plugin was last updated.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Information about an Amazon Q Business plugin and its configuration.
" + } + }, + "com.amazonaws.qbusiness#PluginArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$" + } + }, + "com.amazonaws.qbusiness#PluginAuthConfiguration": { + "type": "union", + "members": { + "basicAuthConfiguration": { + "target": "com.amazonaws.qbusiness#BasicAuthConfiguration", + "traits": { + "smithy.api#documentation": "Information about the basic authentication credentials used to configure a plugin.
" + } + }, + "oAuth2ClientCredentialConfiguration": { + "target": "com.amazonaws.qbusiness#OAuth2ClientCredentialConfiguration", + "traits": { + "smithy.api#documentation": "Information about the OAuth 2.0 authentication credential/token used to configure a plugin.
" + } + }, + "noAuthConfiguration": { + "target": "com.amazonaws.qbusiness#NoAuthConfiguration", + "traits": { + "smithy.api#documentation": "Information about invoking a custom plugin without any authentication.
" + } + }, + "idcAuthConfiguration": { + "target": "com.amazonaws.qbusiness#IdcAuthConfiguration", + "traits": { + "smithy.api#documentation": "Information about the IAM Identity Center Application used to configure authentication for a plugin.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Authentication configuration information for an Amazon Q Business plugin.
" + } + }, + "com.amazonaws.qbusiness#PluginBuildStatus": { + "type": "enum", + "members": { + "READY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "READY" + } + }, + "CREATE_IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATE_IN_PROGRESS" + } + }, + "CREATE_FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATE_FAILED" + } + }, + "UPDATE_IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPDATE_IN_PROGRESS" + } + }, + "UPDATE_FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPDATE_FAILED" + } + }, + "DELETE_IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETE_IN_PROGRESS" + } + }, + "DELETE_FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETE_FAILED" + } + } + } + }, + "com.amazonaws.qbusiness#PluginConfiguration": { + "type": "structure", + "members": { + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the plugin you want to use.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration information required to invoke chat in PLUGIN_MODE.
For more information, see Admin controls and guardrails, Plugins, and Conversation settings.
" + } + }, + "com.amazonaws.qbusiness#PluginDescription": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 200 + } + } + }, + "com.amazonaws.qbusiness#PluginId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" + } + }, + "com.amazonaws.qbusiness#PluginName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + } + }, + "com.amazonaws.qbusiness#PluginResource": { + "type": "resource", + "identifiers": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId" + }, + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId" + } + }, + "create": { + "target": "com.amazonaws.qbusiness#CreatePlugin" + }, + "read": { + "target": "com.amazonaws.qbusiness#GetPlugin" + }, + "update": { + "target": "com.amazonaws.qbusiness#UpdatePlugin" + }, + "delete": { + "target": "com.amazonaws.qbusiness#DeletePlugin" + }, + "list": { + "target": "com.amazonaws.qbusiness#ListPlugins" + }, + "traits": { + "aws.cloudformation#cfnResource": { + "name": "Plugin" + } + } + }, + "com.amazonaws.qbusiness#PluginState": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.qbusiness#PluginType": { + "type": "enum", + "members": { + "SERVICE_NOW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SERVICE_NOW" + } + }, + "SALESFORCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SALESFORCE" + } + }, + "JIRA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "JIRA" + } + }, + "ZENDESK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ZENDESK" + } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } + }, + "QUICKSIGHT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "QUICKSIGHT" + } + }, + "SERVICENOW_NOW_PLATFORM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SERVICENOW_NOW_PLATFORM" + } + }, + "JIRA_CLOUD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "JIRA_CLOUD" + } + }, + "SALESFORCE_CRM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SALESFORCE_CRM" + } + }, + "ZENDESK_SUITE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ZENDESK_SUITE" + } + }, + "ATLASSIAN_CONFLUENCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ATLASSIAN_CONFLUENCE" + } + }, + "GOOGLE_CALENDAR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GOOGLE_CALENDAR" + } + }, + "MICROSOFT_TEAMS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MICROSOFT_TEAMS" + } + }, + "MICROSOFT_EXCHANGE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MICROSOFT_EXCHANGE" + } + }, + "PAGERDUTY_ADVANCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PAGERDUTY_ADVANCE" + } + }, + "SMARTSHEET": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SMARTSHEET" + } + }, + "ASANA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ASANA" + } + } + } + }, + "com.amazonaws.qbusiness#PluginTypeCategory": { + "type": "enum", + "members": { + "CRM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Customer relationship management (CRM)" + } + }, + "PROJECT_MANAGEMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Project management" + } + }, + "COMMUNICATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Communication" + } + }, + "PRODUCTIVITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Productivity" + } + }, + "TICKETING_MANAGEMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Ticketing and incident management" + } + } + } + }, + "com.amazonaws.qbusiness#PluginTypeMetadataSummary": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.qbusiness#PluginType", + "traits": { + "smithy.api#documentation": "The type of the plugin.
" + } + }, + "category": { + "target": "com.amazonaws.qbusiness#PluginTypeCategory", + "traits": { + "smithy.api#documentation": "The category of the plugin type.
" + } + }, + "description": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The description assigned by Amazon Q Business to a plugin. You can't modify this value.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Summary metadata information for a Amazon Q Business plugin.
" + } + }, + "com.amazonaws.qbusiness#Plugins": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Plugin" + } + }, + "com.amazonaws.qbusiness#Principal": { + "type": "union", + "members": { + "user": { + "target": "com.amazonaws.qbusiness#PrincipalUser", + "traits": { + "smithy.api#documentation": "The user associated with the principal.
" + } + }, + "group": { + "target": "com.amazonaws.qbusiness#PrincipalGroup", + "traits": { + "smithy.api#documentation": "The group associated with the principal.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides user and group information used for filtering documents to use for generating Amazon Q Business conversation responses.
" + } + }, + "com.amazonaws.qbusiness#PrincipalGroup": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.qbusiness#GroupName", + "traits": { + "smithy.api#documentation": "The name of the group.
" + } + }, + "access": { + "target": "com.amazonaws.qbusiness#ReadAccessType", + "traits": { + "smithy.api#documentation": "Provides information about whether to allow or deny access to the principal.
", + "smithy.api#required": {} + } + }, + "membershipType": { + "target": "com.amazonaws.qbusiness#MembershipType", + "traits": { + "smithy.api#documentation": "The type of group.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information about a group associated with the principal.
" + } + }, + "com.amazonaws.qbusiness#PrincipalRoleArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:iam::[0-9]{12}:role/[a-zA-Z0-9_/+=,.@-]+$" + } + }, + "com.amazonaws.qbusiness#PrincipalUser": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.qbusiness#UserId", + "traits": { + "smithy.api#documentation": "The identifier of the user.
" + } + }, + "access": { + "target": "com.amazonaws.qbusiness#ReadAccessType", + "traits": { + "smithy.api#documentation": "Provides information about whether to allow or deny access to the principal.
", + "smithy.api#required": {} + } + }, + "membershipType": { + "target": "com.amazonaws.qbusiness#MembershipType", + "traits": { + "smithy.api#documentation": "The type of group.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information about a user associated with a principal.
" + } + }, + "com.amazonaws.qbusiness#Principals": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Principal" + } + }, + "com.amazonaws.qbusiness#PutFeedback": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#PutFeedbackRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Enables your end user to provide feedback on their Amazon Q Business generated chat responses.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/conversations/{conversationId}/messages/{messageId}/feedback", + "method": "POST" + } + } + }, + "com.amazonaws.qbusiness#PutFeedbackRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application associated with the feedback.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#UserId", + "traits": { + "smithy.api#documentation": "The identifier of the user giving the feedback.
", + "smithy.api#httpQuery": "userId" + } + }, + "conversationId": { + "target": "com.amazonaws.qbusiness#ConversationId", + "traits": { + "smithy.api#documentation": "The identifier of the conversation the feedback is attached to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "messageId": { + "target": "com.amazonaws.qbusiness#SystemMessageId", + "traits": { + "smithy.api#documentation": "The identifier of the chat message that the feedback was given for.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "messageCopiedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The timestamp for when the feedback was recorded.
" + } + }, + "messageUsefulness": { + "target": "com.amazonaws.qbusiness#MessageUsefulnessFeedback", + "traits": { + "smithy.api#documentation": "The feedback usefulness value given by the user to the chat message.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#PutGroup": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#PutGroupRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#PutGroupResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Create, or updates, a mapping of users\u2014who have access to a document\u2014to groups.
You can also map sub groups to groups. For example, the group \"Company Intellectual Property Teams\" includes sub groups \"Research\" and \"Engineering\". These sub groups include their own list of users or people who work in these teams. Only users who work in research and engineering, and therefore belong in the intellectual property group, can see top-secret company documents in their Amazon Q Business chat results.
There are two options for creating groups, either passing group members inline or using an S3 file via the S3PathForGroupMembers field. For inline groups, there is a limit of 1000 members per group and for provided S3 files there is a limit of 100 thousand members. When creating a group using an S3 file, you provide both an S3 file and a RoleArn for Amazon Q Buisness to access the file.
The identifier of the application in which the user and group mapping belongs.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index in which you want to map users to their groups.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "groupName": { + "target": "com.amazonaws.qbusiness#GroupName", + "traits": { + "smithy.api#documentation": "The list that contains your users or sub groups that belong the same group. For example, the group \"Company\" includes the user \"CEO\" and the sub groups \"Research\", \"Engineering\", and \"Sales and Marketing\".
", + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source for which you want to map users to their groups. This is useful if a group is tied to multiple data sources, but you only want the group to access documents of a certain data source. For example, the groups \"Research\", \"Engineering\", and \"Sales and Marketing\" are all tied to the company's documents stored in the data sources Confluence and Salesforce. However, \"Sales and Marketing\" team only needs access to customer-related documents stored in Salesforce.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#MembershipType", + "traits": { + "smithy.api#documentation": "The type of the group.
", + "smithy.api#required": {} + } + }, + "groupMembers": { + "target": "com.amazonaws.qbusiness#GroupMembers", + "traits": { + "smithy.api#required": {} + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of an IAM role that has access to the S3 file that contains your list of users that belong to a group.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#PutGroupResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#QAppsConfiguration": { + "type": "structure", + "members": { + "qAppsControlMode": { + "target": "com.amazonaws.qbusiness#QAppsControlMode", + "traits": { + "smithy.api#documentation": "Status information about whether end users can create and use Amazon Q Apps in the web experience.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration information about Amazon Q Apps.
" + } + }, + "com.amazonaws.qbusiness#QAppsControlMode": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.qbusiness#QIamAction": { + "type": "string", + "traits": { + "smithy.api#pattern": "^qbusiness:[a-zA-Z]+$" + } + }, + "com.amazonaws.qbusiness#QIamActions": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#QIamAction" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#QueryText": { + "type": "string" + }, + "com.amazonaws.qbusiness#QuickSightConfiguration": { + "type": "structure", + "members": { + "clientNamespace": { + "target": "com.amazonaws.qbusiness#ClientNamespace", + "traits": { + "smithy.api#documentation": "The Amazon Quick Suite namespace that is used as the identity provider. For more information about Quick Suite namespaces, see Namespace operations.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The Amazon Quick Suite configuration for an Amazon Q Business application that uses Quick Suite as the identity provider. For more information, see Creating an Amazon Quick Suite integrated application.
" + } + }, + "com.amazonaws.qbusiness#ReadAccessType": { + "type": "enum", + "members": { + "ALLOW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ALLOW" + } + }, + "DENY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DENY" + } + } + } + }, + "com.amazonaws.qbusiness#RelevantContent": { + "type": "structure", + "members": { + "content": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The actual content of the relevant item.
" + } + }, + "documentId": { + "target": "com.amazonaws.qbusiness#DocumentId", + "traits": { + "smithy.api#documentation": "The unique identifier of the document containing the relevant content.
" + } + }, + "documentTitle": { + "target": "com.amazonaws.qbusiness#Title", + "traits": { + "smithy.api#documentation": "The title of the document containing the relevant content.
" + } + }, + "documentUri": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The URI of the document containing the relevant content.
" + } + }, + "documentAttributes": { + "target": "com.amazonaws.qbusiness#DocumentAttributes", + "traits": { + "smithy.api#documentation": "Additional attributes of the document containing the relevant content.
" + } + }, + "scoreAttributes": { + "target": "com.amazonaws.qbusiness#ScoreAttributes", + "traits": { + "smithy.api#documentation": "Attributes related to the relevance score of the content.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Represents a piece of content that is relevant to a search query.
" + } + }, + "com.amazonaws.qbusiness#RelevantContentList": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#RelevantContent" + } + }, + "com.amazonaws.qbusiness#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.qbusiness#ErrorMessage", + "traits": { + "smithy.api#documentation": "The message describing a ResourceNotFoundException.
The identifier of the resource affected.
", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The type of the resource affected.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The application or plugin resource you want to use doesn\u2019t exist. Make sure you have provided the correct resource and try again.
", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.qbusiness#ResponseConfiguration": { + "type": "structure", + "members": { + "instructionCollection": { + "target": "com.amazonaws.qbusiness#InstructionCollection", + "traits": { + "smithy.api#documentation": "A collection of instructions that guide how Amazon Q Business generates responses, including parameters for response length, target audience, perspective, output style, identity, tone, and custom instructions.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration settings to define how Amazon Q Business generates and formats responses to user queries. This includes customization options for response style, tone, length, and other characteristics.
" + } + }, + "com.amazonaws.qbusiness#ResponseConfigurationSummary": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1000 + } + } + }, + "com.amazonaws.qbusiness#ResponseConfigurationType": { + "type": "enum", + "members": { + "ALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ALL" + } + } + } + }, + "com.amazonaws.qbusiness#ResponseConfigurations": { + "type": "map", + "key": { + "target": "com.amazonaws.qbusiness#ResponseConfigurationType" + }, + "value": { + "target": "com.amazonaws.qbusiness#ResponseConfiguration" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, + "com.amazonaws.qbusiness#ResponseScope": { + "type": "enum", + "members": { + "ENTERPRISE_CONTENT_ONLY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENTERPRISE_CONTENT_ONLY" + } + }, + "EXTENDED_KNOWLEDGE_ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EXTENDED_KNOWLEDGE_ENABLED" + } + } + } + }, + "com.amazonaws.qbusiness#Retriever": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application using the retriever.
" + } + }, + "retrieverId": { + "target": "com.amazonaws.qbusiness#RetrieverId", + "traits": { + "smithy.api#documentation": "The identifier of the retriever used by your Amazon Q Business application.
" + } + }, + "type": { + "target": "com.amazonaws.qbusiness#RetrieverType", + "traits": { + "smithy.api#documentation": "The type of your retriever.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#RetrieverStatus", + "traits": { + "smithy.api#documentation": "The status of your retriever.
" + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#RetrieverName", + "traits": { + "smithy.api#documentation": "The name of your retriever.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Summary information for the retriever used for your Amazon Q Business application.
" + } + }, + "com.amazonaws.qbusiness#RetrieverArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$" + } + }, + "com.amazonaws.qbusiness#RetrieverConfiguration": { + "type": "union", + "members": { + "nativeIndexConfiguration": { + "target": "com.amazonaws.qbusiness#NativeIndexConfiguration", + "traits": { + "smithy.api#documentation": "Provides information on how a Amazon Q Business index used as a retriever for your Amazon Q Business application is configured.
" + } + }, + "kendraIndexConfiguration": { + "target": "com.amazonaws.qbusiness#KendraIndexConfiguration", + "traits": { + "smithy.api#documentation": "Provides information on how the Amazon Kendra index used as a retriever for your Amazon Q Business application is configured.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information on how the retriever used for your Amazon Q Business application is configured.
" + } + }, + "com.amazonaws.qbusiness#RetrieverContentSource": { + "type": "structure", + "members": { + "retrieverId": { + "target": "com.amazonaws.qbusiness#RetrieverId", + "traits": { + "smithy.api#documentation": "The unique identifier of the retriever to use as the content source.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Specifies a retriever as the content source for a search.
" + } + }, + "com.amazonaws.qbusiness#RetrieverId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#RetrieverName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1000 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + } + }, + "com.amazonaws.qbusiness#RetrieverResource": { + "type": "resource", + "identifiers": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId" + }, + "retrieverId": { + "target": "com.amazonaws.qbusiness#RetrieverId" + } + }, + "create": { + "target": "com.amazonaws.qbusiness#CreateRetriever" + }, + "read": { + "target": "com.amazonaws.qbusiness#GetRetriever" + }, + "update": { + "target": "com.amazonaws.qbusiness#UpdateRetriever" + }, + "delete": { + "target": "com.amazonaws.qbusiness#DeleteRetriever" + }, + "list": { + "target": "com.amazonaws.qbusiness#ListRetrievers" + }, + "traits": { + "aws.cloudformation#cfnResource": { + "name": "Retriever" + } + } + }, + "com.amazonaws.qbusiness#RetrieverStatus": { + "type": "enum", + "members": { + "CREATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATING" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + } + } + }, + "com.amazonaws.qbusiness#RetrieverType": { + "type": "enum", + "members": { + "NATIVE_INDEX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NATIVE_INDEX" + } + }, + "KENDRA_INDEX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KENDRA_INDEX" + } + } + } + }, + "com.amazonaws.qbusiness#Retrievers": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Retriever" + } + }, + "com.amazonaws.qbusiness#RoleArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$" + } + }, + "com.amazonaws.qbusiness#Rule": { + "type": "structure", + "members": { + "includedUsersAndGroups": { + "target": "com.amazonaws.qbusiness#UsersAndGroups", + "traits": { + "smithy.api#documentation": "Users and groups to be included in a rule.
" + } + }, + "excludedUsersAndGroups": { + "target": "com.amazonaws.qbusiness#UsersAndGroups", + "traits": { + "smithy.api#documentation": "Users and groups to be excluded from a rule.
" + } + }, + "ruleType": { + "target": "com.amazonaws.qbusiness#RuleType", + "traits": { + "smithy.api#documentation": "The type of rule.
", + "smithy.api#required": {} + } + }, + "ruleConfiguration": { + "target": "com.amazonaws.qbusiness#RuleConfiguration", + "traits": { + "smithy.api#documentation": "The configuration information for a rule.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Guardrail rules for an Amazon Q Business application. Amazon Q Business supports only one rule at a time.
" + } + }, + "com.amazonaws.qbusiness#RuleConfiguration": { + "type": "union", + "members": { + "contentBlockerRule": { + "target": "com.amazonaws.qbusiness#ContentBlockerRule", + "traits": { + "smithy.api#documentation": "A rule for configuring how Amazon Q Business responds when it encounters a a blocked topic.
" + } + }, + "contentRetrievalRule": { + "target": "com.amazonaws.qbusiness#ContentRetrievalRule" + } + }, + "traits": { + "smithy.api#documentation": "Provides configuration information about a rule.
" + } + }, + "com.amazonaws.qbusiness#RuleType": { + "type": "enum", + "members": { + "CONTENT_BLOCKER_RULE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CONTENT_BLOCKER_RULE" + } + }, + "CONTENT_RETRIEVAL_RULE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CONTENT_RETRIEVAL_RULE" + } + } + } + }, + "com.amazonaws.qbusiness#Rules": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Rule" + }, + "traits": { + "smithy.api#length": { + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#S3": { + "type": "structure", + "members": { + "bucket": { + "target": "com.amazonaws.qbusiness#S3BucketName", + "traits": { + "smithy.api#documentation": "The name of the S3 bucket that contains the file.
", + "smithy.api#required": {} + } + }, + "key": { + "target": "com.amazonaws.qbusiness#S3ObjectKey", + "traits": { + "smithy.api#documentation": "The name of the file.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Information required for Amazon Q Business to find a specific file in an Amazon S3 bucket.
" + } + }, + "com.amazonaws.qbusiness#S3BucketName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 63 + }, + "smithy.api#pattern": "^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$" + } + }, + "com.amazonaws.qbusiness#S3ObjectKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + } + } + }, + "com.amazonaws.qbusiness#SamlAttribute": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + } + } + }, + "com.amazonaws.qbusiness#SamlAuthenticationUrl": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1284 + }, + "smithy.api#pattern": "^https://.*$" + } + }, + "com.amazonaws.qbusiness#SamlConfiguration": { + "type": "structure", + "members": { + "metadataXML": { + "target": "com.amazonaws.qbusiness#SamlMetadataXML", + "traits": { + "smithy.api#documentation": "The metadata XML that your IdP generated.
", + "smithy.api#required": {} + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of an IAM role assumed by users when they authenticate into their Amazon Q Business web experience, containing the relevant Amazon Q Business permissions for conversing with Amazon Q Business.
", + "smithy.api#required": {} + } + }, + "userIdAttribute": { + "target": "com.amazonaws.qbusiness#SamlAttribute", + "traits": { + "smithy.api#documentation": "The user attribute name in your IdP that maps to the user email.
", + "smithy.api#required": {} + } + }, + "userGroupAttribute": { + "target": "com.amazonaws.qbusiness#SamlAttribute", + "traits": { + "smithy.api#documentation": "The group attribute name in your IdP that maps to user groups.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides the SAML 2.0 compliant identity provider (IdP) configuration information Amazon Q Business needs to deploy a Amazon Q Business web experience.
" + } + }, + "com.amazonaws.qbusiness#SamlMetadataXML": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1000, + "max": 10000000 + }, + "smithy.api#pattern": "^.*$" + } + }, + "com.amazonaws.qbusiness#SamlProviderConfiguration": { + "type": "structure", + "members": { + "authenticationUrl": { + "target": "com.amazonaws.qbusiness#SamlAuthenticationUrl", + "traits": { + "smithy.api#documentation": "The URL where Amazon Q Business end users will be redirected for authentication.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Information about the SAML 2.0-compliant identity provider (IdP) used to authenticate end users of an Amazon Q Business web experience.
" + } + }, + "com.amazonaws.qbusiness#ScoreAttributes": { + "type": "structure", + "members": { + "scoreConfidence": { + "target": "com.amazonaws.qbusiness#ScoreConfidence", + "traits": { + "smithy.api#documentation": "The confidence level of the relevance score.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information about the relevance score of content.
" + } + }, + "com.amazonaws.qbusiness#ScoreConfidence": { + "type": "enum", + "members": { + "VERY_HIGH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VERY_HIGH" + } + }, + "HIGH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HIGH" + } + }, + "MEDIUM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEDIUM" + } + }, + "LOW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOW" + } + }, + "NOT_AVAILABLE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_AVAILABLE" + } + } + } + }, + "com.amazonaws.qbusiness#SearchRelevantContent": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#SearchRelevantContentRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#SearchRelevantContentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#LicenseNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Searches for relevant content in a Amazon Q Business application based on a query. This operation takes a search query text, the Amazon Q Business application identifier, and optional filters (such as content source and maximum results) as input. It returns a list of relevant content items, where each item includes the content text, the unique document identifier, the document title, the document URI, any relevant document attributes, and score attributes indicating the confidence level of the relevance.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/relevant-content", + "method": "POST" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "relevantContent" + } + } + }, + "com.amazonaws.qbusiness#SearchRelevantContentRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application to search.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "queryText": { + "target": "com.amazonaws.qbusiness#QueryText", + "traits": { + "smithy.api#documentation": "The text to search for.
", + "smithy.api#required": {} + } + }, + "contentSource": { + "target": "com.amazonaws.qbusiness#ContentSource", + "traits": { + "smithy.api#documentation": "The source of content to search in.
", + "smithy.api#required": {} + } + }, + "attributeFilter": { + "target": "com.amazonaws.qbusiness#AttributeFilter" + }, + "maxResults": { + "target": "com.amazonaws.qbusiness#MaxResults", + "traits": { + "smithy.api#addedDefault": {}, + "smithy.api#default": 10, + "smithy.api#documentation": "The maximum number of results to return.
" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "The token for the next set of results. (You received this token from a previous call.)
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#SearchRelevantContentResponse": { + "type": "structure", + "members": { + "relevantContent": { + "target": "com.amazonaws.qbusiness#RelevantContentList", + "traits": { + "smithy.api#documentation": "The list of relevant content items found.
" + } + }, + "nextToken": { + "target": "com.amazonaws.qbusiness#NextToken", + "traits": { + "smithy.api#documentation": "The token to use to retrieve the next set of results, if there are any.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#SecretArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$" + } + }, + "com.amazonaws.qbusiness#SecurityGroupId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 200 + }, + "smithy.api#pattern": "^[-0-9a-zA-Z]+$" + } + }, + "com.amazonaws.qbusiness#SecurityGroupIds": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#SecurityGroupId" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.qbusiness#ErrorMessage", + "traits": { + "smithy.api#documentation": "The message describing a ServiceQuotaExceededException.
The identifier of the resource affected.
", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The type of the resource affected.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "You have exceeded the set limits for your Amazon Q Business service.
", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.qbusiness#SessionDurationInMinutes": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 15, + "max": 60 + } + } + }, + "com.amazonaws.qbusiness#SnippetExcerpt": { + "type": "structure", + "members": { + "text": { + "target": "com.amazonaws.qbusiness#SnippetExcerptText", + "traits": { + "smithy.api#documentation": "The relevant text excerpt from a source that was used to generate a citation text segment in an Amazon Q chat response.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Contains the relevant text excerpt from a source that was used to generate a citation text segment in an Amazon Q Business chat response.
" + } + }, + "com.amazonaws.qbusiness#SnippetExcerptText": { + "type": "string" + }, + "com.amazonaws.qbusiness#SourceAttribution": { + "type": "structure", + "members": { + "title": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The title of the document which is the source for the Amazon Q Business generated response.
" + } + }, + "snippet": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The content extract from the document on which the generated response is based.
" + } + }, + "url": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The URL of the document which is the source for the Amazon Q Business generated response.
" + } + }, + "citationNumber": { + "target": "com.amazonaws.qbusiness#Integer", + "traits": { + "smithy.api#documentation": "The number attached to a citation in an Amazon Q Business generated response.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business application was last updated.
" + } + }, + "textMessageSegments": { + "target": "com.amazonaws.qbusiness#TextSegmentList", + "traits": { + "smithy.api#documentation": "A text extract from a source document that is used for source attribution.
" + } + }, + "documentId": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The unique identifier of the source document used in the citation, obtained from the Amazon Q Business index during chat response generation. This ID is used as input to the GetDocumentContent API to retrieve the actual document content for user verification.
The identifier of the index containing the source document's metadata and access control information. This links the citation back to the specific Amazon Q Business index where the document's searchable content and permissions are stored.
" + } + }, + "datasourceId": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The identifier of the data source from which the document was ingested. This field is not present if the document is ingested by directly calling the BatchPutDocument API (similar to checkDocumentAccess). If the document is from a file-upload data source, the datasource will be \"uploaded-docs-file-stat-datasourceid\".
" + } + } + }, + "traits": { + "smithy.api#documentation": "The documents used to generate an Amazon Q Business web experience response.
" + } + }, + "com.amazonaws.qbusiness#SourceAttributionMediaId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#SourceAttributions": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#SourceAttribution" + }, + "traits": { + "smithy.api#sparse": {} + } + }, + "com.amazonaws.qbusiness#SourceDetails": { + "type": "union", + "members": { + "imageSourceDetails": { + "target": "com.amazonaws.qbusiness#ImageSourceDetails", + "traits": { + "smithy.api#documentation": "Details specific to image content within the source.
" + } + }, + "audioSourceDetails": { + "target": "com.amazonaws.qbusiness#AudioSourceDetails", + "traits": { + "smithy.api#documentation": "Details specific to audio content within the source.
" + } + }, + "videoSourceDetails": { + "target": "com.amazonaws.qbusiness#VideoSourceDetails", + "traits": { + "smithy.api#documentation": "Details specific to video content within the source.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Container for details about different types of media sources (image, audio, or video).
" + } + }, + "com.amazonaws.qbusiness#StartDataSourceSyncJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#StartDataSourceSyncJobRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#StartDataSourceSyncJobResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Starts a data source connector synchronization job. If a synchronization job is already in progress, Amazon Q Business returns a ConflictException.
The identifier of the data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of Amazon Q Business application the data source is connected to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index used with the data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#StartDataSourceSyncJobResponse": { + "type": "structure", + "members": { + "executionId": { + "target": "com.amazonaws.qbusiness#ExecutionId", + "traits": { + "smithy.api#documentation": "The identifier for a particular synchronization job.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#StatementId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + }, + "smithy.api#pattern": "^[a-zA-Z0-9_-]+$" + } + }, + "com.amazonaws.qbusiness#Status": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.qbusiness#StopDataSourceSyncJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#StopDataSourceSyncJobRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#StopDataSourceSyncJobResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Stops an Amazon Q Business data source connector synchronization job already in progress.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/stopsync", + "method": "POST" + } + } + }, + "com.amazonaws.qbusiness#StopDataSourceSyncJobRequest": { + "type": "structure", + "members": { + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application that the data source is connected to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index used with the Amazon Q Business data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#StopDataSourceSyncJobResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#String": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + } + } + }, + "com.amazonaws.qbusiness#StringAttributeBoostingConfiguration": { + "type": "structure", + "members": { + "boostingLevel": { + "target": "com.amazonaws.qbusiness#DocumentAttributeBoostingLevel", + "traits": { + "smithy.api#documentation": "Specifies the priority tier ranking of boosting applied to document attributes. For version 2, this parameter indicates the relative ranking between boosted fields (ONE being highest priority, TWO being second highest, etc.) and determines the order in which attributes influence document ranking in search results. For version 1, this parameter specifies the boosting intensity. For version 2, boosting intensity (VERY HIGH, HIGH, MEDIUM, LOW, NONE) are not supported. Note that in version 2, you are not allowed to boost on only one field and make this value TWO.
", + "smithy.api#required": {} + } + }, + "attributeValueBoosting": { + "target": "com.amazonaws.qbusiness#StringAttributeValueBoosting", + "traits": { + "smithy.api#documentation": "Specifies specific values of a STRING type document attribute being boosted. When using NativeIndexConfiguration version 2, you can specify up to five values in order of priority.
Provides information on boosting STRING type document attributes.
For STRING and STRING_LIST type document attributes to be used for boosting on the console and the API, they must be enabled for search using the DocumentAttributeConfiguration object of the UpdateIndex API. If you haven't enabled searching on these attributes, you can't boost attributes of these data types on either the console or the API.
For more information on how boosting document attributes work in Amazon Q Business, see Boosting using document attributes.
" + } + }, + "com.amazonaws.qbusiness#StringAttributeValueBoosting": { + "type": "map", + "key": { + "target": "com.amazonaws.qbusiness#String" + }, + "value": { + "target": "com.amazonaws.qbusiness#StringAttributeValueBoostingLevel" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#StringAttributeValueBoostingLevel": { + "type": "enum", + "members": { + "LOW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOW" + } + }, + "MEDIUM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEDIUM" + } + }, + "HIGH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HIGH" + } + }, + "VERY_HIGH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VERY_HIGH" + } + }, + "ONE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ONE" + } + }, + "TWO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TWO" + } + }, + "THREE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "THREE" + } + }, + "FOUR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FOUR" + } + }, + "FIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FIVE" + } + } + } + }, + "com.amazonaws.qbusiness#StringListAttributeBoostingConfiguration": { + "type": "structure", + "members": { + "boostingLevel": { + "target": "com.amazonaws.qbusiness#DocumentAttributeBoostingLevel", + "traits": { + "smithy.api#documentation": "Specifies the priority of boosted document attributes in relation to other boosted attributes. This parameter determines how strongly the attribute influences document ranking in search results. STRING_LIST attributes can serve as additional boosting factors when needed, but are not supported when using NativeIndexConfiguration version 2.
Provides information on boosting STRING_LIST type document attributes.
In the current boosting implementation, boosting focuses primarily on DATE attributes for recency and STRING attributes for source prioritization. STRING_LIST attributes can serve as additional boosting factors when needed, but are not supported when using NativeIndexConfiguration version 2.
For STRING and STRING_LIST type document attributes to be used for boosting on the console and the API, they must be enabled for search using the DocumentAttributeConfiguration object of the UpdateIndex API. If you haven't enabled searching on these attributes, you can't boost attributes of these data types on either the console or the API.
For more information on how boosting document attributes work in Amazon Q Business, see Boosting using document attributes.
" + } + }, + "com.amazonaws.qbusiness#SubnetId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 200 + }, + "smithy.api#pattern": "^[-0-9a-zA-Z]+$" + } + }, + "com.amazonaws.qbusiness#SubnetIds": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#SubnetId" + } + }, + "com.amazonaws.qbusiness#Subscription": { + "type": "structure", + "members": { + "subscriptionId": { + "target": "com.amazonaws.qbusiness#SubscriptionId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business subscription to be updated.
" + } + }, + "subscriptionArn": { + "target": "com.amazonaws.qbusiness#SubscriptionArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the Amazon Q Business subscription that was updated.
" + } + }, + "principal": { + "target": "com.amazonaws.qbusiness#SubscriptionPrincipal", + "traits": { + "smithy.api#documentation": "The IAM Identity Center UserId or GroupId of a user or group in the IAM Identity Center instance connected to the Amazon Q Business application.
The type of your current Amazon Q Business subscription.
" + } + }, + "nextSubscription": { + "target": "com.amazonaws.qbusiness#SubscriptionDetails", + "traits": { + "smithy.api#documentation": "The type of the Amazon Q Business subscription for the next month.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Information about an Amazon Q Business subscription.
Subscriptions are used to provide access for an IAM Identity Center user or a group to an Amazon Q Business application.
Amazon Q Business offers two subscription tiers: Q_LITE and Q_BUSINESS. Subscription tier determines feature access for the user. For more information on subscriptions and pricing tiers, see Amazon Q Business pricing.
The type of an Amazon Q Business subscription.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The details of an Amazon Q Business subscription.
" + } + }, + "com.amazonaws.qbusiness#SubscriptionId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1224 + } + } + }, + "com.amazonaws.qbusiness#SubscriptionPrincipal": { + "type": "union", + "members": { + "user": { + "target": "com.amazonaws.qbusiness#UserIdentifier", + "traits": { + "smithy.api#documentation": "The identifier of a user in the IAM Identity Center instance connected to the Amazon Q Business application.
" + } + }, + "group": { + "target": "com.amazonaws.qbusiness#GroupIdentifier", + "traits": { + "smithy.api#documentation": "The identifier of a group in the IAM Identity Center instance connected to the Amazon Q Business application.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A user or group in the IAM Identity Center instance connected to the Amazon Q Business application.
" + } + }, + "com.amazonaws.qbusiness#SubscriptionType": { + "type": "enum", + "members": { + "Q_LITE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Q_LITE" + } + }, + "Q_BUSINESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Q_BUSINESS" + } + } + } + }, + "com.amazonaws.qbusiness#Subscriptions": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Subscription" + } + }, + "com.amazonaws.qbusiness#SyncSchedule": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 998 + }, + "smithy.api#pattern": "^[\\s\\S]*$" + } + }, + "com.amazonaws.qbusiness#SystemMessageId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{35}$" + } + }, + "com.amazonaws.qbusiness#SystemMessageOverride": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 350 + }, + "smithy.api#pattern": "^\\P{C}*$" + } + }, + "com.amazonaws.qbusiness#SystemMessageType": { + "type": "enum", + "members": { + "RESPONSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RESPONSE" + } + }, + "GROUNDED_RESPONSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GROUNDED_RESPONSE" + } + } + } + }, + "com.amazonaws.qbusiness#Tag": { + "type": "structure", + "members": { + "key": { + "target": "com.amazonaws.qbusiness#TagKey", + "traits": { + "smithy.api#documentation": "The key for the tag. Keys are not case sensitive and must be unique for the Amazon Q Business application or data source.
", + "smithy.api#required": {} + } + }, + "value": { + "target": "com.amazonaws.qbusiness#TagValue", + "traits": { + "smithy.api#documentation": "The value associated with the tag. The value may be an empty string but it can't be null.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A list of key/value pairs that identify an index, FAQ, or data source. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
" + } + }, + "com.amazonaws.qbusiness#TagKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + } + } + }, + "com.amazonaws.qbusiness#TagKeys": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#TagKey" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.qbusiness#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#TagResourceRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#TagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#conditionKeys": [ + "aws:RequestTag/${TagKey}", + "aws:TagKeys" + ], + "smithy.api#documentation": "Adds the specified tag to the specified Amazon Q Business application or data source resource. If the tag already exists, the existing value is replaced with the new value.
", + "smithy.api#http": { + "uri": "/v1/tags/{resourceARN}", + "method": "POST" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#TagResourceRequest": { + "type": "structure", + "members": { + "resourceARN": { + "target": "com.amazonaws.qbusiness#AmazonResourceName", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the Amazon Q Business application or data source to tag.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.qbusiness#Tags", + "traits": { + "smithy.api#documentation": "A list of tag keys to add to the Amazon Q Business application or data source. If a tag already exists, the existing value is replaced with the new value.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#TagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#TagValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + } + } + }, + "com.amazonaws.qbusiness#Tags": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Tag" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.qbusiness#TextDocumentStatistics": { + "type": "structure", + "members": { + "indexedTextBytes": { + "target": "com.amazonaws.qbusiness#IndexedTextBytes", + "traits": { + "smithy.api#documentation": "The total size, in bytes, of the indexed documents.
" + } + }, + "indexedTextDocumentCount": { + "target": "com.amazonaws.qbusiness#IndexedTextDocument", + "traits": { + "smithy.api#documentation": "The number of text documents indexed.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information about text documents in an index.
" + } + }, + "com.amazonaws.qbusiness#TextInputEvent": { + "type": "structure", + "members": { + "userMessage": { + "target": "com.amazonaws.qbusiness#UserMessage", + "traits": { + "smithy.api#documentation": "A user message in a text message input event.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An input event for a end user message in an Amazon Q Business web experience.
" + } + }, + "com.amazonaws.qbusiness#TextOutputEvent": { + "type": "structure", + "members": { + "systemMessageType": { + "target": "com.amazonaws.qbusiness#SystemMessageType", + "traits": { + "smithy.api#documentation": "The type of AI-generated message in a TextOutputEvent. Amazon Q Business currently supports two types of messages:
RESPONSE - The Amazon Q Business system response.
GROUNDED_RESPONSE - The corrected, hallucination-reduced, response returned by Amazon Q Business. Available only if hallucination reduction is supported and configured for the application and detected in the end user chat query by Amazon Q Business.
The identifier of the conversation with which the text output event is associated.
" + } + }, + "userMessageId": { + "target": "com.amazonaws.qbusiness#MessageId", + "traits": { + "smithy.api#documentation": "The identifier of an end user message in a TextOutputEvent.
The identifier of an AI-generated message in a TextOutputEvent.
An AI-generated message in a TextOutputEvent.
An output event for an AI-generated response in an Amazon Q Business web experience.
" + } + }, + "com.amazonaws.qbusiness#TextSegment": { + "type": "structure", + "members": { + "beginOffset": { + "target": "com.amazonaws.qbusiness#Integer", + "traits": { + "smithy.api#documentation": "The zero-based location in the response string where the source attribution starts.
" + } + }, + "endOffset": { + "target": "com.amazonaws.qbusiness#Integer", + "traits": { + "smithy.api#documentation": "The zero-based location in the response string where the source attribution ends.
" + } + }, + "snippetExcerpt": { + "target": "com.amazonaws.qbusiness#SnippetExcerpt", + "traits": { + "smithy.api#documentation": "The relevant text excerpt from a source that was used to generate a citation text segment in an Amazon Q Business chat response.
" + } + }, + "mediaId": { + "target": "com.amazonaws.qbusiness#SourceAttributionMediaId", + "traits": { + "smithy.api#deprecated": { + "since": "2025-02-28", + "message": "Deprecated in favor of using mediaId within the respective sourceDetails field." + }, + "smithy.api#documentation": "The identifier of the media object associated with the text segment in the source attribution.
" + } + }, + "mediaMimeType": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#deprecated": { + "since": "2025-02-28", + "message": "Deprecated in favor of using mediaMimeType within the respective sourceDetails field." + }, + "smithy.api#documentation": "The MIME type (image/png) of the media object associated with the text segment in the source attribution.
" + } + }, + "sourceDetails": { + "target": "com.amazonaws.qbusiness#SourceDetails", + "traits": { + "smithy.api#documentation": "Source information for a segment of extracted text, including its media type.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information about a text extract in a chat response that can be attributed to a source document.
" + } + }, + "com.amazonaws.qbusiness#TextSegmentList": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#TextSegment" + } + }, + "com.amazonaws.qbusiness#ThrottlingException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.qbusiness#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The request was denied due to throttling. Reduce the number of requests and try again.
", + "smithy.api#error": "client", + "smithy.api#httpError": 429 + } + }, + "com.amazonaws.qbusiness#Timestamp": { + "type": "timestamp" + }, + "com.amazonaws.qbusiness#Title": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + } + } + }, + "com.amazonaws.qbusiness#TopicConfiguration": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.qbusiness#TopicConfigurationName", + "traits": { + "smithy.api#documentation": "A name for your topic control configuration.
", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.qbusiness#TopicDescription", + "traits": { + "smithy.api#documentation": "A description for your topic control configuration. Use this to outline how the large language model (LLM) should use this topic control configuration.
" + } + }, + "exampleChatMessages": { + "target": "com.amazonaws.qbusiness#ExampleChatMessages", + "traits": { + "smithy.api#documentation": "A list of example phrases that you expect the end user to use in relation to the topic.
" + } + }, + "rules": { + "target": "com.amazonaws.qbusiness#Rules", + "traits": { + "smithy.api#documentation": "Rules defined for a topic configuration.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The topic specific controls configured for an Amazon Q Business application.
" + } + }, + "com.amazonaws.qbusiness#TopicConfigurationName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{0,35}$" + } + }, + "com.amazonaws.qbusiness#TopicConfigurations": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#TopicConfiguration" + }, + "traits": { + "smithy.api#length": { + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#TopicDescription": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 350 + }, + "smithy.api#pattern": "^\\P{C}*$" + } + }, + "com.amazonaws.qbusiness#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UntagResourceRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UntagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#conditionKeys": [ + "aws:TagKeys" + ], + "smithy.api#documentation": "Removes a tag from an Amazon Q Business application or a data source.
", + "smithy.api#http": { + "uri": "/v1/tags/{resourceARN}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#UntagResourceRequest": { + "type": "structure", + "members": { + "resourceARN": { + "target": "com.amazonaws.qbusiness#AmazonResourceName", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the Amazon Q Business application, or data source to remove the tag from.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "tagKeys": { + "target": "com.amazonaws.qbusiness#TagKeys", + "traits": { + "smithy.api#documentation": "A list of tag keys to remove from the Amazon Q Business application or data source. If a tag key does not exist on the resource, it is ignored.
", + "smithy.api#httpQuery": "tagKeys", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UntagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#UpdateApplication": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UpdateApplicationRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UpdateApplicationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetApplication", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole", + "sso:CreateApplication", + "sso:PutApplicationAuthenticationMethod", + "sso:PutApplicationAccessScope", + "sso:PutApplicationGrant", + "sso:DeleteApplication", + "sso:DescribeInstance" + ], + "smithy.api#documentation": "Updates an existing Amazon Q Business application.
Amazon Q Business applications may securely transmit data for processing across Amazon Web Services Regions within your geography. For more information, see Cross region inference in Amazon Q Business.
An Amazon Q Apps service-linked role will be created if it's absent in the Amazon Web Services account when QAppsConfiguration is enabled in the request. For more information, see Using service-linked roles for Q Apps.
The identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "identityCenterInstanceArn": { + "target": "com.amazonaws.qbusiness#InstanceArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the IAM Identity Center instance you are either creating for\u2014or connecting to\u2014your Amazon Q Business application.
" + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#ApplicationName", + "traits": { + "smithy.api#documentation": "A name for the Amazon Q Business application.
" + } + }, + "description": { + "target": "com.amazonaws.qbusiness#Description", + "traits": { + "smithy.api#documentation": "A description for the Amazon Q Business application.
" + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "An Amazon Web Services Identity and Access Management (IAM) role that gives Amazon Q Business permission to access Amazon CloudWatch logs and metrics.
" + } + }, + "attachmentsConfiguration": { + "target": "com.amazonaws.qbusiness#AttachmentsConfiguration", + "traits": { + "smithy.api#documentation": "An option to allow end users to upload files directly during chat.
" + } + }, + "qAppsConfiguration": { + "target": "com.amazonaws.qbusiness#QAppsConfiguration", + "traits": { + "smithy.api#documentation": "An option to allow end users to create and use Amazon Q Apps in the web experience.
" + } + }, + "personalizationConfiguration": { + "target": "com.amazonaws.qbusiness#PersonalizationConfiguration", + "traits": { + "smithy.api#documentation": "Configuration information about chat response personalization. For more information, see Personalizing chat responses.
" + } + }, + "autoSubscriptionConfiguration": { + "target": "com.amazonaws.qbusiness#AutoSubscriptionConfiguration", + "traits": { + "smithy.api#documentation": "An option to enable updating the default subscription type assigned to an Amazon Q Business application using IAM identity federation for user management.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UpdateApplicationResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#UpdateChatControlsConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UpdateChatControlsConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UpdateChatControlsConfigurationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Updates a set of chat controls configured for an existing Amazon Q Business application.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/chatcontrols", + "method": "PATCH", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#UpdateChatControlsConfigurationRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application for which the chat controls are configured.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#ClientToken", + "traits": { + "smithy.api#documentation": "A token that you provide to identify the request to update a Amazon Q Business application chat configuration.
", + "smithy.api#idempotencyToken": {} + } + }, + "responseScope": { + "target": "com.amazonaws.qbusiness#ResponseScope", + "traits": { + "smithy.api#documentation": "The response scope configured for your application. This determines whether your application uses its retrieval augmented generation (RAG) system to generate answers only from your enterprise data, or also uses the large language models (LLM) knowledge to respons to end user questions in chat.
" + } + }, + "orchestrationConfiguration": { + "target": "com.amazonaws.qbusiness#OrchestrationConfiguration", + "traits": { + "smithy.api#documentation": "The chat response orchestration settings for your application.
" + } + }, + "blockedPhrasesConfigurationUpdate": { + "target": "com.amazonaws.qbusiness#BlockedPhrasesConfigurationUpdate", + "traits": { + "smithy.api#documentation": "The phrases blocked from chat by your chat control configuration.
" + } + }, + "topicConfigurationsToCreateOrUpdate": { + "target": "com.amazonaws.qbusiness#TopicConfigurations", + "traits": { + "smithy.api#documentation": "The configured topic specific chat controls you want to update.
" + } + }, + "topicConfigurationsToDelete": { + "target": "com.amazonaws.qbusiness#TopicConfigurations", + "traits": { + "smithy.api#documentation": "The configured topic specific chat controls you want to delete.
" + } + }, + "creatorModeConfiguration": { + "target": "com.amazonaws.qbusiness#CreatorModeConfiguration", + "traits": { + "smithy.api#documentation": "The configuration details for CREATOR_MODE.
The hallucination reduction settings for your application.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UpdateChatControlsConfigurationResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#UpdateChatResponseConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UpdateChatResponseConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UpdateChatResponseConfigurationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "requiredActions": [ + "qbusiness:GetChatResponseConfiguration", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource" + ] + }, + "smithy.api#documentation": "Updates an existing chat response configuration in an Amazon Q Business application. This operation allows administrators to modify configuration settings, display name, and response parameters to refine how the system generates responses.
", + "smithy.api#http": { + "method": "PUT", + "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#UpdateChatResponseConfigurationRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application containing the chat response configuration to update.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "chatResponseConfigurationId": { + "target": "com.amazonaws.qbusiness#ChatResponseConfigurationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the chat response configuration to update within the specified application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#DisplayName", + "traits": { + "smithy.api#documentation": "The new human-readable name to assign to the chat response configuration, making it easier to identify among multiple configurations.
" + } + }, + "responseConfigurations": { + "target": "com.amazonaws.qbusiness#ResponseConfigurations", + "traits": { + "smithy.api#documentation": "The updated collection of response configuration settings that define how Amazon Q Business generates and formats responses to user queries.
", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "A unique, case-sensitive identifier to ensure idempotency of the request. This helps prevent the same update from being processed multiple times if retries occur.
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UpdateChatResponseConfigurationResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#UpdateDataAccessor": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UpdateDataAccessorRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UpdateDataAccessorResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetDataAccessor", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource" + ], + "smithy.api#documentation": "Updates an existing data accessor. This operation allows modifying the action configurations (the allowed actions and associated filters) and the display name of the data accessor. It does not allow changing the IAM role associated with the data accessor or other core properties of the data accessor.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", + "method": "PUT" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#UpdateDataAccessorRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The unique identifier of the Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataAccessorId": { + "target": "com.amazonaws.qbusiness#DataAccessorId", + "traits": { + "smithy.api#documentation": "The unique identifier of the data accessor to update.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "actionConfigurations": { + "target": "com.amazonaws.qbusiness#ActionConfigurationList", + "traits": { + "smithy.api#documentation": "The updated list of action configurations specifying the allowed actions and any associated filters.
", + "smithy.api#required": {} + } + }, + "authenticationDetail": { + "target": "com.amazonaws.qbusiness#DataAccessorAuthenticationDetail", + "traits": { + "smithy.api#documentation": "The updated authentication configuration details for the data accessor. This specifies how the ISV will authenticate when accessing data through this data accessor.
" + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#DataAccessorName", + "traits": { + "smithy.api#documentation": "The updated friendly name for the data accessor.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UpdateDataAccessorResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#UpdateDataSource": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UpdateDataSourceRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UpdateDataSourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetDataSource", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole" + ], + "smithy.api#documentation": "Updates an existing Amazon Q Business data source connector.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", + "method": "PUT" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#UpdateDataSourceRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application the data source is attached to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index attached to the data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source connector.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#DataSourceName", + "traits": { + "smithy.api#documentation": "A name of the data source connector.
" + } + }, + "configuration": { + "target": "com.amazonaws.qbusiness#DataSourceConfiguration" + }, + "vpcConfiguration": { + "target": "com.amazonaws.qbusiness#DataSourceVpcConfiguration" + }, + "description": { + "target": "com.amazonaws.qbusiness#Description", + "traits": { + "smithy.api#documentation": "The description of the data source connector.
" + } + }, + "syncSchedule": { + "target": "com.amazonaws.qbusiness#SyncSchedule", + "traits": { + "smithy.api#documentation": "The chosen update frequency for your data source.
" + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources.
" + } + }, + "documentEnrichmentConfiguration": { + "target": "com.amazonaws.qbusiness#DocumentEnrichmentConfiguration" + }, + "mediaExtractionConfiguration": { + "target": "com.amazonaws.qbusiness#MediaExtractionConfiguration", + "traits": { + "smithy.api#documentation": "The configuration for extracting information from media in documents for your data source.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UpdateDataSourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#UpdateIndex": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UpdateIndexRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UpdateIndexResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetIndex", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource" + ], + "smithy.api#documentation": "Updates an Amazon Q Business index.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/indices/{indexId}", + "method": "PUT" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#UpdateIndexRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application connected to the index.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business index.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#ApplicationName", + "traits": { + "smithy.api#documentation": "The name of the Amazon Q Business index.
" + } + }, + "description": { + "target": "com.amazonaws.qbusiness#Description", + "traits": { + "smithy.api#documentation": "The description of the Amazon Q Business index.
" + } + }, + "capacityConfiguration": { + "target": "com.amazonaws.qbusiness#IndexCapacityConfiguration", + "traits": { + "smithy.api#documentation": "The storage capacity units you want to provision for your Amazon Q Business index. You can add and remove capacity to fit your usage needs.
" + } + }, + "documentAttributeConfigurations": { + "target": "com.amazonaws.qbusiness#DocumentAttributeConfigurations", + "traits": { + "smithy.api#documentation": "Configuration information for document metadata or fields. Document metadata are fields or attributes associated with your documents. For example, the company department name associated with each document. For more information, see Understanding document attributes.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UpdateIndexResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#UpdatePlugin": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UpdatePluginRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UpdatePluginResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetPlugin", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole" + ], + "smithy.api#documentation": "Updates an Amazon Q Business plugin.
", + "smithy.api#http": { + "method": "PUT", + "uri": "/applications/{applicationId}/plugins/{pluginId}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#UpdatePluginRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application the plugin is attached to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "pluginId": { + "target": "com.amazonaws.qbusiness#PluginId", + "traits": { + "smithy.api#documentation": "The identifier of the plugin.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "displayName": { + "target": "com.amazonaws.qbusiness#PluginName", + "traits": { + "smithy.api#documentation": "The name of the plugin.
" + } + }, + "state": { + "target": "com.amazonaws.qbusiness#PluginState", + "traits": { + "smithy.api#documentation": "The status of the plugin.
" + } + }, + "serverUrl": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The source URL used for plugin configuration.
" + } + }, + "customPluginConfiguration": { + "target": "com.amazonaws.qbusiness#CustomPluginConfiguration", + "traits": { + "smithy.api#documentation": "The configuration for a custom plugin.
" + } + }, + "authConfiguration": { + "target": "com.amazonaws.qbusiness#PluginAuthConfiguration", + "traits": { + "smithy.api#documentation": "The authentication configuration the plugin is using.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UpdatePluginResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#UpdateRetriever": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UpdateRetrieverRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UpdateRetrieverResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + "qbusiness:GetRetriever", + "iam:PassRole" + ], + "smithy.api#documentation": "Updates the retriever used for your Amazon Q Business application.
", + "smithy.api#http": { + "method": "PUT", + "uri": "/applications/{applicationId}/retrievers/{retrieverId}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#UpdateRetrieverRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of your Amazon Q Business application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "retrieverId": { + "target": "com.amazonaws.qbusiness#RetrieverId", + "traits": { + "smithy.api#documentation": "The identifier of your retriever.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "configuration": { + "target": "com.amazonaws.qbusiness#RetrieverConfiguration" + }, + "displayName": { + "target": "com.amazonaws.qbusiness#RetrieverName", + "traits": { + "smithy.api#documentation": "The name of your retriever.
" + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of an IAM role with permission to access the retriever and required resources.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UpdateRetrieverResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#UpdateSubscription": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UpdateSubscriptionRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UpdateSubscriptionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Updates the pricing tier for an Amazon Q Business subscription. Upgrades are instant. Downgrades apply at the start of the next month. Subscription tier determines feature access for the user. For more information on subscriptions and pricing tiers, see Amazon Q Business pricing.
", + "smithy.api#http": { + "method": "PUT", + "uri": "/applications/{applicationId}/subscriptions/{subscriptionId}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#UpdateSubscriptionRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application where the subscription update should take effect.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "subscriptionId": { + "target": "com.amazonaws.qbusiness#SubscriptionId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business subscription to be updated.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.qbusiness#SubscriptionType", + "traits": { + "smithy.api#documentation": "The type of the Amazon Q Business subscription to be updated.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UpdateSubscriptionResponse": { + "type": "structure", + "members": { + "subscriptionArn": { + "target": "com.amazonaws.qbusiness#SubscriptionArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the Amazon Q Business subscription that was updated.
" + } + }, + "currentSubscription": { + "target": "com.amazonaws.qbusiness#SubscriptionDetails", + "traits": { + "smithy.api#documentation": "The type of your current Amazon Q Business subscription.
" + } + }, + "nextSubscription": { + "target": "com.amazonaws.qbusiness#SubscriptionDetails", + "traits": { + "smithy.api#documentation": "The type of the Amazon Q Business subscription for the next month.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#UpdateUser": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UpdateUserRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UpdateUserResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Updates a information associated with a user id.
", + "smithy.api#http": { + "method": "PUT", + "uri": "/applications/{applicationId}/users/{userId}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#UpdateUserRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the application the user is attached to.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The email id attached to the user.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "userAliasesToUpdate": { + "target": "com.amazonaws.qbusiness#UserAliases", + "traits": { + "smithy.api#documentation": "The user aliases attached to the user id that are to be updated.
" + } + }, + "userAliasesToDelete": { + "target": "com.amazonaws.qbusiness#UserAliases", + "traits": { + "smithy.api#documentation": "The user aliases attached to the user id that are to be deleted.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UpdateUserResponse": { + "type": "structure", + "members": { + "userAliasesAdded": { + "target": "com.amazonaws.qbusiness#UserAliases", + "traits": { + "smithy.api#documentation": "The user aliases that have been to be added to a user id.
" + } + }, + "userAliasesUpdated": { + "target": "com.amazonaws.qbusiness#UserAliases", + "traits": { + "smithy.api#documentation": "The user aliases attached to a user id that have been updated.
" + } + }, + "userAliasesDeleted": { + "target": "com.amazonaws.qbusiness#UserAliases", + "traits": { + "smithy.api#documentation": "The user aliases that have been deleted from a user id.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#UpdateWebExperience": { + "type": "operation", + "input": { + "target": "com.amazonaws.qbusiness#UpdateWebExperienceRequest" + }, + "output": { + "target": "com.amazonaws.qbusiness#UpdateWebExperienceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qbusiness#AccessDeniedException" + }, + { + "target": "com.amazonaws.qbusiness#ConflictException" + }, + { + "target": "com.amazonaws.qbusiness#InternalServerException" + }, + { + "target": "com.amazonaws.qbusiness#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qbusiness#ThrottlingException" + }, + { + "target": "com.amazonaws.qbusiness#ValidationException" + } + ], + "traits": { + "aws.iam#requiredActions": [ + "qbusiness:GetWebExperience", + "qbusiness:TagResource", + "qbusiness:UntagResource", + "qbusiness:ListTagsForResource", + "iam:PassRole", + "sso:PutApplicationGrant", + "sso:UpdateApplication" + ], + "smithy.api#documentation": "Updates an Amazon Q Business web experience.
", + "smithy.api#http": { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}", + "method": "PUT" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qbusiness#UpdateWebExperienceRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business application attached to the web experience.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "webExperienceId": { + "target": "com.amazonaws.qbusiness#WebExperienceId", + "traits": { + "smithy.api#documentation": "The identifier of the Amazon Q Business web experience.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "roleArn": { + "target": "com.amazonaws.qbusiness#RoleArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the role with permission to access the Amazon Q Business web experience and required resources.
" + } + }, + "authenticationConfiguration": { + "target": "com.amazonaws.qbusiness#WebExperienceAuthConfiguration", + "traits": { + "smithy.api#deprecated": { + "message": "Property associated with legacy SAML IdP flow. Deprecated in favor of using AWS IAM Identity Center for user management." + }, + "smithy.api#documentation": "The authentication configuration of the Amazon Q Business web experience.
" + } + }, + "title": { + "target": "com.amazonaws.qbusiness#WebExperienceTitle", + "traits": { + "smithy.api#documentation": "The title of the Amazon Q Business web experience.
" + } + }, + "subtitle": { + "target": "com.amazonaws.qbusiness#WebExperienceSubtitle", + "traits": { + "smithy.api#documentation": "The subtitle of the Amazon Q Business web experience.
" + } + }, + "welcomeMessage": { + "target": "com.amazonaws.qbusiness#WebExperienceWelcomeMessage", + "traits": { + "smithy.api#documentation": "A customized welcome message for an end user in an Amazon Q Business web experience.
" + } + }, + "samplePromptsControlMode": { + "target": "com.amazonaws.qbusiness#WebExperienceSamplePromptsControlMode", + "traits": { + "smithy.api#documentation": "Determines whether sample prompts are enabled in the web experience for an end user.
" + } + }, + "identityProviderConfiguration": { + "target": "com.amazonaws.qbusiness#IdentityProviderConfiguration", + "traits": { + "smithy.api#documentation": "Information about the identity provider (IdP) used to authenticate end users of an Amazon Q Business web experience.
" + } + }, + "origins": { + "target": "com.amazonaws.qbusiness#WebExperienceOrigins", + "traits": { + "smithy.api#documentation": "Updates the website domain origins that are allowed to embed the Amazon Q Business web experience. The domain origin refers to the base URL for accessing a website including the protocol (http/https), the domain name, and the port number (if specified).
Any values except null submitted as part of this update will replace all previous values.
You must only submit a base URL and not a full path. For example, https://docs.aws.amazon.com.
The browser extension configuration for an Amazon Q Business web experience.
For Amazon Q Business application using external OIDC-compliant identity providers (IdPs). The IdP administrator must add the browser extension sign-in redirect URLs to the IdP application. For more information, see Configure external OIDC identity provider for your browser extensions..
Updates the custom logo, favicon, font, and color used in the Amazon Q web experience.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qbusiness#UpdateWebExperienceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.qbusiness#Url": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^(https?|ftp|file)://([^\\s]*)$" + } + }, + "com.amazonaws.qbusiness#UserAlias": { + "type": "structure", + "members": { + "indexId": { + "target": "com.amazonaws.qbusiness#IndexId", + "traits": { + "smithy.api#documentation": "The identifier of the index that the user aliases are associated with.
" + } + }, + "dataSourceId": { + "target": "com.amazonaws.qbusiness#DataSourceId", + "traits": { + "smithy.api#documentation": "The identifier of the data source that the user aliases are associated with.
" + } + }, + "userId": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The identifier of the user id associated with the user aliases.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Aliases attached to a user id within an Amazon Q Business application.
" + } + }, + "com.amazonaws.qbusiness#UserAliases": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#UserAlias" + } + }, + "com.amazonaws.qbusiness#UserGroups": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#String" + } + }, + "com.amazonaws.qbusiness#UserId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^\\P{C}*$" + } + }, + "com.amazonaws.qbusiness#UserIdentifier": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 47 + }, + "smithy.api#pattern": "^([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$" + } + }, + "com.amazonaws.qbusiness#UserIds": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#String" + } + }, + "com.amazonaws.qbusiness#UserMessage": { + "type": "string" + }, + "com.amazonaws.qbusiness#UsersAndGroups": { + "type": "structure", + "members": { + "userIds": { + "target": "com.amazonaws.qbusiness#UserIds", + "traits": { + "smithy.api#documentation": "The user ids associated with a topic control rule.
" + } + }, + "userGroups": { + "target": "com.amazonaws.qbusiness#UserGroups", + "traits": { + "smithy.api#documentation": "The user group names associated with a topic control rule.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information about users and group names associated with a topic control rule.
" + } + }, + "com.amazonaws.qbusiness#ValidationException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.qbusiness#ErrorMessage", + "traits": { + "smithy.api#documentation": "The message describing the ValidationException.
The reason for the ValidationException.
The input field(s) that failed validation.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The input doesn't meet the constraints set by the Amazon Q Business service. Provide the correct input and try again.
", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.qbusiness#ValidationExceptionField": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The field name where the invalid entry was detected.
", + "smithy.api#required": {} + } + }, + "message": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "A message about the validation exception.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "The input failed to meet the constraints specified by Amazon Q Business in a specified field.
" + } + }, + "com.amazonaws.qbusiness#ValidationExceptionFields": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#ValidationExceptionField" + } + }, + "com.amazonaws.qbusiness#ValidationExceptionReason": { + "type": "enum", + "members": { + "CANNOT_PARSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CANNOT_PARSE" + } + }, + "FIELD_VALIDATION_FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FIELD_VALIDATION_FAILED" + } + }, + "UNKNOWN_OPERATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UNKNOWN_OPERATION" + } + } + } + }, + "com.amazonaws.qbusiness#VideoExtractionConfiguration": { + "type": "structure", + "members": { + "videoExtractionStatus": { + "target": "com.amazonaws.qbusiness#VideoExtractionStatus", + "traits": { + "smithy.api#documentation": "The status of video extraction (ENABLED or DISABLED) for processing video content from files.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Configuration settings for video content extraction and processing.
" + } + }, + "com.amazonaws.qbusiness#VideoExtractionStatus": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.qbusiness#VideoExtractionType": { + "type": "enum", + "members": { + "TRANSCRIPT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TRANSCRIPT" + } + }, + "SUMMARY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SUMMARY" + } + } + } + }, + "com.amazonaws.qbusiness#VideoSourceDetails": { + "type": "structure", + "members": { + "mediaId": { + "target": "com.amazonaws.qbusiness#MediaId", + "traits": { + "smithy.api#documentation": "Unique identifier for the video media file.
" + } + }, + "mediaMimeType": { + "target": "com.amazonaws.qbusiness#String", + "traits": { + "smithy.api#documentation": "The MIME type of the video file (e.g., video/mp4, video/avi).
" + } + }, + "startTimeMilliseconds": { + "target": "com.amazonaws.qbusiness#Long", + "traits": { + "smithy.api#documentation": "The starting timestamp in milliseconds for the relevant video segment.
" + } + }, + "endTimeMilliseconds": { + "target": "com.amazonaws.qbusiness#Long", + "traits": { + "smithy.api#documentation": "The ending timestamp in milliseconds for the relevant video segment.
" + } + }, + "videoExtractionType": { + "target": "com.amazonaws.qbusiness#VideoExtractionType", + "traits": { + "smithy.api#documentation": "The type of video extraction performed on the content.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Details about a video source, including its identifier, format, and time information.
" + } + }, + "com.amazonaws.qbusiness#WebExperience": { + "type": "structure", + "members": { + "webExperienceId": { + "target": "com.amazonaws.qbusiness#WebExperienceId", + "traits": { + "smithy.api#documentation": "The identifier of your Amazon Q Business web experience.
" + } + }, + "createdAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when the Amazon Q Business application was last updated.
" + } + }, + "updatedAt": { + "target": "com.amazonaws.qbusiness#Timestamp", + "traits": { + "smithy.api#documentation": "The Unix timestamp when your Amazon Q Business web experience was updated.
" + } + }, + "defaultEndpoint": { + "target": "com.amazonaws.qbusiness#Url", + "traits": { + "smithy.api#documentation": "The endpoint URLs for your Amazon Q Business web experience. The URLs are unique and fully hosted by Amazon Web Services.
" + } + }, + "status": { + "target": "com.amazonaws.qbusiness#WebExperienceStatus", + "traits": { + "smithy.api#documentation": "The status of your Amazon Q Business web experience.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information for an Amazon Q Business web experience.
" + } + }, + "com.amazonaws.qbusiness#WebExperienceArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1284 + }, + "smithy.api#pattern": "^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$" + } + }, + "com.amazonaws.qbusiness#WebExperienceAuthConfiguration": { + "type": "union", + "members": { + "samlConfiguration": { + "target": "com.amazonaws.qbusiness#SamlConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Provides the authorization configuration information needed to deploy a Amazon Q Business web experience to end users.
" + } + }, + "com.amazonaws.qbusiness#WebExperienceId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]*$" + } + }, + "com.amazonaws.qbusiness#WebExperienceOrigins": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#Origin" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 10 + } + } + }, + "com.amazonaws.qbusiness#WebExperienceResource": { + "type": "resource", + "identifiers": { + "applicationId": { + "target": "com.amazonaws.qbusiness#ApplicationId" + }, + "webExperienceId": { + "target": "com.amazonaws.qbusiness#WebExperienceId" + } + }, + "create": { + "target": "com.amazonaws.qbusiness#CreateWebExperience" + }, + "read": { + "target": "com.amazonaws.qbusiness#GetWebExperience" + }, + "update": { + "target": "com.amazonaws.qbusiness#UpdateWebExperience" + }, + "delete": { + "target": "com.amazonaws.qbusiness#DeleteWebExperience" + }, + "list": { + "target": "com.amazonaws.qbusiness#ListWebExperiences" + }, + "traits": { + "aws.cloudformation#cfnResource": { + "name": "WebExperience" + } + } + }, + "com.amazonaws.qbusiness#WebExperienceSamplePromptsControlMode": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.qbusiness#WebExperienceStatus": { + "type": "enum", + "members": { + "CREATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATING" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "PENDING_AUTH_CONFIG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PENDING_AUTH_CONFIG" + } + } + } + }, + "com.amazonaws.qbusiness#WebExperienceSubtitle": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 500 + }, + "smithy.api#pattern": "^[\\s\\S]*$" + } + }, + "com.amazonaws.qbusiness#WebExperienceTitle": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 500 + }, + "smithy.api#pattern": "^[\\s\\S]*$" + } + }, + "com.amazonaws.qbusiness#WebExperienceWelcomeMessage": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 300 + } + } + }, + "com.amazonaws.qbusiness#WebExperiences": { + "type": "list", + "member": { + "target": "com.amazonaws.qbusiness#WebExperience" + } + } + } +} \ No newline at end of file